Mem0 Migration
Zep is a memory layer for AI agents that unifies chat and business data into a dynamic temporal knowledge graph for each user. It tracks entities, relationships, and facts as they evolve, enabling you to build prompts with only the most relevant information—reducing hallucinations, improving recall, and lowering LLM costs.
Zep provides high-level APIs like memory.get
and deep search with graph.search
, supports custom entity/edge types, fact ratings, hybrid search, and granular graph updates. Mem0, by comparison, offers basic add/get/search APIs and an optional graph, but lacks built-in data unification, ontology customization, temporal fact management, fact ratings, and fine-grained graph control.
Got lots of data to migrate? Contact us for a discount and increased API limits.
Zep’s memory model in one minute
Unified customer record
- Messages sent via
memory.add
go straight into the user’s knowledge graph; business objects (JSON, docs, e-mails, CRM rows) flow in throughgraph.add
. Zep automatically deduplicates entities and keeps every fact’s valid and invalid dates so you always see the latest truth.
Domain-depth ontology
- You can define Pydantic-style custom entity and edge classes so the graph speaks your business language (Accounts, Policies, Devices, etc.).
Temporal facts & ratings
- Every edge stores when a fact was created, became valid, was invalidated, and (optionally) expired;
fact_ratings
let you auto-label facts (e.g., “high-confidence KYC data”) and filter on retrieval.
Hybrid & granular search
graph.search
supports hybrid BM25 + semantic queries, graph search, with pluggable rerankers (RRF, MMR, cross-encoder) and can target nodes, edges, episodes, or everything at once.
How Zep differs from Mem0
SDK support
Zep offers Python, TypeScript, and Go SDKs. See Installation Instructions for more details.
Migrating your code
Basic flows
Practical tips
- Session mapping: Map Mem0’s
user_id
→ Zepuser_id
, and createsession_id
per conversation thread. - Business objects: Convert external records to JSON or text and feed them through
graph.add
; Zep will handle entity linking automatically. - Prompting: Replace your custom “summary builder” with the
memory.context
string; it already embeds temporal ranges and entity summaries. - Quality filters: Use Fact Ratings and apply
min_fact_rating
when callingmemory.get
to exclude low-confidence facts instead of manual post-processing. - Search tuning: Start with the default
rrf
reranker; switch tommr
,node_distance
,cross_encoder
, orepisode_mentions
when you need speed or precision tweaks.
Side-by-side SDK cheat-sheet
Where to dig deeper
- Quickstart
- Graph Search guide
- Entity / Edge customization
- Fact ratings
- Graph CRUD: Reading from the Graph | Adding to the Graph | Deleting from the Graph
For any questions, ping the Zep Discord or contact your account manager. Happy migrating!