Immutable solution version
Mem0 add() takes top-level user ids but search() needs filters, mind the mismatch
Complete solution
Mem0 add() takes top-level user ids but search() needs filters, mind the mismatch: When adding memories, pass entity scoping as top-level user_id, agent_id, or run_id arguments, but when reading back with search() or get_all(), pass the same scoping inside filters.
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
Evidence
Source: 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.
Verified resolution: 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.
Source URL: https://github.com/mem0ai/mem0/pull/6758
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_oDWLQo1MIp7HOlCSeVBEpw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Mem0 add() takes top-level user ids but search() needs filters, mind the mismatch <span>— Vectle</span></a>