npx skills add ...
npx skills add plastic-labs/honcho --skill honcho-integration
Integrate Honcho memory into existing Python or TypeScript codebases. Use when adding Honcho SDK, setting up peers, configuring sessions, and accessing Honcho's representation.
npx skills add plastic-labs/honcho --skill honcho-integration
Honcho is an open source memory library for building stateful agents. It works with any model, framework, or architecture. You send Honcho the messages from your conversations, and custom reasoning models process them in the background — extracting premises, drawing conclusions, and building rich representations of each participant over time. Your agent can then query those representations on-demand ("What does this user care about?", "How technical is this person?") and get grounded, reasoned answers.
The key mental model: Peers are any participant — human or AI. Both are represented the same way. observe_me is a peer-level flag (PeerConfig) controlling whether Honcho forms a representation of that peer; typically you want Honcho to model your users (observe_me=True) but not anything with deterministic behavior (observe_me=False). observe_others is a separate per-peer SessionPeerConfig setting that controls whether that peer forms representations of the other participants in a session. Sessions scope conversations between peers. Messages are the raw data you feed in — Honcho reasons about them asynchronously and stores the results as the peer's representation. No messages means no reasoning means no memory.
Your agent accesses this memory through peer.chat(query) (ask a natural language question, get a reasoned answer — a few seconds of live reasoning) or session.context() (near-instant read of formatted history + representation). Prefer context() for per-turn grounding; use chat() when you need a reasoned answer.
Follow the workflow below. Read a reference file only when you reach the step that needs it:
| When you're… | Read |
|---|---|
| Writing the client/peer/session setup (init, peers, sessions, add messages) | references/core-patterns.md |
Wiring how the AI reads context (tool call, pre-fetch, context(), streaming) | references/agent-patterns.md |
| Integrating into a bot framework (nanobot, openclaw, picoclaw, …) | references/bot-frameworks.md + references/bot-frameworks/<framework>/ |
Follow these phases in order:
Before asking the user anything, explore the codebase to understand:
Use Glob and Grep to find:
**/*.py or **/*.ts files with "openai", "anthropic", "llm", "chat", "message"Bot framework detected? If the codebase is built around an agent loop, tool registry, session manager, and message bus (e.g., nanobot, openclaw, picoclaw), read
references/bot-frameworks.mdfor framework-specific integration guidance and checkreferences/bot-frameworks/<framework>/for concrete reference implementations.
After exploring the codebase, use the AskUserQuestion tool to clarify integration requirements. Ask these questions (adapt based on what you learned in Phase 1):
Ask about which entities should be Honcho peers:
Ask how they want to use Honcho context (see references/agent-patterns.md for the implementation of each):
Ask about conversation structure:
If they chose pre-fetch, ask what context matters:
Based on interview responses, implement the integration:
references/core-patterns.md §1references/core-patterns.md §2–3references/agent-patterns.mdreferences/core-patterns.md §4honcho doctor to confirm connectivity before testing the integration codehoncho peer list and honcho peer chat to verify peers exist and the dialectic endpoint works independently of the integrationobserve_me=False; AI-assistant peers can keep observation on (it's fine to model them)Check the latest SDK versions at https://honcho.dev/docs/changelog/introduction.md
honcho-ai@honcho-ai/sdkGet an API key ask the user to get a Honcho API key from https://app.honcho.dev and add it to the environment.
Verify with the CLI (optional but recommended). If the user has the Honcho CLI installed (uv install honcho-cli), they can validate their setup before writing any integration code:
This is the fastest way to confirm the API key and URL are correct before debugging SDK code.
The SDK is sync-by-default in Python (with an .aio async namespace) and async-only in TypeScript — match the client to your framework. Full sync/async guidance and the base client/peer/session/message code are in references/core-patterns.md.
When integrating Honcho into an existing codebase:
uv add honcho-ai (Python) or bun add @honcho-ai/sdk (TypeScript)HONCHO_API_KEY environment variableobserve_me=False for deterministic bot peers (optional for AI assistants — fine to leave observation on)honcho doctor to verify connectivity before testing integration codehoncho peer chat to test dialectic queries independentlyobserve_me=False for deterministic bots (scripted output — nothing meaningful to model). For AI assistants it's fine to leave observation on; turning it off is an optional optimization when you only care about the user.add_messages() to feed Honcho's reasoning engineTip: append
.mdto any Honcho docs URL to fetch the raw Markdown version.