feat(honcho): async writes, memory modes, session title integration, setup CLI#736
feat(honcho): async writes, memory modes, session title integration, setup CLI#736erosika wants to merge 19 commits intoNousResearch:mainfrom
Conversation
86ed6ea to
145f3a2
Compare
…allMode Adds full Honcho memory integration to Hermes: - Session manager with async background writes, memory modes (honcho/hybrid/local), and dialectic prefetch for first-turn context warming - Agent integration: prefetch pipeline, tool surface gated by recallMode, system prompt context injection, SIGTERM/SIGINT flush handlers - CLI commands: setup, status, mode, tokens, peer, identity, migrate - recallMode setting (auto | context | tools) for A/B testing retrieval strategies - Session strategies: per-session, per-repo (git tree root), per-directory, global - Polymorphic memoryMode config: string shorthand or per-peer object overrides - 97 tests covering async writes, client config, session resolution, and memory modes
Tell users to go to app.honcho.dev > Settings > API Keys. Updated in setup walkthrough, setup prompt, and client error message.
Explain what context vs dialectic actually do in plain language: context = raw memory retrieval, dialectic = AI-to-AI inference for session continuity. Describe what user/AI peer cards are.
Matches the mental model: hybrid = context + tools, context = context only, tools = tools only.
New tool lets Hermes persist conclusions about the user (preferences, corrections, project context) directly to Honcho via the conclusions API. Feeds into the user's peer card and representation.
Consistent naming: all honcho tools now prefixed with honcho_ (honcho_context, honcho_search, honcho_profile, honcho_conclude).
Optional 'peer' parameter: "user" (default) or "ai". Allows asking about the AI assistant's history/identity, not just the user's.
Replaces the stub docs with comprehensive coverage: setup (interactive + manual), all config fields, memory modes, recall modes, write frequency, session strategies, host blocks, async prefetch pipeline, dual-peer architecture, dynamic reasoning, gateway integration, four tools, full CLI reference, migration paths, and AI peer identity. Trims the Honcho section in memory.md to a cross-reference.
4547182 to
960c152
Compare
… language Adds back use cases section and example tool queries from the original docs. Clarifies that built-in memory and Honcho can work together or be configured separately via memoryMode.
Setup wizard now writes memoryMode, writeFrequency, recallMode, and sessionStrategy into hosts.hermes instead of the config root. Client resolution updated to read sessionStrategy and sessionPeerPrefix from host block first. Docs updated to show hosts-based config as the default example so other integrations can coexist cleanly.
…lock" This reverts commit c90ba02.
|
Thanks for the thorough work on this — the overall design is solid and the test coverage is great. There are a few issues that need to be addressed before we can merge: Critical1. Signal handler override (run_agent.py)
Fix: Use 2. Duplicate function in browser_tool.py
3. Toolset registration incomplete (toolsets.py)Only 4. Breaking default change (session_strategy)
Medium5. Incomplete prefetch pipeline
6. Private state manipulation
7. Thread safety of caches
Everything else looks good — the gateway lifecycle management, async writer with retry, CLI wizard, and test coverage are all well done. Once these are addressed we can move forward with the merge. |
Address merge-blocking review feedback by removing unsafe signal handler overrides, wiring next-turn Honcho prefetch, restoring per-directory session defaults, and exposing all Honcho tools to the model surface. Also harden prefetch cache access with public thread-safe accessors and remove duplicate browser cleanup code. Made-with: Cursor
Made-with: Cursor # Conflicts: # cli.py # tests/test_run_agent.py
Matches Hermes' native session naming (title if set, otherwise session-scoped). Not a breaking change -- no memory data is lost, old sessions remain in Honcho.
|
hi @teknium1 all of your review comments should be addressed now, thanks for taking a look. re #4: the switch from |
Config writes from hermes honcho setup/peer now go to hosts.hermes instead of mutating root-level keys. Root is reserved for the user or honcho CLI. apiKey remains at root as a shared credential. Reads updated to check hosts.hermes first with root fallback for all fields (peerName, enabled, saveMessages, environment, sessionStrategy, sessionPeerPrefix).
- Example config now shows hosts.hermes structure instead of flat root - Config table split into root-level (shared) and host-level sections - sessionStrategy default corrected to per-session - Multi-host section expanded with two-tool example - Note that existing root-level configs still work via fallback
Prevent stale Honcho tool exposure in context/local modes, restore reliable async write retry behavior, and ensure SOUL.md migration uploads target the AI peer instead of the user peer. Also align Honcho CLI key checks with host-scoped apiKey resolution and lock the fixes with regression tests. Made-with: Cursor
Summary
Builds on the Honcho integration landed in #38 and the auto-enable fix in #243.
Adds async write support, configurable memory modes, context prefetch with first-turn warm, a first-class
hermes honchoCLI, AI peer identity formation, recallMode A/B testing, and a bidirectional tool surface.New config fields (
~/.honcho/config.json){ // string shorthand — all peers use this mode "memoryMode": "hybrid", // "hybrid" | "honcho" | "local" "writeFrequency": "async", // "async" | "turn" | "session" | N (int) "dialecticReasoningLevel": "low", // "minimal" | "low" | "medium" | "high" | "max" "dialecticMaxChars": 600, "recallMode": "hybrid", // "hybrid" | "context" | "tools" "sessionStrategy": "per-repo", // "per-session" | "per-repo" | "per-directory" | "global" "sessions": { "/path/to/project": "my-project" }, // optional: per-host overrides — all fields above can be scoped here "hosts": { "hermes": { "workspace": "my-workspace", // object form: per-peer memory mode overrides for any named Honcho peer "memoryMode": { "default": "hybrid", "user": "hybrid", "hermes": "honcho", "sentinel": "local" } } } }write_frequency
"async"(default)"turn""session"5(int)memory_mode
"hybrid"(default)"honcho""local"memoryModeaccepts a string (applies to all peers) or an object with named peer keys and an optional"default". Any Honcho peer name can be used as a key — not limited to the built-in user/assistant pair.recallMode
Controls how Hermes retrieves memory from Honcho each turn:
"hybrid"(default)"context""tools"Useful for A/B testing whether context injection or tool-based retrieval works better for a given workflow.
Context + dialectic prefetch
Two separate Honcho API calls power the memory pipeline:
session.context()) — raw memory retrieval. Returns stored facts and session history, injected directly into the system prompt.peer.chat()) — AI-to-AI inference. Hermes asks Honcho's AI peer a synthesized question (e.g. "what were we working on?") and Honcho runs its own model to generate an answer. Powers first-turn session continuity.Both are warmed synchronously at session init so the very first turn has full context ("where did we leave off?" works immediately). On subsequent turns, both fire as background daemon threads at turn end — results are cached and consumed at the start of the next turn with zero blocking.
Context calls use
peer_perspectiveso Honcho frames user context from the agent's viewpoint. Dialectic reasoning level scales dynamically with message length: < 120 chars: configured default, 120-400: +1 level, > 400: +2 levels, capped at "max".Session strategies
"per-session"(default)"per-repo"git rev-parse --show-toplevelname)"per-directory""global"Manual overrides via
sessionsmap always win./titlemid-session remaps the Honcho session key.Peer identity formation
observe_me=Trueis set on the AI peer so Honcho watches every assistant message and builds the agent's representation organically across sessions. New methods:seed_ai_identity(session_key, content, source)— prime the AI peer from SOUL.md or any fileget_ai_representation(session_key)— fetch current AI peer representation on demandget_peer_card(session_key)— fetch user peer card (curated facts, no LLM)migrate_memory_filesnow includes SOUL.md (uploaded to AI peer, not user peer)ai_peername replaces "Hermes Agent" in DEFAULT_AGENT_IDENTITYhermes honcho identity --showdisplays both peers side by sideTool surface
Four tools — three for reading memory, one for writing back:
honcho_contexthoncho_searchhoncho_profilehoncho_concludehoncho_concludewrites conclusions (preferences, corrections, project context) via the conclusions API. These feed into the user's peer card and representation over time.hermes honcho CLI
hermes honcho setuphermes honcho statushermes honcho sessionshermes honcho map <name>hermes honcho peerhermes honcho peer --user NAMEhermes honcho peer --ai NAMEhermes honcho peer --reasoning LEVELhermes honcho mode [hybrid/honcho/local]hermes honcho tokens [--context N] [--dialectic N]hermes honcho identity <file>hermes honcho identity --showhermes honcho migrateHermes injects a compact command reference into its own system prompt when Honcho is active, so it can refer users to these commands directly.
Other changes
resolve_session_nameaccepts the Hermes/titlevalue;/titlemid-session live-remaps the Honcho session keyconversation_history,MEMORY.md,USER.md, andSOUL.mduploaded to Honcho on first session init/compressflush:flush_all()called before context window resets and before gateway session drops_honcho_syncerrors upgraded from silentlogger.debugtologger.warning+ user-visible printhermes doctor: new Honcho Memory section checks config, API key, and live connectionRelated PRs
Test plan
pytest tests/honcho_integration/)hermes honcho setupwalks through config, writes~/.honcho/config.json, shows tools and next stepshermes honcho statusshows live connection resulthermes honcho mode,hermes honcho tokens,hermes honcho peerall show/set correctlyhermes honcho identity <file>seeds AI peer;--showreturns user peer card + AI peer representation side by sidehermes honcho migratedetects OpenClaw native files, offers inline uploadrecallMode=context: memory tools removed, context block injected;recallMode=tools: no context, tools onlyhoncho_concludepersists a fact; fact appears in subsequenthoncho_profileresultshoncho_searchreturns raw excerpts for a semantic querywrite_frequency=async: no blocking per turn; messages appear in Honcho after background flushmemory_mode=honcho: local MEMORY.md flush disabled;memory_mode=local: Honcho sync skippedsessionStrategy=per-repo: sessions scoped to git repo root, not bleeding across projects