@that-yolanda/pi-memory-honcho

extensionmaintained

Honcho-backed persistent memory extension for PI coding agent.

by · v0.4.4 · published 2mo ago

$ pi install npm:@that-yolanda/pi-memory-honcho
downloads/mo
0
stars
0
last push
2mo ago
open issues
1

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

460 downloads · last 12 weeks (weekly)

README

pi-memory-honcho

Honcho-backed persistent memory extension for the PI coding agent. Persistent user context, cross-workspace memory sharing, and dialectic reasoning across sessions.

Forked from acsezen/pi-memory-honcho. Maintained as part of that-yolanda/pi-extensions.

Install

pi install npm:@that-yolanda/pi-memory-honcho

Setup

  1. Get a Honcho API key from honcho.dev or self-host.
  2. Run /honcho:setup inside PI to configure your key, workspace, and peer names.
  3. Verify with /honcho:doctor.

Or create ~/.honcho/config.json manually:

{
  "apiKey": "hch-v3-...",
  "peerName": "yourname",
  "hosts": {
    "pi": {
      "workspace": "pi",
      "aiPeer": "pi",
      "recallMode": "hybrid"
    }
  }
}

Features

Memory tools

ToolDescription
honcho_profileRetrieve user profile from this and linked workspaces
honcho_searchSearch durable memory across all linked workspaces
honcho_contextSynthesize memory context via dialectic reasoning across all linked workspaces
honcho_concludeStore a durable preference, fact, or decision (primary workspace only)
honcho_seed_identitySeed the AI peer's identity representation (primary workspace only)

Commands

CommandDescription
/honcho:setupInteractive first-time configuration
/honcho:statusShow connection, cache, and config status
/honcho:configShow effective config (redacted API key)
/honcho:doctorPreflight check for config, connectivity, session
/honcho:interviewSave a preference or working style insight
/honcho:modeSwitch recall mode (hybrid / context / tools)
/honcho:syncForce context refresh and flush pending uploads
/honcho:mapMap current directory to a custom session name

Lifecycle

  • Session start: Bootstraps Honcho connection, fetches context, migrates legacy memory files (MEMORY.md, USER.md, SOUL.md)
  • Before agent start: Injects persistent memory into the system prompt (user profile, peer cards, AI profile, project summary)
  • Agent end: Uploads conversation messages to Honcho
  • Session shutdown/switch/fork/compact: Flushes pending uploads

Configuration

All fields can be set via ~/.honcho/config.json (under hosts.pi) or environment variables.

FieldEnv varDefaultDescription
recallModeHONCHO_RECALL_MODEhybridhybrid / context / tools
sessionStrategyHONCHO_SESSION_STRATEGYper-directoryper-directory / git-branch / pi-session / per-repo / global
writeFrequencyHONCHO_WRITE_FREQUENCYasyncasync / turn / session / N (number)
injectionFrequencyHONCHO_INJECTION_FREQUENCYevery-turnevery-turn / first-turn
saveMessagesHONCHO_SAVE_MESSAGEStrueUpload conversation messages to Honcho
dialecticDynamicHONCHO_DIALECTIC_DYNAMICtrueAuto-bump reasoning level by query length
dialecticMaxCharsHONCHO_DIALECTIC_MAX_CHARS600Truncate dialectic results
dialecticMaxInputCharsHONCHO_DIALECTIC_MAX_INPUT_CHARS10000Truncate dialectic queries
reasoningLevelHONCHO_REASONING_LEVELlowBase reasoning level for dialectic
reasoningLevelCapHONCHO_REASONING_LEVEL_CAPnoneHard cap on reasoning level
contextTokensHONCHO_CONTEXT_TOKENS1200Token budget for injected context
contextRefreshTtlSecondsHONCHO_CONTEXT_REFRESH_TTL_SECONDS300TTL before re-fetching context
maxMessageLengthHONCHO_MAX_MESSAGE_LENGTH25000Max chars per message chunk
searchLimitHONCHO_SEARCH_LIMIT8Max search results
sessionPeerPrefixHONCHO_SESSION_PEER_PREFIXfalsePrefix session keys with peer name
observationModeHONCHO_OBSERVATION_MODEdirectionaldirectional / unified
contextCadenceHONCHO_CONTEXT_CADENCE1Min turns between context API calls
dialecticCadenceHONCHO_DIALECTIC_CADENCE1Min turns between dialectic calls
environmentHONCHO_ENVIRONMENTproductionlocal / production
loggingHONCHO_LOGGINGtrueEnable console logging

Manual session mappings

Add sessions to your ~/.honcho/config.json to map directories to specific session names:

{
  "sessions": {
    "/home/user/project-a": "my-project-a",
    "/home/user/project-b": "my-project-b"
  }
}

Linked hosts

Share memory across AI tools by linking their workspaces. Read tools (honcho_profile, honcho_search, honcho_context) fan out to all linked workspaces and merge results. Write tools (honcho_conclude, honcho_seed_identity) stay in the primary workspace, following Honcho's workspace isolation design.

Linked host SDK clients are created once at startup and cached, not per tool call. Profile reads from linked workspaces use peer.representation() (no reasoning tokens) instead of dialectic calls.

{
  "hosts": {
    "pi": {
      "workspace": "pi",
      "aiPeer": "pi",
      "linkedHosts": ["claude_code", "codex", "cursor"]
    },
    "claude_code": {
      "workspace": "claude_code",
      "aiPeer": "claude"
    },
    "codex": {
      "workspace": "codex",
      "aiPeer": "codex"
    },
    "cursor": {
      "workspace": "cursor",
      "aiPeer": "cursor"
    }
  }
}

Each linked host must have workspace and aiPeer defined. Results are labeled by source workspace (e.g., === [cursor] ===).

Development

git clone https://github.com/that-yolanda/pi-extensions.git
cd pi-extensions/pi-memory-honcho
pnpm install
pnpm typecheck
pnpm test

Changelog

See CHANGELOG.md.

License

MIT