hermes - 💡(How to fix) Fix Fix bounded memory: durable unlimited user memory with retrieval

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…

Root Cause

Desired behavior

Implement an effectively unlimited persisted user memory system:

  1. Keep a small curated prompt snapshot for always-on critical facts.
  2. Persist all accepted memory writes durably in an append-only/retrieval-backed store (SQLite/FTS/vector/provider), not only USER.md/MEMORY.md prompt files.
  3. When prompt snapshot is full, do not fail the write. Store the new fact in long-term memory and optionally mark it for condensation/curation.
  4. Retrieve relevant durable memory per turn via query/context engine, so fixes/preferences are not lost just because they do not fit in the prompt snapshot.
  5. Add tests that verify memory.add succeeds past prompt-snapshot limits by overflowing to durable retrieval storage.

Fix Action

Fix / Workaround

Immediate mitigation used

Raised local profile limits to memory.memory_char_limit=100000 and memory.user_char_limit=50000, but this is only a stopgap. The correct fix is retrieval-backed overflow, not ever-growing prompt injection.

RAW_BUFFERClick to expand / collapse

Problem

Hermes' built-in curated memory is currently bounded by prompt-injected character limits (memory.memory_char_limit, memory.user_char_limit). In this deployment it repeatedly hits the user-profile cap, causing failed memory.add calls and repeated loss of operator corrections/preferences.

Relevant implementation:

  • tools/memory_tool.py rejects adds when new_total > limit
  • default limits in hermes_cli/config.py are small; this user had already raised them to 8k/3k and still hit the cap
  • memory files are durable, but the write path refuses new entries instead of moving overflow into a retrieval-backed durable store

Desired behavior

Implement an effectively unlimited persisted user memory system:

  1. Keep a small curated prompt snapshot for always-on critical facts.
  2. Persist all accepted memory writes durably in an append-only/retrieval-backed store (SQLite/FTS/vector/provider), not only USER.md/MEMORY.md prompt files.
  3. When prompt snapshot is full, do not fail the write. Store the new fact in long-term memory and optionally mark it for condensation/curation.
  4. Retrieve relevant durable memory per turn via query/context engine, so fixes/preferences are not lost just because they do not fit in the prompt snapshot.
  5. Add tests that verify memory.add succeeds past prompt-snapshot limits by overflowing to durable retrieval storage.

Acceptance criteria

  • memory.add(target=user|memory, ...) no longer fails solely because prompt snapshot is full when unlimited/durable memory is enabled.
  • Existing USER.md/MEMORY.md remain supported as curated snapshot files.
  • Config exposes a clear migration-safe mode, e.g. memory.overflow_backend: sqlite or a default local SQLite memory backend.
  • Gateway/CLI sessions retrieve relevant overflow memories before/while building context.
  • Existing prefix-cache behavior remains intact: mid-session writes persist immediately but do not mutate the frozen system prompt until a new session.

Immediate mitigation used

Raised local profile limits to memory.memory_char_limit=100000 and memory.user_char_limit=50000, but this is only a stopgap. The correct fix is retrieval-backed overflow, not ever-growing prompt injection.

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