Skip to content

fix(agent-plugins): match memo prompts and tool descriptions, release 0.3.3 - #7420

Merged
blazingretinol merged 6 commits into
mainfrom
fix/agent-plugin-prompts-from-memo
Sep 23, 2026
Merged

blazingretinol merged 6 commits into
mainfrom
fix/agent-plugin-prompts-from-memo

Conversation

@blazingretinol

@blazingretinol blazingretinol commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

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-core no longer matched mem0ai/memo. The main difference was an imperative "ALWAYS call search_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/ and typescript/), releases every Python agent plugin as 0.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, and flush_worker.py was extracted with ast. 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.

Memo source This repo Result
mcp_server.py TOOL_DESCRIPTION agent-plugin-core/python/mcp_server.py Identical
mcp_server.py query, top_k, category descriptions same Identical (branding only)
memory_core.py CODING_EXTRACTION_INSTRUCTIONS PROJECT_MEMORY_INSTRUCTIONS Identical, except that "Claude's" and "Claude" read "the coding agent's" and "the coding agent" (2 places)
memory_core.py CODING_MEMORY_CATEGORIES same Identical
memory_core.py search result formatting same Identical
hook.py first-prompt search (heading, top_k=5, timeout=2, 20-char minimum) hook_runner.py Identical (branding only)
hooks/hooks.json events claude-code-plugin/hooks/hooks.json Same 9 events (branding only)
agents/sidekick.md claude-code-plugin/agents/sidekick.md Identical (branding and tool name only)
skills/search/SKILL.md frontmatter agent-plugin-core/skills/search/SKILL.md.tmpl Identical ({{HARNESS_NAME}} renders as "Claude Code")
.claude-plugin/plugin.json userConfig claude-code-plugin/.claude-plugin/plugin.json Identical (branding only)

The 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.py TOOL_DESCRIPTION

Before:

Search memories from earlier work in this repository. ALWAYS call this tool before answering anything that could depend on prior context: the user's preferences, facts about this codebase, history, people, projects, or earlier decisions. Do not rely on the chat window alone. [...]

After (verbatim from memo):

Search memories from earlier work in this repository. Use it before repeating investigation or when earlier decisions, fixes, commands, or results may help.

claude-code-plugin/agents/sidekick.md

Before:

