* chore: add .worktrees/ to .gitignore * feat(examples): add Zo Computer memory skill integration * feat(examples): add Zo Computer memory skill integration * fix(examples): address CodeRabbit review on Zo skill integration - Fix version inconsistency: SKILL.md matches pyproject.toml (>=2.1.0) - Move client.py into tools/ package and use relative imports - Add assistant_id parameter to save_memory() for consistency with get_context() - Use UUID-based IDs in tests to prevent state leakage between runs - Add pytest.mark.skipif guard on integration tests (requires HONCHO_API_KEY) - Fix import ordering, move pytest to module level, sort __all__ alphabetically - Fix markdown blank lines around fenced code blocks (MD031) - Add rate limit delay fixture to avoid hitting Honcho free tier limits * fix(examples): validate HONCHO_API_KEY early in client initialization * docs(examples): note cross-peer memory behavior in shared workspaces * docs(examples): fix save_memory and query_memory signatures in README * docs(examples): fix markdown linting issues in README * docs(examples): add assistant_id parameter to save_memory example in SKILL.md --------- Co-authored-by: Luba Kaper <lubakaper@lubas-air.mynetworksettings.com> |
||
|---|---|---|
| .. | ||
| tests | ||
| tools | ||
| README.md | ||
| SKILL.md | ||
| pyproject.toml | ||
| uv.lock | ||
README.md
Honcho Memory Skill for Zo Computer
Give your AI persistent memory across conversations using Honcho.
Features
- Auto-Memory: Save user and assistant messages to Honcho with one call
- Query Memory: Ask natural language questions about what Honcho remembers ("What are my hobbies?")
- Context Injection: Retrieve conversation context formatted for direct LLM use
- Multi-Workspace Support: Manage separate memory spaces via
HONCHO_WORKSPACE_ID
Installation
pip install honcho-ai python-dotenv
Or with uv:
uv add honcho-ai python-dotenv
Environment Variables
Create a .env file:
HONCHO_API_KEY=your-api-key-here
HONCHO_WORKSPACE_ID=default
Get your API key at honcho.dev.
Quick Start
from tools.save_memory import save_memory
from tools.query_memory import query_memory
from tools.get_context import get_context
# Save a conversation turn
save_memory("alice", "I love hiking in the mountains", "user", "session-1")
save_memory("alice", "That sounds wonderful!", "assistant", "session-1")
# Query what Honcho remembers
answer = query_memory("alice", "What are my hobbies?", "session-1")
print(answer) # "Alice enjoys hiking in the mountains."
# Get context ready for an LLM call
messages = get_context("alice", "session-1", "assistant", tokens=4000)
# messages is a list of {"role": ..., "content": ...} dicts
Tool Reference
save_memory(user_id, content, role, session_id, assistant_id="assistant")
Saves a message to Honcho memory.
| Param | Type | Description |
|---|---|---|
user_id |
str |
Unique user identifier |
content |
str |
Message text |
role |
str |
"user" or "assistant" |
session_id |
str |
Session/conversation identifier |
assistant_id |
str |
Peer ID for the assistant. Defaults to "assistant" |
Returns a confirmation string.
query_memory(user_id, query, session_id=None)
Queries stored memory using Honcho's Dialectic API.
| Param | Type | Description |
|---|---|---|
user_id |
str |
Unique user identifier |
query |
str |
Natural language question |
session_id |
str | None |
Optional: scope to a specific session. Defaults to None (global memory) |
Returns a natural language answer.
Note: In shared workspaces,
query_memorymay return data from other peers if the queried user has no stored memory yet. The Dialectic API draws from workspace-level context as a fallback. Use uniqueHONCHO_WORKSPACE_IDvalues per user group in production to prevent cross-peer data leakage.
get_context(user_id, session_id, assistant_id, tokens=4000)
Retrieves conversation context in OpenAI message format.
| Param | Type | Description |
|---|---|---|
user_id |
str |
Unique user identifier |
session_id |
str |
Session/conversation identifier |
assistant_id |
str |
Peer ID for the assistant |
tokens |
int |
Max tokens to include (default: 4000) |
Returns a list of {"role": ..., "content": ...} dicts.
Concept Mapping
| Zo Computer | Honcho |
|---|---|
| Account | Workspace |
| User | Peer |
| Conversation | Session |
| Message | Message |
Running Tests
Requires a running Honcho server. See the main repo for setup instructions.
uv run pytest tests/ -v
Submitting to the Zo Skill Marketplace
To publish this skill to the Zo Skills Registry:
-
Fork the
zocomputer/skillsrepository. -
Copy this directory into the
/Communityfolder of your fork, naming ithoncho-memory:Community/ └── honcho-memory/ ├── SKILL.md ├── README.md ├── client.py ├── pyproject.toml └── tools/ -
Validate your skill:
bun validate -
Submit a pull request to the upstream registry repository.
Once merged, the skill will be automatically added to the Zo marketplace manifest.json.
License
AGPL-3.0-or-later