Skip to content

feat(memory): strengthen default toolset instructions#3395

Merged
dgageot merged 1 commit into
mainfrom
improve-memory-instructions
Jul 1, 2026
Merged

feat(memory): strengthen default toolset instructions#3395
dgageot merged 1 commit into
mainfrom
improve-memory-instructions

Conversation

@dgageot

@dgageot dgageot commented Jul 1, 2026

Copy link
Copy Markdown
Member

The default Instructions() in the memory toolset were written at a fairly high level of abstraction, making it easy for agents to leak tool usage into their replies or to skip recall when it would help. This PR ports the memory-handling lessons that were refined in the assistant/gordon.yaml doctrine and validated by the assistant/evals/memory-*.json eval suite into the shared toolset defaults, so every agent that uses the memory toolset benefits.

The changes tighten four areas. First, the silence rule now lists the specific phrases to avoid ("I'll remember that", "stored", "saved", "noted", "I searched my memory") rather than a vague directive, which makes it actionable for an LLM rather than interpretable. Second, a RECALL-first rule instructs agents to call search_memories before answering context-dependent or personal questions (e.g. "what's my name?"), with an explicit carve-out for greetings and self-contained informational questions so the tool is not overused. Third, a proactive STORE scan asks agents to check each user message for durable facts — including ones mentioned in passing — and to treat corrections as preferences rather than one-off overrides. Fourth, a secret-hygiene rule prevents storing secrets, tokens, or transient debugging details.

Two categories ("environment" and "correction") were added to the suggested taxonomy to match the new behavioral rules. Gordon-specific persona rules (banned words, response styles, empty-prose mechanics) were deliberately excluded; those remain in gordon.yaml where they belong.

go test ./pkg/tools/builtin/memory/... passes with the updated TestMemoryTool_Instructions assertions, and gofmt/go vet are clean.

Silence rule now names specific leaking phrases, adds a RECALL-first
rule for context-dependent questions, a proactive STORE scan with
secret hygiene, and two new categories (environment, correction).

Assisted-By: Claude
@dgageot dgageot requested a review from a team as a code owner July 1, 2026 22:23
@aheritier aheritier added area/tools For features/issues/fixes related to the usage of built-in and MCP tools kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Jul 1, 2026
@dgageot dgageot merged commit 72655ce into main Jul 1, 2026
13 checks passed
@dgageot dgageot deleted the improve-memory-instructions branch July 1, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tools For features/issues/fixes related to the usage of built-in and MCP tools kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants