Skip to content

docs: move memory extension reference to documentation, trim runtime prompt#7727

Merged
alexhancock merged 1 commit intoaaif-goose:mainfrom
jeffa-block:chore/trim-memory-instructions
Mar 26, 2026
Merged

docs: move memory extension reference to documentation, trim runtime prompt#7727
alexhancock merged 1 commit intoaaif-goose:mainfrom
jeffa-block:chore/trim-memory-instructions

Conversation

@jeffa-block
Copy link
Copy Markdown
Contributor

Summary

Trims the memory extension instruction block from ~800 words to ~60 words.
Example dialogues, keyword trigger lists, and interaction protocols are moved
to the docs page (memory-mcp.md) where they're more discoverable and don't
consume context window on every turn.

The docs page already had most of this content — this PR fills the gaps
(storage paths, tool reference table, wildcard usage) and removes the
duplication from the system prompt.

Continues the direction set by #6991.

Type of Change

  • Refactor / Code quality
  • Documentation

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

  • cargo check -p goose-mcp passes
  • cargo test -p goose-mcp memory — 5 tests pass
  • No functional change to tools — only the instruction text is trimmed

Related Issues

Relates to #5703, #6883

Reduces the memory extension instruction block from ~800 words to ~60 words.
Example dialogues, keyword trigger lists, and interaction protocols are moved
to the documentation page (memory-mcp.md) where they're more useful and don't
consume context window on every turn.

Follows the same direction as aaif-goose#6991 (system prompt reduction).
@jeffa-block jeffa-block changed the title chore: trim memory extension instructions, move details to docs docs: move memory extension reference to documentation, trim runtime prompt Mar 22, 2026
@jeffa-block
Copy link
Copy Markdown
Contributor Author

Hey @DOsinga — this continues the direction from #6991: trims the memory extension's runtime prompt from ~800 words to ~60, moves the detail to documentation/docs/mcp/memory-mcp.md where it's actually useful for developers. Net -69 lines from runtime context. Two files, no behaviour change.

@jeffa-block
Copy link
Copy Markdown
Contributor Author

For context — I audited all goose MCP extension system prompts. Memory is the second most verbose at ~786 words runtime. Here's the full picture:

Extension Runtime words Notes
ComputerController (macOS) ~963 Peekaboo CLI man page in every session
Memory ~786 ← this PR, trimmed to ~60
Code Execution ~185
Developer ~184 Already lean
AutoVisualiser ~178
Ext Manager ~143 Already lean
Tutorial ~132 Already lean

Happy to follow up with a ComputerController trim (~963 → ~80 words) once this one lands. Same pattern: move reference to docs, keep runtime prompt minimal.

@jeffa-block
Copy link
Copy Markdown
Contributor Author

Gentle bump — this is still clean against main (no conflicts, all CI green). Happy to rebase if needed. The runtime prompt savings compound across sessions since the ~700 trimmed words load on every tool call.

Copy link
Copy Markdown
Collaborator

@alexhancock alexhancock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally favor simpler instructions and this looks like one in that area.

Have you done manual testing of the extension with a few models and it's working comparably or better to before?

@jeffa-block
Copy link
Copy Markdown
Contributor Author

Manual testing results

Tested the trimmed prompt against 3 models via Databricks gateway, using goose session --no-profile --with-builtin memory for clean isolation.

3 scenarios tested:

  1. Explicit save — "Remember that I prefer dark mode"
  2. Proactive save — "For this project we use ruff for linting, pytest for tests, and pre-commit hooks are required" (no save keyword)
  3. Retrieve — "What do you remember about my preferences?"
# Scenario Model Branch Result
1 Explicit save Claude 4.6 Opus PR ✅ Called remember_memory with good category/tags
2 Proactive save Claude 4.6 Opus PR ✅ Proactively saved project conventions
3 Retrieve memories Claude 4.6 Opus PR ✅ Called retrieve_memories with * wildcard
4 Proactive save GPT-5-2 PR ✅ Proactively saved (went straight to tool call)
5 Proactive save Claude 4.5 Sonnet PR ⚠️ Acknowledged but did not offer to save
6 Explicit save Claude 4.5 Sonnet PR ✅ Called remember_memory correctly
Baseline Proactive save Claude 4.5 Sonnet main ⚠️ Same behaviour — acknowledged but did not offer to save

Key finding: Claude 4.5 Sonnet's proactive save behaviour is identical on both branches — the verbose 100-line prompt with keyword lists and example dialogues didn't help Sonnet proactively save either. The trimmed prompt is not a regression. Opus and GPT-5-2 both proactively save correctly with the shorter instructions.

@alexhancock alexhancock enabled auto-merge March 24, 2026 13:35
@alexhancock alexhancock added this pull request to the merge queue Mar 26, 2026
Merged via the queue into aaif-goose:main with commit 09a99bb Mar 26, 2026
21 checks passed
hydrosquall pushed a commit to hydrosquall/goose that referenced this pull request Mar 31, 2026
…prompt (aaif-goose#7727)

Signed-off-by: Cameron Yick <cameron.yick@datadoghq.com>
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.

3 participants