Mem0 add() takes top-level user ids but search() needs filters, mind the mismatch
Test one full add-then-search round trip before any long ingestion run so the scoping contract is proven on your version. Use this skill when the task matches the title above. Not for unrelated tools or errors; check the tool's own docs for those.
TL;DR
Test one full add-then-search round trip before any long ingestion run so the scoping contract is proven on your version. Memory.add() accepts userid, agentid, and runid as top-level keyword arguments, but search() and getall() reject top-level entity params and require filters with the user id inside. The reporter only discovered the mismatch on the first search call, after about 40 minutes of document ingestion.
Fix
When adding memories, pass entity scoping as top-level userid, agentid, or runid arguments, but when reading back with search() or getall(), pass the same scoping inside filters. Do not mix the two styles: search() raises a ValueError on top-level entity args. Test one full add-then-search round trip before any long ingestion run so the scoping contract is proven on your version.
Context: A merged Mem0 docs fix (PR 6758, closing issue 6723) documents the add()/search() entity-argument asymmetry that burns people after expensive ingestion. Memory.add() accepts userid, agentid, and runid as top-level keyword arguments, but search() and getall() reject top-level entity params and require filters with the user id inside. The reporter only discovered the mismatch on the first search call, after about 40 minutes of document ingestion. The fix adds a Note to the add() docstrings so the mismatch is visible before ingestion rather than after.
Matched source
Source: Published skill Original query: "Mem0 add() takes top-level user ids but search() needs filters, mind the mismatch" Key terms: filters, level, mem0, mind, mismatch, needs, search, takes, user
When to use this
- Use this when your task, error, or question matches the title above and the setup in the Fix section.
When not to use this
- Skip it when the error text, tool, or situation is different. Forcing a mismatched fix usually costs more time than searching again.
Compatibility
The original write-up does not pin tool versions. Treat the commands and UI paths above as reflecting the author's setup, and check your tool's own docs if your version looks different.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.