From db60c982765c5be5838de45c35851bcb1d27bc83 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sun, 19 Apr 2026 12:00:53 -0700 Subject: [PATCH] docs(memory): steer agents to save declarative facts, not instructions (#12665) Imperative memory entries ('Always respond concisely', 'Run tests with pytest -n 4') get re-read as directives in future sessions, causing repeated work or overriding the user's current request. Add a short phrasing guideline to MEMORY_GUIDANCE so the model writes declarative facts instead ('User prefers concise responses', 'Project uses pytest with xdist'). Credit: observation from @Mariandipietra on X. --- agent/prompt_builder.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/agent/prompt_builder.py b/agent/prompt_builder.py index ee8ab868..2a210434 100644 --- a/agent/prompt_builder.py +++ b/agent/prompt_builder.py @@ -152,7 +152,13 @@ MEMORY_GUIDANCE = ( "Do NOT save task progress, session outcomes, completed-work logs, or temporary TODO " "state to memory; use session_search to recall those from past transcripts. " "If you've discovered a new way to do something, solved a problem that could be " - "necessary later, save it as a skill with the skill tool." + "necessary later, save it as a skill with the skill tool.\n" + "Write memories as declarative facts, not instructions to yourself. " + "'User prefers concise responses' ✓ — 'Always respond concisely' ✗. " + "'Project uses pytest with xdist' ✓ — 'Run tests with pytest -n 4' ✗. " + "Imperative phrasing gets re-read as a directive in later sessions and can " + "cause repeated work or override the user's current request. Procedures and " + "workflows belong in skills, not memory." ) SESSION_SEARCH_GUIDANCE = (