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>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
875eedfbac
commit
1dcf842635
@@ -51,12 +51,14 @@ improve your answer. The agent -- not this hook -- owns this decision.
|
||||
- Run **2-4 parallel** \`search_memories\` calls with different angles, not one
|
||||
query that echoes the user's prompt.
|
||||
- Phrase queries as **nouns** ("auth module decisions"), not full sentences.
|
||||
- Use \`metadata.type\` filters where they fit:
|
||||
- \`{"metadata.type": "decision"}\` -- design / architecture questions
|
||||
- \`{"metadata.type": "anti_pattern"}\` -- debugging, error handling
|
||||
- \`{"metadata.type": "user_preference"}\` -- tooling, stack, style
|
||||
- \`{"metadata.type": "convention"}\` -- established patterns in this project
|
||||
- Scope every query with \`{"user_id": "$USER_ID"}\`.
|
||||
- Filter shape: the root must be a logical operator (\`AND\` / \`OR\` / \`NOT\`)
|
||||
with an array, and metadata uses a **nested** object (not dotted keys).
|
||||
Combine \`user_id\` with one \`metadata.type\` clause per call:
|
||||
- \`{"AND": [{"user_id": "$USER_ID"}, {"metadata": {"type": "decision"}}]}\` -- design / architecture
|
||||
- \`{"AND": [{"user_id": "$USER_ID"}, {"metadata": {"type": "anti_pattern"}}]}\` -- debugging, error handling
|
||||
- \`{"AND": [{"user_id": "$USER_ID"}, {"metadata": {"type": "user_preference"}}]}\` -- tooling, stack, style
|
||||
- \`{"AND": [{"user_id": "$USER_ID"}, {"metadata": {"type": "convention"}}]}\` -- established patterns
|
||||
- Or scope with just \`{"AND": [{"user_id": "$USER_ID"}]}\` when no metadata filter fits.
|
||||
- Empty results are normal -- proceed without context.
|
||||
EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user