Skip to content

fix(memory): reject one-off/topic content in update_memory tool prompt - #8

Merged
GurneeshBudhiraja merged 1 commit into
mainfrom
dev/aman/memory-oversaving-fix
Jul 15, 2026
Merged

fix(memory): reject one-off/topic content in update_memory tool prompt#8
GurneeshBudhiraja merged 1 commit into
mainfrom
dev/aman/memory-oversaving-fix

Conversation

@aman-a-shah

Copy link
Copy Markdown

What

Adds contrastive negative examples to the update_memory tool description (tools/user_notes_tool.py) so the agent's primary memory save path stops persisting the current task's topic as if it were a durable preference.

  • A question, or a one-off task command (even phrased as "add/include/show") → save NOTHING
  • A standing preference, business definition/metric, hard constraint, or explicit correction → SAVE

Why

Reported: "most of the time the AI memory adds general instructions / what the user asked about, not preferences." Root cause is structural — the prompts stated the bar abstractly but had no contrastive negative examples, so a weak model manufactures preference-shaped bullets out of the current topic.

Related

Mirror of MEMORY_CONTRASTIVE_EXAMPLES in the web app (lib/services/memory/memory-policy.ts). The hermes parent PR bumps the submodule pointer to this commit and adds the durability gate + force-save regex fix.

🤖 Generated with Claude Code

Add contrastive negative examples to the update_memory tool description so
the agent's primary save path stops persisting the current task's topic as if
it were a durable preference: a question or a one-off task command (even
phrased as "add/include/show") -> save NOTHING; a standing preference,
business definition/metric, hard constraint, or correction -> SAVE.

Mirrors MEMORY_CONTRASTIVE_EXAMPLES in the web app
(lib/services/memory/memory-policy.ts).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@GurneeshBudhiraja
GurneeshBudhiraja merged commit 881c437 into main Jul 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants