fix(memory): reject one-off/topic content in update_memory tool prompt - #8
Merged
Merged
Conversation
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>
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.
What
Adds contrastive negative examples to the
update_memorytool 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.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_EXAMPLESin the web app (lib/services/memory/memory-policy.ts). Thehermesparent PR bumps the submodule pointer to this commit and adds the durability gate + force-save regex fix.🤖 Generated with Claude Code