Learning resourcesReviewed · Mem0

Mem0 Platform: Entity-Scoped Memory (documentation page)

This is a documentation page from the Mem0 Platform docs for developers building LLM apps on Mem0's hosted memory API, and its main catch is that user_id and agent_id are not stored together on the default extraction path, so an AND filter across both returns nothing. It explains the four scoping identifiers (user_id, agent_id, app_id, run_id), shows Python examples for add, search, get_all and delete_all, describes filter and wildcard behaviour, and lists best practices. It says nothing about pricing, limits or licence.

Researched 15 Nov 2026

In short.

This is the Mem0 Platform documentation page on entity-scoped memory, aimed at developers who store and retrieve LLM-app memories through Mem0's hosted API, and its main catch is that on the default extraction path a memory carries user_id or agent_id but not both, so AND filters across the two return nothing. The page defines four identifiers (user_id, agent_id, app_id, run_id), shows how to tag writes with them, how to filter reads (client.search, client.get_all) through a filters JSON object, and how to delete a session with client.delete_all. It also explains that unmentioned identifiers are not constrained in a filter and that the wildcard "*" matches only non-null values. The examples are Python only. The page provides a documented delete success response and describes returned memory IDs, but shows no search or get_all results and no execution transcript. Pricing, limits, identifier format rules, licence and SDK install steps are not on the page. Nothing here was run or tested; this report reads the documentation only.

Researched and written by an AI model and checked by a second AI model. How it works

