What this thread does
Do first: derive user_id from authenticated identity and apply the same user scope to every Mem0 write, search and deletion.
Short answer
As of November 2026, this card targets Mem0 OSS Python 2.2.1. Admit only approved durable preferences before sending text to the memory pipeline. Deleting a stored fact also requires clearing cached conversation context that could repeat or recreate it.
Choose / don't choose
- Automatic extraction: choose for sanitized interactions whose permitted facts need extraction; don't regard
custom_instructionsas a security filter. - Explicit writes: choose
infer=Falsewhen the application already selected the entire allowed fact; don't send an unfiltered transcript because extraction is bypassed (add semantics). - Scoped forgetting: choose user/record deletion; don't use a global
reset()to forget one user (deletion report).
Not for: SQLite or Markdown agent memory; see agent-memory-sqlite-tickets-or-markdown-files
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
user_id, filters | add(..., user_id=uid) and search(..., filters={'user_id': uid}); authenticated application identity supplies uid | Current OSS Python examples | quickstart |
custom_instructions | Allowlisted durable fact categories and empty output for irrelevant text; default None | OSS Python | policy, tagged config |
infer | True extracts (default); False stores the selected payload as-is and can duplicate it | Current OSS Python | add |
history_db_path | Persistent controlled history database location; include its retained data in deletion policy | OSS 2.2.1 | config |
vector_store, provider, config.path | Path for the local Qdrant database when using provider qdrant; keep embedder configuration stable | OSS Python configuration | configuration, Qdrant model |
delete(memory_id=...), delete_all(user_id=...) | One record, or the authenticated user's whole scope; authorize IDs in the application | OSS Python | delete |
Order of operations
1. Authenticate, retrieve only that user's relevant memories, and treat their text as data. Application authorization must also check record ownership before ID-based deletion; a memory ID is not permission. 2. Finish the interaction and accept its result before considering a write. Application policy: store only explicit durable language/output preferences the user asks to retain; exclude credentials and transient task text before calling add. Do not write rejected interactions. 3. For extraction, set focused custom_instructions; the name replaces custom_fact_extraction_prompt. Keep response formatting consistent with the installed pipeline, rather than replacing its schema (instructions, tagged pipeline). For a strict allowlist, select facts in the application and use infer=False only for approved text. 4. Retain returned IDs only after successful insertion. On deletion, pause concurrent writes, establish ownership/scope, delete, invalidate recalled-context caches and remove the fact from the next prompt/transcript. 5. Repeat scoped listing/search and a new harmless turn; inspect whether the fact comes from another memory, retained session messages, transcript or cache. Confirm another user's records remain before resuming writes (deletion).
Known failures and fixes
| Error or symptom | Cause | Fix | Source |
|---|---|---|---|
| Deleted fact returns (symptom) | Session messages may survive memory deletion and be extracted again | Keep writes paused; inspect scoped history messages and cached prompts; remove through a reviewed storage integration, not global reset | ac12644, September 25, 2026, #7452 |
VectorStoreError | No extracted memory could be inserted | Surface failure to remember; inspect vector-store rejection and retry only after repair; this release stops reporting rejected inserts as successful ADD events | 2.2.1 release |
| Duplicate fact (symptom) | Same content inserted in both inferred/raw modes | Keep write mode consistent; remove redundant authorized records | add |
Missing
- No documented per-user retained-message purge API is established for this release. Vector deletion alone cannot promise erasure from histories, logs or backups.
- Hosted
MemoryClientbehavior is outside this OSS recipe; its deletion checks must be assessed separately.
Checked
2026-11-12; OSS guides, tagged configuration/pipeline/Qdrant source, add/delete references, release and ac12644 report read. No memory storage or deletion commands executed.
Started from a post by @Mem0, packaged by the editor. Original post