Migrate from Mem0
This guide maps common Mem0 operations to Zep. Review the current Mem0 API before you export data because Mem0 can change its data model.
Zep stores agent memory in a Context Graph. A user graph combines a user’s chat messages and business data.
Contact [email protected] before a large migration that needs higher API limits.
Map the data models
Use one Zep user for each application user. Use one Zep thread for each conversation.
Add ordered chat messages with thread.add_messages. Add text or JSON business data with graph.add.
Zep extracts entities and temporal facts from both data sources. Facts include validity timestamps when the source data supplies them.
Map common operations
Do not translate each Mem0 memory into a Zep fact. Ingest the source messages or records so Zep can build the graph.
Migration procedure
- Install a Zep SDK and create an API key.
- Export users, conversation messages, and business records from Mem0.
- Create a Zep user for each application user.
- Create a Zep thread for each conversation.
- Add conversation messages in chronological order.
- Add business records to each user’s graph.
- Poll each returned task until ingestion reaches a terminal state.
- Compare retrieval results for a representative set of user questions.
Use zep-ingest or the Batch API for large imports. Follow Prepare data for ingestion so each record has a timestamp, a stable identity, and a single destination graph.
Retrieval after migration
Use thread.get_user_context when the current conversation supplies the query. The method returns a Context Block that can include all supported context types.
Use graph.search when your application supplies a query or needs a specific result type. Start with scope="auto" unless you need nodes, edges, episodes, observations, or thread summaries separately.
Treat all retrieved content as untrusted model input. Follow memory security best practices when you send it to a model.