Commit Graph
4 Commits
Author SHA1 Message Date
MgeeeekandClaude Opus 4.7 1dcf842635 fix(plugin): correct v2 filter syntax in mem0-mcp rubric
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>
2026-05-06 19:13:10 +05:30
gabrielstein-mem0 19c1956630 refactor(plugin): hand mem0 search decisions to the agent
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
2026-04-27 13:58:34 -07:00
Gabriel SteinandGitHub 30ce028a71 feat(mem0-plugin): add Codex lifecycle hooks via opt-in installer (#4917) 2026-04-27 22:59:35 +05:30
Gabriel SteinandGitHub 3c2683c1b5 feat: add Mem0 plugin for Claude Code and Cursor (#4518) 2026-03-25 14:45:59 -07:00