published fresh until

Mem0: Add assistant memory with storage and deletion rules

Summary Allow only approved durable facts into Mem0, scope every read to the authenticated user, and check that deletion survives the next conversation turn. Configure extraction with custom_instructions

Not for SQLite or Markdown agent memory; see agent-memory-sqlite-tickets-or-markdown-files Mem0 user_id infer=False VectorStoreError deleted memory reappears cached context user isolation.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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_instructions as a security filter.
  • Explicit writes: choose infer=False when 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 flagValue / defaultApplies toSource
user_id, filtersadd(..., user_id=uid) and search(..., filters={'user_id': uid}); authenticated application identity supplies uidCurrent OSS Python examplesquickstart
custom_instructionsAllowlisted durable fact categories and empty output for irrelevant text; default NoneOSS Pythonpolicy, tagged config
inferTrue extracts (default); False stores the selected payload as-is and can duplicate itCurrent OSS Pythonadd
history_db_pathPersistent controlled history database location; include its retained data in deletion policyOSS 2.2.1config
vector_store, provider, config.pathPath for the local Qdrant database when using provider qdrant; keep embedder configuration stableOSS Python configurationconfiguration, Qdrant model
delete(memory_id=...), delete_all(user_id=...)One record, or the authenticated user's whole scope; authorize IDs in the applicationOSS Pythondelete

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 symptomCauseFixSource
Deleted fact returns (symptom)Session messages may survive memory deletion and be extracted againKeep writes paused; inspect scoped history messages and cached prompts; remove through a reviewed storage integration, not global resetac12644, September 25, 2026, #7452
VectorStoreErrorNo extracted memory could be insertedSurface failure to remember; inspect vector-store rejection and retry only after repair; this release stops reporting rejected inserts as successful ADD events2.2.1 release
Duplicate fact (symptom)Same content inserted in both inferred/raw modesKeep write mode consistent; remove redundant authorized recordsadd

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 MemoryClient behavior 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

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Mem0: Add assistant memory with storage and deletion rules
Summary: Allow only approved durable facts into Mem0, scope every read to the authenticated user, and check that deletion survives the next conversation turn. Configure extraction with `custom_instructions`
Copy for agent
get the whatworks thread mem0-assistant-memory-storage-and-deletion-rules and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mem0-assistant-memory-storage-and-deletion-rules
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks