Migration guide
Migrating from Mem0 to Cognee
Cognee ships a Mem0 import adapter. This guide covers when a move makes sense, how to export from Mem0, and the one call that loads those memories into a Cognee knowledge graph.
Based on public information as of September 2026. See each vendor's site for current details.
Mem0 is a good fit for per-user personalization in a chat product: it extracts facts about a user from conversation, stores them per user_id, and returns them on the next turn with very little to operate. If that is your whole requirement, migrating buys you a graph you do not need and an ingestion pipeline that costs LLM tokens. Move when the shape of the problem changes, not because a list told you to.
Disclosure: Cognee is our product. Claims about Mem0 are based on its public documentation as of September 2026.
Why teams migrate from Mem0
Mem0 memory is scoped to a user, agent, or run. Teams that need several agents to read and write one knowledge base built from documents, databases, and tickets move to Cognee because the graph is the shared object, with per-tenant isolation on top.
"Did this customer file a similar ticket before, and how was it resolved?" is a traversal over connected entities. Cognee stores memory as typed entities and relationships plus a vector index, so those questions are answered by following edges rather than ranking similar text.
Cognee's defaults run embedded (SQLite, LanceDB, Ladybug) with no external services, and swap to PostgreSQL, Neo4j, or Amazon Neptune for production. Mem0 also has an open-source tier; the difference is that Cognee's full feature set is in the open-source core.
Migration steps
Use the Mem0 SDK or platform export to pull every memory you want to keep (per user, agent, or all) and save the result as JSON. The Cognee adapter accepts a plain list of memory records or a dict with a results, memories, or items key, which matches what Mem0's list and export endpoints return.
Python import jsonfrom mem0 import MemoryClient # or Memory() for the OSS packageclient = MemoryClient()records = client.get_all(user_id="alice") # repeat per user/agent as neededwith open("mem0_export.json", "w") as f:json.dump(records, f)pip install cognee gives you embedded defaults that need no infrastructure. Set LLM_API_KEY, and optionally point the graph and vector layers at PostgreSQL, Neo4j, or Neptune through environment variables when you are ready for production.
Shell pip install cogneeexport LLM_API_KEY="..." # OpenAI, Anthropic, or a local providerPass the export to cognee.remember through the Mem0Source adapter. The default mode re-derives the graph by running Cognee's own extraction over the raw memories; use preserve to map Mem0's facts straight into the graph with zero LLM calls, or hybrid for both.
Python import asyncioimport cogneefrom cognee.migration import Mem0Sourceasync def main():await cognee.remember(Mem0Source("mem0_export.json", mode="re-derive"),dataset_name="customer_memory",)asyncio.run(main())Ask the questions your agents will ask. GRAPH_COMPLETION answers from the graph; CHUNKS returns the raw records so you can spot-check that nothing was dropped.
Python from cognee import SearchTyperesults = await cognee.search("What does Alice prefer?",query_type=SearchType.GRAPH_COMPLETION,datasets=["customer_memory"],)Replace Mem0 add/search calls with cognee.remember and cognee.recall in the Python SDK, use the TypeScript client (@cognee/cognee-ts), or connect Claude Code, Cursor, and other MCP clients to the Cognee MCP server. Keep Mem0 running in parallel until the new answers match.
Mode choice is the main decision. re-derive (default) throws away Mem0's extracted facts and rebuilds the graph from the raw memory text with Cognee's pipeline, which costs LLM tokens and produces the richest graph. preserve keeps Mem0's facts as-is with no LLM calls, which is fast and cheap but flat. hybrid does both. Start with preserve on a sample to check the shape, then re-derive the full set.
The import adapters live in cognee.migration and are documented at docs.cognee.ai. If your export does not match the shape the adapter expects, open an issue on GitHub with a redacted sample.
Frequently asked questions
Does the Mem0 import need the Mem0 platform to stay online?
No. The adapter reads a JSON file or an in-memory list you already exported. Once the import completes, Cognee has its own copy in your storage backends.
Will my Mem0 user_id scoping survive the move?
Memories keep their metadata as data items. For hard isolation between users or tenants, enable Cognee's backend access control and import each user into their own dataset, which gives each one separate storage.
Can I migrate back, or to another system, later?
Yes. cognee.export writes a dataset to the open COGX archive format or to GraphML, so memory is never locked into Cognee's storage.
How long does the import take?
preserve mode is limited by database writes and finishes in seconds to minutes. re-derive and hybrid run LLM extraction over every record; budget time and tokens roughly in proportion to the total text volume, and use dry_run=True on cognee.remember for an estimate.