Repository navigation
fix(agent-plugins): match memo prompts and tool descriptions, release 0.3.3 - #7420
Merged
Merged
Conversation
The shared search tool description, project-memory extraction instructions, sidekick prompt, and search skill wording had drifted from memo (the reference implementation these plugins were built from) with extra "ALWAYS call" imperatives and a failed-command paragraph that were never part of the original wording. Restore memo's text verbatim, keeping only the branding, multi-host, and scope/run_id adaptations the shared core still needs.
…o 0.3.3 Drops the extra personal-preferences sentence so the repository extraction prompt matches memo apart from host-neutral wording, bumps every Python agent plugin to 0.3.3, and records each plugin's changes in the SDK changelog.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
OpenCode, OpenClaw, Pi, and DeepSeek Harness keep their own prompts, so the memo sync in the shared Python core did not reach them. Their search tool descriptions, system prompts, and context-loader skills told the agent to search proactively and to run several or parallel searches per question. Replace that wording with memo's search guidance, make the search and context-loader skills issue one search, bump each package by a patch version, and record the changes in each plugin's changelog tab. Remove the portable plugin changelog entry; the changes are listed per plugin.
…ared core Move memo's search tool description, query description, and recall heading into agent-plugin-core/typescript/src/prompts.ts so OpenCode, OpenClaw, Pi, and DeepSeek read them from one place, as the Python plugins do. Replace the shared recall header that called injected memories a shallow first pass and told the agent to search mem0_memory again. Add a test that fails if the TypeScript prompts drift from the Python core. Co-Authored-By: Claude <noreply@anthropic.com>
…t plugin OpenCode, Pi, DeepSeek, and OpenClaw now translate host events into the shared agent-plugin-core lifecycle instead of their own recall and capture rules: first-prompt recall (top 5, rerank off, latest only) and checkpointed capture at 5 exchanges, 10 messages, or 40,000 chars, after 5 idle minutes, before compaction, and at session end. OpenCode and Pi write the Claude Code repository body; DeepSeek and OpenClaw stay user-scoped. Releases OpenCode 0.5.0, Pi 0.4.0, DeepSeek 0.4.0, and OpenClaw 1.3.0, and corrects the OpenClaw docs: autoRecall and autoCapture are not registered in skills mode. Co-Authored-By: Claude <noreply@anthropic.com>
This reverts commit aa314f3. The lifecycle change moves to its own pull request; this one stays scoped to the memo prompt sync. Co-Authored-By: Claude <noreply@anthropic.com>
karthik-indla
approved these changes
Sep 23, 2026
karthik-indla
left a comment
Contributor
There was a problem hiding this comment.
Reviewed in detail — clean, internally consistent, and well-guarded. Approving.
The change is self-enforcing, which is what makes a 56-file prompt-alignment + release safe to land:
- Zero generated-copy drift — both changed core files (
mcp_server.py,memory_core.py) are sha256-identical across all six bundles (claude-code, codex, cursor, kimi, antigravity, mem0-agent) vs theagent-plugin-coresource. - Cross-SDK parity is genuinely enforced —
prompts.test.tsreads the Python source and asserts it.includes()the TS strings (SEARCH_TOOL_DESCRIPTION/SEARCH_QUERY_DESCRIPTION/RECALL_HEADING), so it fails if either half drifts. Non-vacuous. - Single-source wiring is correct —
prompts.tsholds both repo-scoped andUSER_*variants; all four TS plugins import from it, with repo-scoped plugins (OpenCode, Pi) using the repo variants and user-scoped ones (DeepSeek, OpenClaw) usingUSER_*. - The change actually happened — the Python
TOOL_DESCRIPTIONnow reads "Search memories from earlier work in this repository. Use it before…"; the imperative "ALWAYS callsearch_memories" is gone everywhere. - Version bumps are consistent — every version-carrying file is at
0.3.3(PLUGIN_VERSION, all plugin/plugin-build manifests, mem0-agent-plugin, the four marketplace files that carry a version) with correct TS bumps (OpenCode 0.4.1, OpenClaw 1.2.1, Pi/DeepSeek 0.3.2). The version-less files (antigravityplugin.json,.codex-plugin/.agents/pluginsmarketplaces) legitimately carry no version field, so no stragglers were left at 0.3.2. - Changelog — separate
v0.3.3(and TS) entries for each plugin tab, all linking this PR.
Two non-blocking notes:
- Fidelity to
memoitself I can't independently confirm — the "verbatim from memo" claim rests on the documentedast-based string-extraction audit against the external repo, which I can't diff here. What is verifiable — internal consistency (Python == TS == generated copies) and the drift/parity tests guarding it — all holds. - This is an intentional prompt-behavior change: agents will search memory less often, and the extraction prompt drops "Do not save personal preferences" plus the search skill's category-retry clause. That's the intent (aligning with canonical
memo) and each removal is itemized in the audit table — just worth a conscious "search less / these removals are desired" sign-off.
(Static review — verified against the PR-branch source via the contents API; relied on the stated conformance/pytest/TS runs for execution.)
This branch was successfully deployed
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.
Linked Issue
No linked issue. This branch is pushed to this repository (not a fork), so the PR Gate's accepted-issue check does not apply. I can open an issue if a maintainer wants one.
Description
The prompts and tool descriptions in the shared
agent-plugin-coreno longer matchedmem0ai/memo. The main difference was an imperative "ALWAYS callsearch_memories" instruction in the MCP tool description and in the Sidekick prompt. That instruction makes the agent search memory far more often than it needs to. This PR copies memo's prompt text into both halves of the shared core (python/andtypescript/), releases every Python agent plugin as0.3.3, and patch-bumps the four TypeScript plugins.Line-by-line audit
Every string literal in memo's
memory_core.py,mcp_server.py,hook.py,memory_cli.py, andflush_worker.pywas extracted withast. Each one was searched for verbatim, after changing Memo branding to Mem0, in the shared core and the Claude adapters. Markdown and JSON files were diffed directly.mcp_server.pyTOOL_DESCRIPTIONagent-plugin-core/python/mcp_server.pymcp_server.pyquery,top_k,categorydescriptionsmemory_core.pyCODING_EXTRACTION_INSTRUCTIONSPROJECT_MEMORY_INSTRUCTIONSmemory_core.pyCODING_MEMORY_CATEGORIESmemory_core.pysearch result formattinghook.pyfirst-prompt search (heading,top_k=5,timeout=2, 20-char minimum)hook_runner.pyhooks/hooks.jsoneventsclaude-code-plugin/hooks/hooks.jsonagents/sidekick.mdclaude-code-plugin/agents/sidekick.mdskills/search/SKILL.mdfrontmatteragent-plugin-core/skills/search/SKILL.md.tmpl{{HARNESS_NAME}}renders as "Claude Code").claude-plugin/plugin.jsonuserConfigclaude-code-plugin/.claude-plugin/plugin.jsonThe memo strings that still have no match are docstrings, SQL, and CLI status lines for humans. None of them are sent to the model.
Before and after
mcp_server.pyTOOL_DESCRIPTIONBefore:
After (verbatim from memo):
claude-code-plugin/agents/sidekick.mdBefore:
After (verbatim from memo):
memory_core.pyPROJECT_MEMORY_INSTRUCTIONS: now matches memo'sCODING_EXTRACTION_INSTRUCTIONS. Instructions that memo does not have were removed, including "Do not save personal preferences."skills/search/SKILL.md.tmpl: removed a clause that memo does not have. It called the category "a best-effort label" and told the agent to repeat the search without the category.Remaining differences from memo
mcp__plugin_mem0_mem0__instead ofmcp__plugin_memo_memo__.test_mcp_tool_contract_is_small_and_read_onlyenforces this.scopeandrun_idsearch parameters (schema descriptions and/searchflag docs)PERSONAL_MEMORY_INSTRUCTIONSremember,forget,pause,resume, andstatusskills. The model cannot invoke any of these exceptstatus, andstatusdoes not search.Release
0.3.2to0.3.3:PLUGIN_VERSION, eachplugin-build.json, each host manifest,mem0-agent-plugin/plugin.json, and the four marketplace files.v0.3.3entry to each native plugin's tab indocs/changelog/sdk.mdx: Claude Code, Cursor, Codex, Antigravity, and Kimi. The portable bundle gets the same generated core but no separate changelog entry.core/andskills/for all six bundles withbuild.py --sync, then confirmed they are in sync with--check.TypeScript plugins
OpenCode, OpenClaw, Pi, and DeepSeek Harness build on
agent-plugin-core/typescript, the TypeScript half of the shared core. Before this PR, the only prompt text in that core was the automatic-recall header, and it called injected memories "a shallow first pass" and told the agent to searchmem0_memoryagain. Every other search prompt lived inside each plugin and told the agent to search proactively and to run several or parallel searches per question.This PR adds
agent-plugin-core/typescript/src/prompts.tswith memo's tool description, query description, and recall heading. All four plugins import from it, so memo's search sentence now exists once in each core.tests/prompts.test.tsfails if the TypeScript strings drift frompython/mcp_server.pyorpython/hook_runner.py.search_memoriesdescription andquerynow use memo's wording. Removed the system-context lines "Run 2 parallel searches" and "2-4 parallel calls"./mem0-searchand/mem0-context-loadermake one search, and context-loader uses memo's search skill description0.4.0to0.4.1MEMORY_POLICY,mem0_memorydescription, prompt guidelines,action, andquerynow use memo's wording.context-loadermakes one search and uses memo's search skill description0.3.1to0.3.2search_memorydescription andquerynow use memo's wording0.3.1to0.3.2memory_searchdescription andquerynow use memo's wording. Recall strategies are unchanged1.2.0to1.2.1Pi and DeepSeek automatic recall now uses memo's heading from the shared core instead of the "shallow first pass" header.
DeepSeek and OpenClaw memory is scoped to the user, not the repository, so they use the core's
USER_*variants, which omit memo's "in this repository". Each plugin has its own changelog entry.Type of Change
AI Assistance
Tool: Claude Code. Every changed string was checked against memo's source by automated string extraction. The full plugin test and conformance suites were rerun.
Breaking Changes
N/A
Test Coverage
Two assertions in
claude-code-plugin/tests/test_memory_core.pychecked the removed wording and were updated:test_sidekick_instructions_reject_unrequested_related_changesnow checks memo's Sidekick sentence.test_flush_sends_unified_body_with_both_agent_and_user_idnow checks memo's "Write about the repository, not the user" sentence.The pre-commit isort hook also reordered one import in that file.
Verification, run in a venv built from
agent-plugin-core/requirements-dev.txt:conformance/run.py --install: 30 checks passedpytest: 319 passed, 8 skippedbuild.py --checkfor all six bundles: in syncruff checkon changed Python files: passedtsc --noEmitpassedtsc --noEmitand builds pass for all four, and each bundle contains the core stringsChecklist
🤖 Generated with Claude Code