The analysis covers the complete selected page at [https://docs.mem0.ai/platform/features/entity-scoped-memory] as captured on 2026-11-15, including its rendered text, code samples, tables, callouts, navigation and embedded page metadata. Linked pages (Memory Filters, Direct Import, Graph Memory, Memory Expiration, the partitioning cookbook, the Add Memories API reference, Pricing and quickstart) are excluded and are only named. No licence, terms or pricing text was in the captured page, so costs and reuse rights are reported as unknown. Nothing was executed: the examples were not run, no outputs were observed, and statements about what searches or deletes would return are either quoted from the page or marked as inference.

The overview

Identity

The resource is a single documentation page titled Entity-Scoped Memory at [https://docs.mem0.ai/platform/features/entity-scoped-memory]. It sits in the Mem0 Platform tab of the Mem0 docs, under Features, in the Essentials group, between the Memory Filters and Profiles pages. Its one-line description reads: Scope conversations by user, agent, app, and session so memories land exactly where they belong.

The site configuration describes Mem0 as a self-improving memory layer for LLM applications. The page is documentation for a feature of that product, not the product itself and not a downloadable package. The docs are built on Mintlify, and the page's edit link points to a public GitHub repository, mem0ai/mem0, with the docs in a docs directory (platform/features/entity-scoped-memory.mdx). The page's structured data gives a last-modified time of 2026-08-03.

One note on terms: the page opens with a callout that the identifiers it covers (user_id, agent_id, app_id, run_id) are different from the graph entities (people, places, concepts) shown in Mem0's Graph Memory feature. Do not confuse the two.

Assessment

As a short feature guide it is clear and practical. It gives a table of the four identifiers, a guide to choosing between them, Python code examples for the full add, search, list and delete cycle, a verification checklist and best practices. It also states its sharpest edge openly: passing both user_id and agent_id to client.add does not produce records with both fields set on the default extraction path, and the page repeats this in a warning, a tip and the feature notes.

Weaknesses are mostly omissions. The page provides a documented delete success response and describes returned memory IDs, but shows no search or get_all results and no execution transcript. It covers Python only, gives no identifier format limits, and says nothing on cost, rate limits, record limits or licence. Its verification advice also pulls in two directions: the setup text says the dashboard should show user, agent, app and run all populated for an entry, while the warning says user-message facts carry user_id with agent_id null and assistant-message facts the reverse. Readers should expect to check this themselves.

Isolation depends on your application supplying the right identifiers on every call. The page does not describe any server-side per-tenant access control beyond these tags and filters, so treat it as a labelling and filtering scheme, not as a documented security boundary.

Who it is for

The page's own use cases are: assistants for several customers who each need a private memory space; different agents (for example a planner and a critic) that need separate context for the same user; and sessions that should expire or be deleted on their own schedule, which makes debugging and data removal more precise.

It suits developers who already use, or are evaluating, the Mem0 Platform API and need to decide how to partition memories across users, agents, apps and sessions. A beginner can follow the explanations and copy the snippets, but needs basic Python and some comfort with JSON filter objects. Anyone who is not using the Mem0 Platform will find it of limited use beyond the general idea of partitioning memory by owner and by session.

What the page covers

Identifiers. user_id is for a persistent persona or account (the example is customer_6412); agent_id is for a distinct agent persona or tool (meal_planner); app_id is for a white-label app or product surface (ios_retail_demo); run_id is for a short-lived flow, ticket or session thread (ticket-9241). The page recommends user_id for preferences and history that follow a person, agent_id for an agent's personality or operating modes, app_id for tenant separation in white-label or partner deployments, and run_id for temporary flows such as support tickets, chat sessions and experiments.

Writes. client.add accepts any combination of the four fields. app_id and run_id are stored on every memory the call produces. Fields that are absent default to null.

Reads. client.search, client.get_all and exports take the same identifiers inside a filters JSON object, with AND and OR groups. Deletes (client.delete_all) scope through query parameters, which the SDK builds from arguments such as user_id=... and run_id=.... The page also shows an HTTP equivalent, POST /v3/memories/add/, with the same identifiers in the JSON body.

Filter behaviour. Passing only a user_id filter matches on user_id alone and still returns records that also have agent_id, app_id or run_id set. The wildcard "*" matches only non-null values, so it means any agent or any user and excludes records where that field is null. The page also suggests combining entity filters with metadata filters such as categories or created_at for audits and exports.

Using it

Requirements

What the page says you need: a Mem0 Platform account and API key (the example key looks like m0-...), which you can generate in the Mem0 dashboard, and the Python MemoryClient imported with from mem0 import MemoryClient. The HTTP route needs the same identifiers in a JSON body.

What the page does not say: the package name or install command, supported Python versions, SDK versions, other language SDKs, network or runtime requirements, and any plan or tier needed for these features. These are unknown from this page and would have to come from the linked quickstart or API reference, which were not part of the captured evidence.

How it works

The model is tag on write, filter on read. Each memory record has optional fields user_id, agent_id, app_id and run_id. You supply them when you call client.add, and you supply them again inside filters (or as delete arguments) when you read or delete.

The subtle part is attribution on the default extraction path. The page says each extracted fact is attributed to whoever stated it: facts from user messages are stored with user_id set and agent_id null, and facts from assistant messages are stored with agent_id set and user_id null. app_id and run_id go onto every record either way. A filter such as AND of user_id and agent_id therefore matches nothing for memories created this way, and the page advises OR to match either scope. Records with both user_id and agent_id populated come only from Direct Import (infer=False), which writes your text verbatim without attribution splitting.

How facts are extracted from messages, which model does it, and how search results are ranked are not described on this page and are unknown from this evidence.

Setup

The page's setup is short. Create a client with client = MemoryClient(api_key="m0-..."). To check the connection, call client.project.get(), which should return project details including org_id and project_id. A 401 error means you should generate a new API key in the Mem0 dashboard.

After a first client.add, the page says the response will include one or more memory IDs and suggests checking the dashboard under Memories to see the entry under the right identifiers. It then offers a verification checklist: run client.search with your filters and confirm only expected memories appear, check the dashboard filter pills, and call client.delete_all with a unique run_id to confirm that other sessions remain intact.

Installing the SDK and creating an account are not covered on this page.

Worked example from the page

The page's travel example stores a short conversation (the user says they prefer boutique hotels and avoid shellfish; the assistant says it logged the preferences) with user_id customer_6412, agent_id travel_planner, app_id concierge_portal, run_id itinerary-2025-apr and metadata {"category": "preferences"}. It then shows two search calls, one get_all call and one delete_all call.

A user-scope search uses an AND of user_id, app_id and run_id with the query Any dietary flags?. An agent-scope search uses an AND of agent_id and app_id. An app audit uses get_all with app_id AND an OR of user_id "*" and agent_id "*", paged at page 1 with page_size 20. The cleanup call is client.delete_all(user_id="customer_6412", run_id="itinerary-2025-apr"), which the page says returns {"message": "Memories deleted successfully!"}.

The page shows no outputs for the searches. Reading the page's own attribution rule, the user-scope search should match the fact taken from the user message, while the agent-scope search can only match facts attributed to the assistant message; the page does not show what either returns. It also does not state whether the final delete_all call, given user_id and run_id, removes assistant-attributed records from the same run, so check that on a test run before relying on it for compliance deletions. None of this was run for this report.

Assessment & evidence

Limitations and caveats

Scope of the page: Python examples only, with a one-line mention of the REST route. The page provides a documented delete success response and describes returned memory IDs, but shows no search or get_all results and no execution transcript. It covers no error cases beyond a 401 on connection, gives no rate or size limits, and sets no rules for identifier format (length, allowed characters, case sensitivity), which are unknown.

Behaviour to design around: user_id and agent_id are not both set on default-path records; AND filters across them return nothing; a filter that omits an identifier does not exclude records that have it set, so a user_id-only filter also returns that user's records from every app and run. For multi-tenant separation, include app_id (and run_id where relevant) in every filter. A record's null fields are not matched by a specific value, so searching for agent_id equal to a value will not find a record whose agent_id is null.

The page leans on conventions you must enforce yourself, such as consistent identifier formats like team-alpha or app-ios-retail, and scheduled cleanup jobs for run_id data. It does not describe automatic expiry for run_id, even though the use-case list says sessions should be able to expire on their own schedule; a separate Memory Expiration page exists in the navigation but was not captured.

The dashboard guidance (all four fields shown as populated for an entry) sits awkwardly with the attribution warning, as noted in the assessment.

Reasoning behind this report

Every factual statement above comes from the text and code samples on this one page. Where the report goes beyond the literal text, it says so: the expectations about what the user-scope and agent-scope searches would return are inferences from the page's attribution rule, not shown results, and the point that isolation depends on the caller's identifiers reflects what the page does and does not describe.

The page is classed as a learning resource because it teaches how to use one feature of an existing product, rather than being a tool, plugin or code library in itself. It is useful mainly because it documents a behaviour that would otherwise surprise developers: the split between user-attributed and agent-attributed facts, and the resulting failure of AND filters.

Alternatives and related options

The page makes no comparisons. Within Mem0, the site navigation shows a separate Open Source section and a Platform vs Open Source page, plus Memory Filters, Direct Import, Graph Memory, Memory Expiration and a cookbook on partitioning memories by entity; none of these were captured, so they are only named here as places to look.

Outside Mem0, the page names no alternatives. Other memory products and approaches were not examined, so external alternatives and their suitability are unknown from this page.

Evidence used

The evidence is one captured copy of the page's HTML, taken on 2026-11-15. It includes the rendered text, seven Python code blocks (client configuration, teacher-memory add, travel-memory add, user search, agent search, app listing and deletion), the feature and identifier tables, all callouts, the sidebar navigation and the embedded page source and metadata (title, description, structured data with a last-modified time, edit link).

Not captured: any linked page (Memory Filters, Direct Import, Graph Memory, the cookbook, the Add Memories API reference, Pricing, quickstart), any licence or terms, any release notes, and any output from running the code. Nothing was executed, and no claims about real behaviour beyond what the page states can be made.

Access & freshness

Costs

The cost is unknown. The page does not mention price, plan limits, free tiers, per-memory or per-call charges, or storage quotas. The docs navigation lists a Pricing FAQ page under Support, but its contents were not part of the captured page and are not assessed here.

Reading the page costs nothing visible. Using the feature requires a Mem0 Platform account and API key, and whether that account is free or paid is not stated in the evidence.

Rights and data handling

The captured page contains no licence or terms notice for the documentation text or the code snippets. The page links to a public GitHub repository (mem0ai/mem0) as the source of the docs, but no licence file or licence text was captured, so reuse rights for the text and examples are unknown. Do not assume a licence from the repository link.

The page describes a hosted service: memories are written to and read from the Mem0 Platform through an API key and a dashboard. Where data is stored, how long it is retained apart from explicit deletes, who can access it, and what privacy or contractual terms apply are not described on this page. The page does mention that tagging helps with audit trails and data retention control, and that client.delete_all can remove memories for a scope, but it makes no compliance claims.

Freshness

The page's structured data and page metadata give a last-modified time of 2026-08-03T15:36:14Z, about three and a half months before the capture on 2026-11-15. The page identifies a versioned add route, POST /v3/memories/add/, but specifies no SDK version or compatibility guarantees.

The code examples use run_id values dated 2025, which are only sample strings. Whether the docs have changed since capture is unknown; since this is a live vendor docs page, re-check the current text before relying on exact behaviour.

Suggested next steps

If you are building on the Mem0 Platform: decide your identifier scheme first (stable user_id per person, agent_id per persona, app_id per tenant or product surface, run_id per session), and keep formats consistent so groups can be queried or deleted later.

Always include app_id (and run_id when needed) in filters for tenant separation, use OR rather than AND when you want user-attributed and agent-attributed memories together, and print your filters while debugging.

Before relying on it, try the page's flow in a throwaway project: add a short conversation, run both scope searches, then delete by run_id and confirm with get_all that only that run was affected, including any assistant-attributed records. Check pricing and data-handling terms on Mem0's own pricing and terms pages, since this page does not cover them, and read the linked Memory Filters page for the full filter syntax.

Evidence for this report

selected-page.htmlselected · checked 2026-11-15