ALWAYS call search_memories before answering anything that could depend on prior context (the user's preferences, facts about this codebase, history, people, projects, or earlier decisions). Do not rely on the chat window or assume you know enough from the current conversation. [...]

After (verbatim from memo):

When memories from earlier sessions could help, call search_memories with a focused question before searching the repository again.

memory_core.py PROJECT_MEMORY_INSTRUCTIONS: now matches memo's CODING_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

  1. Branding: Mem0 instead of Memo, and mcp__plugin_mem0_mem0__ instead of mcp__plugin_memo_memo__.
  2. Host-neutral extraction wording: the shared extraction prompt runs for Claude Code, Cursor, Codex, Kimi, and Antigravity, so "Claude" reads "the coding agent". test_mcp_tool_contract_is_small_and_read_only enforces this.
  3. Features memo does not have:
    • the scope and run_id search parameters (schema descriptions and /search flag docs)
    • PERSONAL_MEMORY_INSTRUCTIONS
    • the remember, forget, pause, resume, and status skills. The model cannot invoke any of these except status, and status does not search.

Release

  • Bumped every Python agent plugin from 0.3.2 to 0.3.3: PLUGIN_VERSION, each plugin-build.json, each host manifest, mem0-agent-plugin/plugin.json, and the four marketplace files.
  • Added a separate v0.3.3 entry to each native plugin's tab in docs/changelog/sdk.mdx: Claude Code, Cursor, Codex, Antigravity, and Kimi. The portable bundle gets the same generated core but no separate changelog entry.
  • Regenerated core/ and skills/ for all six bundles with build.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 search mem0_memory again. 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.ts with 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.ts fails if the TypeScript strings drift from python/mcp_server.py or python/hook_runner.py.

Plugin Change Version
OpenCode search_memories description and query now use memo's wording. Removed the system-context lines "Run 2 parallel searches" and "2-4 parallel calls". /mem0-search and /mem0-context-loader make one search, and context-loader uses memo's search skill description 0.4.0 to 0.4.1
Pi Agent MEMORY_POLICY, mem0_memory description, prompt guidelines, action, and query now use memo's wording. context-loader makes one search and uses memo's search skill description 0.3.1 to 0.3.2
DeepSeek Harness search_memory description and query now use memo's wording 0.3.1 to 0.3.2
OpenClaw memory_search description and query now use memo's wording. Recall strategies are unchanged 1.2.0 to 1.2.1

Pi 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

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactor (no functional changes)
  • Documentation update

AI Assistance

  • No AI assistance
  • AI-assisted (autocomplete, or I asked a model questions while writing this)
  • AI-generated (an agent wrote most or all of this diff)

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.

  • I can explain every line of this diff and how it interacts with the rest of the codebase, without asking an AI tool.

Breaking Changes

N/A

Test Coverage

  • I added/updated unit tests
  • I added/updated integration tests
  • I tested manually (describe below)
  • No tests needed (explain why)

Two assertions in claude-code-plugin/tests/test_memory_core.py checked the removed wording and were updated:

  • test_sidekick_instructions_reject_unrequested_related_changes now checks memo's Sidekick sentence.
  • test_flush_sends_unified_body_with_both_agent_and_user_id now 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 passed
  • pytest: 319 passed, 8 skipped
    • agent-plugin-core: 81 passed
    • claude-code-plugin: 214 passed, 8 skipped
    • cursor-plugin: 11 passed
    • codex-plugin: 5 passed
    • kimi-plugin: 2 passed
    • antigravity-plugin: 6 passed
  • build.py --check for all six bundles: in sync
  • ruff check on changed Python files: passed
  • TypeScript core: 39 passed (node:test), tsc --noEmit passed
  • TypeScript plugins: OpenCode 35 passed (bun test), OpenClaw 435 passed, Pi 96 passed, DeepSeek 47 passed (vitest). tsc --noEmit and builds pass for all four, and each bundle contains the core strings
  • pre-commit (ruff, isort): passed

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation if needed

🤖 Generated with Claude Code

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.
@github-actions github-actions Bot added integrations Agent and editor integrations plugin Editor and agent plugins (Claude Code, Cursor, Codex, OpenClaw, Pi Agent) labels Sep 23, 2026
…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.
@mintlify

mintlify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
mem0 🟢 Ready View Preview Sep 23, 2026, 1:12 PM

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 23, 2026
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>
@blazingretinol blazingretinol changed the title fix(agent-plugins): sync prompts and tool descriptions from memo fix(agent-plugins): match memo prompts and tool descriptions, release 0.3.3 Sep 23, 2026
…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 karthik-indla left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 the agent-plugin-core source.
  • Cross-SDK parity is genuinely enforced — prompts.test.ts reads 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.ts holds both repo-scoped and USER_* variants; all four TS plugins import from it, with repo-scoped plugins (OpenCode, Pi) using the repo variants and user-scoped ones (DeepSeek, OpenClaw) using USER_*.
  • The change actually happened — the Python TOOL_DESCRIPTION now reads "Search memories from earlier work in this repository. Use it before…"; the imperative "ALWAYS call search_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 (antigravity plugin.json, .codex-plugin/.agents/plugins marketplaces) 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 memo itself I can't independently confirm — the "verbatim from memo" claim rests on the documented ast-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.)

@blazingretinol
blazingretinol merged commit 8c02c42 into main Sep 23, 2026
33 checks passed
@blazingretinol
blazingretinol deleted the fix/agent-plugin-prompts-from-memo branch September 23, 2026 14:05

This branch was successfully deployed

1 active deployment
staging - docs — 834d330e Deployed Sep 23, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation integrations Agent and editor integrations plugin Editor and agent plugins (Claude Code, Cursor, Codex, OpenClaw, Pi Agent)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants