hermes - 💡(How to fix) Fix Harden memory capture and recall bounds for Supermemory/provider-backed memory [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…

Several memory-provider and memory-recall paths can unexpectedly increase token usage or push large payloads into the active agent context. This is most visible with Supermemory-backed setups, but the underlying fixes are general memory hygiene and should apply to any provider-backed memory/search integration.

Root Cause

A user can have a paid memory backend and still need conservative capture. Turning off broad automatic capture should not make memory useless; it should make memory curated. Explicit save/search flows still need to work well, while automatic ingestion and recall payloads stay bounded.

This would make Hermes safer for long-running gateway deployments where memory is always available but should only persist durable facts when explicitly requested or when the agent intentionally chooses to save something.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Summary

Several memory-provider and memory-recall paths can unexpectedly increase token usage or push large payloads into the active agent context. This is most visible with Supermemory-backed setups, but the underlying fixes are general memory hygiene and should apply to any provider-backed memory/search integration.

Problems observed

  1. auto_capture: false should fully disable automatic session-end ingestion.

    • Expected: only explicit memory writes should be persisted when auto-capture is disabled.
    • Risk: if session-end capture still runs, memory quota can be consumed very quickly and users lose trust in turning memory on.
  2. capture_mode: explicit should remain explicit.

    • Expected: explicit capture mode should not be normalized/coerced into broad capture.
    • Risk: users choose conservative memory behavior but still get broader ingestion than intended.
  3. Supermemory capture should safely handle multimodal/list/dict message content.

    • Expected: content cleaning should stringify text-bearing structured content and omit raw image/media payloads.
    • Risk: multimodal gateway turns can raise type errors such as expected string or bytes-like object, got 'list', or store unusable media-shaped payloads.
  4. Memory/search/profile tools need output caps at the tool boundary.

    • Expected: provider-backed recall/search/profile results should respect a configurable character cap and append a visible truncation notice.
    • Risk: recall can flood the active context, trigger compression, degrade latency, and make memory feel worse as it grows.
  5. Explicit memory writes should include useful source metadata.

    • Expected: explicit saves can include metadata such as source/tool/container tag/session context where appropriate, without logging secrets.
    • Risk: later cleanup, debugging, or auditing is harder than necessary.

Suggested implementation

  • Treat memory.auto_capture: false as authoritative in session-end memory ingestion paths.
  • Preserve capture_mode: explicit during config/provider normalization.
  • Add a Supermemory content-normalization helper that:
    • accepts strings directly,
    • extracts text from OpenAI-style content arrays,
    • stringifies simple dict/list text content,
    • skips or summarizes image/media payloads rather than storing raw payloads.
  • Add a shared helper for memory-search result caps, e.g. driven by memory.search_result_char_limit.
    • Apply it to session/memory search and provider-backed profile/search output.
    • Make truncation explicit in the returned text, not silent.
  • Add tests covering:
    • auto_capture: false prevents session-end persistence,
    • explicit capture mode is preserved,
    • multimodal/list content does not crash Supermemory cleanup,
    • memory/search/profile output respects the configured cap,
    • explicit writes still succeed and include non-sensitive metadata.

Why this matters

A user can have a paid memory backend and still need conservative capture. Turning off broad automatic capture should not make memory useless; it should make memory curated. Explicit save/search flows still need to work well, while automatic ingestion and recall payloads stay bounded.

This would make Hermes safer for long-running gateway deployments where memory is always available but should only persist durable facts when explicitly requested or when the agent intentionally chooses to save something.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Harden memory capture and recall bounds for Supermemory/provider-backed memory [1 pull requests]