This PR only touches mem0-plugin/, which is outside the path filters
in .github/workflows/ci.yml — but branch protection requires
build_mem0 and build_embedchain status checks to merge. Add a
clarifying comment in pyproject.toml so the workflow triggers
once and posts the required statuses.
Follow-up: branch protection should be reconfigured so plugin-only
PRs don't need this nudge.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The rubric introduced in this PR taught the agent to use
`{"metadata.type": "decision"}` filters, but the v2 search
contract (docs/platform/features/v2-memory-filters.mdx) requires:
1. The root must be a logical operator (`AND`/`OR`/`NOT`) with an array.
A bare `{"user_id": "..."}` is rejected.
2. Metadata uses a nested object — `{"metadata": {"type": "..."}}` —
not a dotted key. Only top-level metadata keys are filterable.
Without this fix, agents following the rubric produce filter calls
the platform either ignores or rejects.
Also replaces the literal `"alice"` in the worked example with a
clearly-marked `<your_user_id>` placeholder so agents don't copy
verbatim, and adds a one-line "substitute the active user_id"
instruction.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The skill content is runtime-agnostic — same protocol applies to Claude
Code, Cursor, and Codex. The "codex" name was a vestige from when Codex
was the only runtime delivering this guidance via skill (because Codex
didn't have hooks yet). Now all three runtimes run the same hook plus
load the same skill, so name it after the surface it actually documents:
the mem0 MCP tool protocol.
The plain-string source ("./mem0-plugin") parsed as a marketplace
without errors but caused /plugin install to fail with "Plugin 'mem0'
not found in any marketplace". Claude Code and Cursor require the
object form: {"source": "directory", "path": "..."}. Codex already
uses the object form (with "source": "local") in .agents/plugins.
The on_user_prompt hook previously ran a blind semantic search using the
raw user prompt as the query and injected the top results unconditionally.
That undermined the agent's judgment with low-quality context and made
heavy API calls on prompts where memory wouldn't help.
Replace with a decision rubric injected into context per turn. The agent
decides whether memory would improve the response and, if so, runs targeted
searches with metadata.type filters and proper query phrasing. Mirror the
same rules in mem0-codex/SKILL.md so the skill (loaded once) and the hook
(re-asserted per turn) agree.
Skip gates preserved: prompts under 20 chars and missing MEM0_API_KEY.
- on_user_prompt.sh: API call replaced with stdout rubric injection
- hooks.json / codex-hooks.json: statusMessage updated to match new behavior
- mem0-codex/SKILL.md: "On every new task" rewritten with search/skip rules,
query phrasing guidance, metadata filter table, and a worked example