In short.
This is a short first-party Mem0 tutorial for Python developers building multi-user, multi-agent or white-label AI apps on the hosted Mem0 Platform. Its main catch is that it covers only the Platform MemoryClient, shows sample outputs that were not verified here, and has a few internal inconsistencies in how filters are described. It uses a travel-service story: Nora runs the service, Cam is a traveler, and there is a travel planner agent and a chef agent. Through that story it shows how to write memories with user_id, agent_id, run_id and app_id, and how searching on user_id alone leaks one agent's memories into another. It then fixes the leak with agent, app and run filters and separates white-label customers with app_id. It also covers deleting tenant or session memories and exporting tenant memories. The page states no price, licence, package version or install command, so cost and reuse rights are unknown.
Researched and written by an AI model and checked by a second AI model. How it works
Scope is the single documentation page at [https://docs.mem0.ai/cookbooks/essentials/entity-partitioning-playbook], captured in full on 2026-11-15. Linked pages are excluded and their contents were not assessed. These include the Memory Filters v2 guide, Custom Instructions, the Mem0 dashboard, the GitHub repository and nearby cookbooks. No code on the page was executed and no Mem0 account or API was used; the sample outputs described are only what the page itself prints. The page shows no licence, pricing or SDK/API version information, so those items are reported as unknown.
The overview
Identity
The resource is the documentation page titled Partition Memories by Entity, in the Essentials group of the Mem0 cookbooks, at [https://docs.mem0.ai/cookbooks/essentials/entity-partitioning-playbook]. Its one-line description is: keep memories separate by tagging each write and query with user, agent, app, and session identifiers. A banner on the page says it works with the Mem0 Platform (MemoryClient), takes about 15 minutes, and uses Python.
Mem0 publishes the page on its own documentation site. The page's edit link points to the mem0ai/mem0 GitHub repository, so the page source appears to live there. The page is a guide to one feature of a memory layer for LLM applications. It is not itself a library, plugin or hosted service.
Assessment
As a teaching page it is focused and practical. It states a concrete problem: memories from one agent or customer showing up in another's results. It reproduces the problem, fixes it, then adds a reference table, troubleshooting tips and best practices. A developer who already uses Mem0 Platform can learn the four identifiers and the filter format in one sitting.
It has weaknesses. The example outputs are the page's own and were not checked here. Some sample outputs look inconsistent. For example, the leak demonstration already returns a Kyoto dining memory that is only added in the next section, and results appear sometimes as plain lists and sometimes as a results dictionary. A tip says to query user and agent scopes separately, yet the troubleshooting and debugging snippets combine user_id and agent_id in one AND filter. None of this undermines the main idea, but the page should be checked against the current Mem0 API reference before production use. Nothing on the page was run or tested for this report.
Who it is for
The target reader is a Python developer building an AI app on the hosted Mem0 Platform where several people, agents, products or sessions share one memory store. Examples include a multi-agent assistant, a support tool with per-ticket sessions, or a white-label product serving several customers.
Beginners can follow the story, but they need to be comfortable with Python dictionaries, calling a hosted API with a key, and the idea of a memory layer for chat applications. The page does not directly serve developers who use only the open-source Mem0 library, another language or another memory product. It says it works with the Platform MemoryClient and gives no open-source or other-language versions.
What it teaches
The page walks through these tasks: writing memories with client.add using user_id, agent_id, run_id and app_id together; searching with client.search and a filters object built from AND lists; reproducing a leak by filtering on user_id only; scoping a chef agent's memories with agent_id, app_id and run_id; separating enterprise tenants with app_id; listing records with client.get_all (page and page_size arguments); deleting with client.delete_all by app_id, or by user_id plus run_id; and exporting a tenant's memories with client.get_memory_export.
It also gives a table of when to use each identifier: user_id for individual preferences that persist, agent_id for separate AI roles, app_id for white-label deployments or separate products, and run_id for temporary sessions. A troubleshooting section covers empty results, including null fields, wildcards and mismatches between AND and OR results. Three best practices close the page: use consistent identifier formats, print filters when debugging, and clean up temporary sessions.
Using it
Requirements
Stated requirements are Python, the MemoryClient class imported from the mem0 package, and an API key from the Mem0 dashboard. The page links to the dashboard at [https://app.mem0.ai/]. The sample key is the placeholder m0-...
The page does not give the pip install command, the package version, the minimum Python version or any required account tier. The troubleshooting snippet calls json.dumps without importing json, so readers need to add that import. Because the examples call a hosted service, they need network access to Mem0, though the page does not say so.
How it works
The mechanism is metadata tagging plus filtered retrieval. Each write sends conversation messages with up to four identifiers: user_id (the person), agent_id (the AI role), run_id (a session or ticket) and app_id (the product or tenant). Each read sends a filters dictionary, such as {"AND": [{"user_id": "traveler_cam"}, {"app_id": "concierge_app"}]}. Matching is exact on the value you provide. The wildcard "*" matches any non-null value, so a memory written without an identifier will not match a wildcard on that field. Returned items carry short memory text such as 'avoids shellfish and prefers boutique hotels', which shows that the platform turns submitted messages into short memory statements.
The page's isolation lesson is that a query is only as narrow as the filters you send. In its example, filtering on user_id alone returns both the travel memory and the chef memory for the same user, while filtering instead on agent_id, app_id and run_id returns only the chef memory. One tip says memories can be written with several identifiers but each search resolves one entity boundary at a time, so user and agent scopes should be queried separately. The page does not explain server-side internals or how memories are extracted. It also does not explain how AND and OR combine when both appear in one filter, and refers readers to a separate Memory Filters v2 guide that is not covered here.
Setup
Setup on the page is three lines: import MemoryClient from mem0, then create a client with api_key set to a key from the Mem0 dashboard. Every later example reuses the same client object.
Practical gaps: there is no install step, no advice on keeping the key out of source code (the sample hard-codes a placeholder), and no mention of sandbox or test projects. Several examples write and delete data, so a cautious reader would load the key from an environment variable and try the examples with throwaway identifiers first.
Worked example from the page
The story starts with Nora's travel service, where keeping all memories in one bucket let a recruiter's nut allergy show up in a traveler's dinner reservation. Step one stores Cam's message about avoiding shellfish and preferring boutique hotels with user_id traveler_cam, agent_id travel_planner, run_id tokyo-2025-weekend and app_id concierge_app. Two searches then use separate scopes: one by user, app and run, and one by agent and app. The page labels the first result as the user's memory and the second as the agent's own memory. Both are about avoiding shellfish and preferring boutique hotels.
Step two adds a chef agent. A search with only user_id traveler_cam returns the hotel memory and a Kyoto dining memory, which the page presents as a leak. Step three writes a chef memory under agent_id chef_recommender and run_id menu-planning-2025-04, then searches with agent_id, app_id and run_id and shows only the Kyoto memory. Step four uses app_id sports_brand_portal with a wildcard filter and get_all to list user IDs. It then calls delete_all(app_id=...) to delete that tenant's memories, and the page shows a success message. These outputs are what the page prints; they were not reproduced for this report.
Assessment & evidence
Limitations and cautions
Scope: the page covers only the Platform MemoryClient in Python. It does not show whether the same identifiers and filter syntax work in the open-source library or other SDKs.
Internal inconsistencies to watch for: (1) the tip says to query user and agent scopes separately, but the troubleshooting snippets, the print-filters best practice and a commented-out alternative in the complete example combine user_id with agent_id in one AND filter; (2) the enterprise example puts an AND list and an OR list side by side in one filter without explaining how they combine; (3) the leak demonstration returns a Kyoto memory before the page adds it.
Isolation caveats: The chef query filters by agent, app and run without an explicit person filter. Verify the supported approach to per-person isolation before adapting it; this page advises separate user and agent queries. More generally, isolation here depends on the calling code always sending the right filters. The page does not describe tenant isolation enforced by the server or per-tenant access control, so do not treat it as a security boundary without checking Mem0's documentation.
Destructive operations: delete_all is shown without any confirmation step, and the page does not say what happens if an identifier is left out. The page also does not cover delay between add and search, scale, performance, error handling or rate limits.
Reasoning
The page earns its value as a teaching aid through connected, concrete examples. The same traveler, traveler_cam, is written under both the travel_planner and chef_recommender agents. A search on user_id alone returns both the hotel memory and the Kyoto dining memory, and a search on agent_id, app_id and run_id returns only the Kyoto memory. The identifier table, troubleshooting snippets and best practices follow directly from that code, so the page explains memory leakage between agents and apps clearly.
Confidence in exact behaviour is limited by the documented inconsistencies. The leak output includes a Kyoto memory before the page adds it, and results appear sometimes as plain lists and sometimes as results dictionaries. Several snippets also combine user_id and agent_id in one filter despite the tip advising separate queries. The page names no SDK or API version. Runtime behaviour was not independently tested. Treat the page as a clear explanation of the concepts and a starting point for code, not as proof of how the current API behaves.
Alternatives and related reading
The page links to related Mem0 material whose contents are outside this resource. These include a Memory Filters v2 guide at [https://docs.mem0.ai/platform/features/v2-memory-filters], which the page describes as covering AND/OR logic, nested filters and wildcards. They also include a Custom Instructions page at [https://docs.mem0.ai/platform/features/custom-instructions], described as steering what Mem0 extracts and stores, and nearby cookbooks such as Tag and Organize Memories and Export Stored Memories.
The page does not evaluate competing memory products or compare shared and separate tenant storage.
Evidence
The public tutorial at [https://docs.mem0.ai/cookbooks/essentials/entity-partitioning-playbook] provides Python code for each step. That covers creating a MemoryClient with an API key, writing with client.add, scoped searches with client.search, listing with client.get_all, deleting with client.delete_all and exporting with client.get_memory_export. It also includes a table of when to use each identifier, troubleshooting snippets and best practices.
Several examples are followed by an Output block written by the page's authors. Examples include the leak result listing the hotel and Kyoto memories, the chef-only result after the fix, the user IDs athlete_jane, coach_mike and team_admin for the sports brand tenant, and the message 'Memories deleted successfully!'. These are examples supplied by the authors, not independently reproduced results.
The page gives no pricing, licence or reuse terms, SDK or API version, or install command. Those items remain unknown.
Access & freshness
Costs
Cost is unknown from this page. It does not mention pricing, free tiers, usage limits, rate limits or which operations are billed. The examples need a Mem0 account and API key and call a hosted service, so charges or quotas may apply, but the page does not say. It also does not say whether writing memories uses language-model processing that could affect cost or speed. The only time figure is about 15 minutes to complete the tutorial.
Rights and data handling
No licence or reuse terms appear on the page. It links to the mem0ai/mem0 GitHub repository, including an edit path, which suggests the documentation lives there. No licence text appears on the page itself, so reuse and redistribution rights for the page text and code snippets are unknown. The page offers no downloadable package or redistribution terms.
The tutorial sends user conversation text to Mem0's hosted platform. The page says nothing about data retention, storage location, access control or privacy terms. It does not document compliance guarantees, applicable standards or legal sufficiency. It does show deletion by app_id or by user_id plus run_id. It also labels its tenant export example (client.get_memory_export filtered by app_id) a compliance export, but that label is not a compliance guarantee. Anyone storing personal or sensitive data should read Mem0's own terms and privacy documentation, which are outside this page; the example itself involves allergies.
Freshness
The page metadata gives a last-modified time of 2026-09-04 at 15:02 UTC. The page was captured on 2026-11-15, about ten weeks later, and whether it changed after that is unknown. The sample identifiers contain 2025 dates, but those are example values, not publication dates.
The page names no Mem0 SDK or API version. It refers to a Memory Filters v2 guide, which suggests the filter syntax has versions, but it does not say which client releases support it. Check the current Mem0 API reference and changelog before relying on exact method names, arguments or response formats.
Suggested next steps
If you use Mem0 Platform with more than one user, agent or customer, read the page end to end. Then adopt its advice on consistent identifier naming, such as one pattern per identifier type, and print the filter dictionary whenever a search looks wrong.
Before copying the code into production: install the SDK following Mem0's own instructions and load the API key from the environment. Verify the supported approach to per-person isolation before adapting the chef query, since the page advises separate user and agent queries. Try the examples with throwaway identifiers. Test delete_all only on data you can afford to lose, and export first. Confirm pricing, data-handling terms and current API behaviour with Mem0. If you use the open-source library or another language, look for the matching documentation instead of assuming this page applies.
