hermes - 💡(How to fix) Fix Honcho memory tools ignore focused query and token budget controls [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Bug description

The Honcho memory tool schemas advertise focused retrieval controls that are not fully honored by the current implementation:

  • honcho_context exposes an optional query parameter described as focusing/filtering context, but the handler currently calls get_session_context(..., peer=peer) without passing the query through.
  • honcho_search accepts max_tokens, but HonchoSessionManager.search_context() returns the assembled representation/card blob without deterministic budget trimming.

This makes the Hermes tool surface noisier than the underlying focused Honcho/pgvector retrieval path: broad peer representation/card content can dominate even when a caller asks for a focused search or smaller token budget.

Expected behavior

  • honcho_context(query=...) should pass the focused query into Honcho peer-context retrieval rather than silently returning broad session context.
  • honcho_search(max_tokens=N) should bound its returned raw context to the requested approximate token budget.
  • The existing JSON shape ({"result": ...}) should remain backward-compatible for a narrow bugfix.

Proposed first slice

Keep the first PR intentionally narrow:

  1. Pass query from the honcho_context tool handler into HonchoSessionManager.get_session_context().
  2. When a query is present, fetch focused peer context via peer.context(search_query=..., target=...) instead of broad session context.
  3. Apply deterministic post-fetch trimming in search_context() based on max_tokens.
  4. Add regression tests for the drift above.

Out of scope for the first PR

  • Switching honcho_search to a new conclusions/query API.
  • Adding top_k, min_score, MMR, or structured ranked result arrays.
  • Changing peer routing semantics.

Those would be good follow-up work after the schema/implementation drift is fixed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • honcho_context(query=...) should pass the focused query into Honcho peer-context retrieval rather than silently returning broad session context.
  • honcho_search(max_tokens=N) should bound its returned raw context to the requested approximate token budget.
  • The existing JSON shape ({"result": ...}) should remain backward-compatible for a narrow bugfix.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING