Hermes plugin re-retains the injected <memory-context> block, echoing bank content across isolated banks
Nobody has claimed this yet.
Assessment
This issue has not been assessed yet.
Description
Bug Description
The Hermes Agent memory plugin (hindsight-integrations/hermes/) re-retains the recalled-memory block that Hermes injects into a turn, so the bank's own recalled prose silently archives itself back into the bank as if the conversation had said it.
Hermes fences the injected recall between <memory-context> tags in the turn text. The plugin ships that turn text to retain unmodified through two paths:
sync_turn— on list-content turns the fenced block is a durable part of the user message (and a reply can quote it verbatim), so the retained user content carries the whole block;- the pre-compression checkpoint (
on_pre_compress) — it serialises whole message dicts, and user rows carry the exact injected bytes on theapi_contentsidecar (and inside multimodal text parts).
Consequence for anyone running multiple isolated banks (one per agent profile / persona / user): a fact recalled from bank A into a chat whose turns are retained re-appears in that seat's own bank without any conversation ever mentioning it, and consolidation then duplicates those rows across banks. We observed byte-identical retained rows shared between banks that were deliberately isolated from each other — 32 identical-text groups across eight profiles before we caught it. The retain call count is unaffected; only the content is polluted. This is a leak channel in the integration, not in the daemon.
Steps to Reproduce
- Two Hermes profiles on separate banks (say
bankAandbankB), plugin 2.0.0, daemon 1.3.1. - Explicitly retain a unique marker sentence into
bankA(e.g. via theretaintool). - Open a chat in profile B and ask something that makes B's recall surface
bankAcontent into the turn's injected memory-context block (shared upstream bank, or simply recall bait configured to reach it). - Wait for the turn's automatic retain, then query
bankB's documents/memories for the marker text. - A row containing the marker appears in
bankBinside a user-role message wrapped in<memory-context>tags — nothing in the conversation typed it.
Expected Behavior
Automatic turn retains should contain only what the conversation itself said. Text the harness injected as recalled context should never re-enter the bank automatically (explicit user-invoked retain of that text should still work).
Actual Behavior
The injected block is retained verbatim, echoing bank content back into the bank and, via consolidation, across banks.
Root cause
sync_turn(user_content, assistant_content) and the checkpoint payload both receive the raw turn text, which includes the fenced block. The fix is to strip complete fenced spans (and the tail of an unterminated opening tag, mirroring the harness's own scrubber) before submission. We have a working patch: block-shaped-only matching (tag at line start) so prose mentioning the fence is kept, an inline variant for tool-call preview lines, a skip rule for turns whose text was only the injected block, and a non-mutating copy for the checkpoint. 8 unit tests plus a paired old-vs-new in-process proof (old ships marker+fence, new ships only real content, same retain count) and a live canary run on a local daemon.
Patch and tests: monerostar/hindsight PR #1 (fix/retain-strip-injected-memory-context branch on my fork, based on current main): https://github.com/monerostar/hindsight/pull/1
I know external PRs are closed without review per CONTRIBUTING, so filing here with the diagnosis and a ready diff so the team can apply it however fits.
Version
Plugin: Hermes Agent catalog hindsight 2.0.0 (commit 0aca9f80). Daemon: 1.3.1 (also seen on 1.2.x — the bug is client-side). Hermes Agent v0.23.5 on Windows.
LLM Provider
N/A — the defect is in the retain payload construction, provider-independent. Reproduced with a local daemon on the default embed LLM config.
- Dominant language
- Python
- Stars
- 45.2k
- Forks
- 5.9k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vectorize-io/hindsight
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vectorize-io/hindsight#7254 ·
-
Control Plane shows different calendar dates for the same occurrence in Constellation and TimelineOpencore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
vectorize-io/hindsight#7240 · 1 comment ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vectorize-io/hindsight#7233 ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
vectorize-io/hindsight#7231 ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
vectorize-io/hindsight#7228 · 1 comment ·
All issues in vectorize-io/hindsight
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day
-
polish
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPossibly taken @AshutoshSingh840 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainers usually reply within 1 day