Repository navigation
fix(hermes): never forget on built-in memory removals; supersede only same-fact edits - #694
Merged
Merged
Conversation
… same-fact edits Hermes' built-in stores are size-capped (memory_char_limit 2200, user_char_limit 1375) and the memory tool and background review remove or merge entries to make room. A removal in USER.md / MEMORY.md is usually an eviction, not a request to forget, so mirroring it as a forget deleted long-term facts from the durable store. - Mirror and reconcile: a removal never forgets. It logs "memory mirror: remove target=<t> removed from Hermes profile; kept in TotalReclaw" and the snapshot moves on. - Edits (replace/patch, reconcile "changed" pairs) always store the new text and forget the old fact only when the two entries are clearly the same fact (normalized difflib ratio >= 0.8) AND the existing confident vault match holds. Merges and rewrites keep the old facts. - system_prompt_block: one sentence on forgetting via totalreclaw_forget plus removing the entry from the built-in memory. - Guide Compatibility/Diagnostics, SKILL.md, changelog and tests updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
p-diogo
force-pushed
the
fix/hermes-mirror-no-evict-forget
branch
from
October 29, 2026 01:25
d3189bf to
740766e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Hermes' built-in memory is size-capped:
tools/memory_tool.pysetsmemory_char_limit2200 anduser_char_limit1375. The memory tool and the background review remove or merge entries to make room. So a removal in USER.md / MEMORY.md usually means "evicted from the short profile", not "the user wants this forgotten". #690 and #692 mirrored removals as forgets, which deletes long-term facts from the durable store that nobody asked to delete.What
The same rules apply in the foreground mirror and the reconcile pass:
remove → never forget. One INFO line,
memory mirror: remove target=<user|memory> removed from Hermes profile; kept in TotalReclaw, with no entry text. The snapshot moves on. In the reconcile, removed entries cost no vault operation.replace / patch, and reconcile "changed" pairs → always store the new text. The old fact is forgotten only when two things hold:
_same_fact). "prefers tea" → "prefers green tea" is 0.85; a merge like "likes tea" → "likes tea and coffee" is 0.73;Merges and rewrites keep the old facts. When an edit keeps the old fact, the mirror log line ends in
; old entry kept (not the same fact).Explicit forgetting goes through TotalReclaw's own tool. New system-prompt sentence: "To forget something, call
totalreclaw_forgetand also remove it from the built-in memory if it's there." The block is 565 characters.Pinned facts: not checked. Telling cheaply isn't possible today:
pin_statusis a top-level v1 blob key thatread_blob_unifiedand the recall-candidate passthrough drop. Exposing it touches shared read paths that open feat(core,python): pin-aware resolution + recall pin boost (PRD-04 DEP-5, Part A) #671 (pin-aware resolution) also changes. With this PR, a pinned fact can only be forgotten through a same-fact edit with a confident match.Docs and tests: the guide's Compatibility and Diagnostics sections (including the log-line formats), SKILL.md (removal doesn't forget; "forget X" also removes the entry from the built-in memory), the changelog (Unreleased entries rewritten in place), and tests:
totalreclaw_forget;_find_mirrored_factsdirectly.Trade-off
When an edit changes a fact too much to count as the same fact (e.g. "prefers coffee" → "prefers green tea", "works at Acme" → "works at Initech"), the old fact is kept alongside the new one. That's deliberate: no data loss in the durable store wins over a possibly stale duplicate.
Verification
pytest tests/(CI flags): 2706 passed.MemoryManager/memory_tool/MemoryStorechecks:Review-fork limitation (unchanged)
Hermes 0.22.5 builds its background memory review with
skip_memory=True, so those writes only reach TotalReclaw through the session-boundary reconcile (#692).🤖 Generated with Claude Code