> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs-beta.getzep.com/v3/mem0-to-zep/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-beta.getzep.com/_mcp/server. # 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](/graph-overview). A user graph combines a user's chat messages and business data. > **Note** > > Contact [sales@getzep.com](mailto:sales@getzep.com) 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`](/adding-messages). Add text or JSON business data with [`graph.add`](/adding-business-data). Zep extracts entities and temporal facts from both data sources. Facts include validity timestamps when the source data supplies them. ## Map common operations | Mem0 operation | Zep Python method | Notes | | ----------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------ | | Add conversation messages | `client.thread.add_messages(thread_id=..., messages=[...])` | Create the user and thread first. Preserve message order. | | Add a business record | `client.graph.add(user_id=..., type="json", data=...)` | Serialize JSON data to a string. Use `type="text"` for text. | | Retrieve context for a conversation | `client.thread.get_user_context(thread_id=...)` | Returns an assembled Context Block in `.context`. | | Search a user's graph | `client.graph.search(user_id=..., query=..., scope="auto")` | Use another scope when you need one result type. | | List graph nodes | `client.graph.node.get_by_user_id(user_id=...)` | Supports pagination and filters. | | List graph edges | `client.graph.edge.get_by_user_id(user_id=...)` | Each edge contains a temporal fact. | | Delete an episode | `client.graph.episode.delete(uuid_=...)` | Deletion also removes data derived only from that episode. | Do not translate each Mem0 memory into a Zep fact. Ingest the source messages or records so Zep can build the graph. ## Migration procedure 1. [Install a Zep SDK](/install-sdks) and create an API key. 2. Export users, conversation messages, and business records from Mem0. 3. Create a Zep user for each application user. 4. Create a Zep thread for each conversation. 5. Add conversation messages in chronological order. 6. Add business records to each user's graph. 7. Monitor the operation with the method for its ingestion path: * For direct `graph.add` or `thread.add_messages` writes, poll the last episode or use the `episode.processed` webhook. * For Batch API imports, poll the batch or its items. * For `zep-ingest`, call `IngestResult.wait()`. * Use task polling only for an operation that returns `task_id`. 8. Compare retrieval results for a representative set of user questions. Use [`zep-ingest`](/zep-ingest) or the [Batch API](/adding-batch-data) for large imports. Follow [Prepare data for ingestion](/prepare-data-for-ingestion) so each record has a timestamp, a stable identity, and a single destination graph. See [Check data ingestion status](/check-data-ingestion-status) for the polling and webhook patterns. ## 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](/context-types). Use [`graph.search`](/searching-the-graph) 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](/memory-security) when you send it to a model. ## Related guides * [Quick start guide](/quick-start-guide) * [Adding messages](/adding-messages) * [Adding business data](/adding-business-data) * [Searching the graph](/searching-the-graph) * [Customizing graph structure](/customizing-graph-structure) * [User summary instructions](/user-summary-instructions) > Map Mem0 users and memories to Zep users, threads, and graphs