Zep vs Mem0: Temporal Graph vs Fact Memory

9 min read

Zep vs Mem0 compared (Oct 2026): temporal context graph vs extracted facts, open source, self-hosting, APIs, pricing, the benchmark dispute, how to pick.

Zep vs Mem0 is a choice between two ways of storing what an agent learns. Zep keeps a temporal knowledge graph where every fact has a validity window, so old facts are invalidated rather than lost. Mem0 extracts short facts into a vector store with entity linking, and ranks them by semantic, keyword and entity match. Mem0 is open source; Zep is a managed service with Graphiti as its open-source core.

Many teams weighing the two also look at Hindsight, an MIT-licensed memory server that does time-aware graph recall like Zep but runs fully self-hosted like Mem0. On Mem0’s own comparison page it leads Mem0 by 9.8 and 15.5 points on the long-history BEAM 1M and 10M tests. This page compares all three on memory model, open-source status, APIs, pricing and benchmarks, based on their docs, READMEs and pricing pages, checked on 12 October 2026.

What are Zep and Mem0?

Zep is a managed context platform that builds a temporal context graph per user or account from messages and business data, and returns a prompt-ready block of relevant facts. Mem0 is an Apache 2.0 memory layer that uses an LLM to extract facts from conversations, stores them per user, agent or session, and returns them on search.

Zep’s design is described in the paper Zep: A Temporal Knowledge Graph Architecture for Agent Memory (Rasmussen et al., 2025). Its engine is Graphiti, released separately under Apache 2.0. See what is Zep memory for the full picture.

Mem0’s design is described in arXiv 2504.19413, and its algorithm was rewritten in April 2026. See what is Mem0.

Zep vs Mem0 at a glance

ZepMem0Hindsight
Product formManaged service (Zep Cloud)Library, self-hosted server, or Mem0 PlatformSelf-hosted server, embedded Python, or Hindsight Cloud
Open sourceGraphiti (Apache 2.0); Community Edition deprecatedLibrary and server (Apache 2.0)Full server (MIT), every feature included
Memory modelTemporal graph: entities, facts as edges, episodes as provenanceExtracted facts with embeddings plus an entity collectionFacts, experiences, consolidated observations, mental models
Changed factsOld fact gets an invalid date; history keptNew fact stored next to old one (ADD-only); retrieval ranks the current oneObservations are refined with new evidence, not overwritten
RetrievalContext Block, or graph search with RRF, MMR or cross-encoder rerankingSemantic + BM25 + entity, fusedSemantic + BM25 + graph + time range, fused, cross-encoder rerank
Reasoning over memoryNoNoreflect returns a reasoned answer
Graph in open sourceYes, via Graphiti (bring Neo4j, FalkorDB or Neptune)No; removed in April 2026, now Platform-onlyYes, on PostgreSQL + pgvector; no graph DB to run
SDKsPython, TypeScript, GoPython, TypeScript, REST, CLIPython, TypeScript, Go, REST, CLI
Self-host the full productEnterprise BYOC onlyYes, Docker serverYes: Docker, pip, Helm or embedded
Hosted pricingFree 10,000 credits/mo; Flex $125/moFree (own LLM key after 30 days); Custom plansUsage-based, free credits, no seat fee

Sources: the Graphiti README, the Mem0 README, the Hindsight README and each vendor’s pricing page.

How Zep handles memory

Zep organizes data into users, threads and episodes. Every message added to a user’s threads becomes an episode in that user’s graph. Zep extracts entities (nodes) and facts (edges) from each episode.

When new data contradicts a fact, Zep doesn’t delete it. It sets the time the old fact became invalid. That’s the core difference from most memory layers: you can ask what’s true now, or what was true last month. Graphiti calls these graphs bi-temporal.

Retrieval has two paths. thread.get_user_context() returns a Context Block, a prompt-ready string assembled from the user’s graph. graph.search() is the low-level path with scopes (edges, nodes, episodes) and a choice of reranker. With the zep-cloud v3 SDK:

 1import os
 2from zep_cloud.client import Zep
 3from zep_cloud.types import Message
 4
 5zep = Zep(api_key=os.environ["ZEP_API_KEY"])
 6zep.user.add(user_id="dana")
 7zep.thread.create(thread_id="dana-1", user_id="dana")
 8
 9zep.thread.add_messages(
10    "dana-1",
11    messages=[Message(role="user", name="Dana", content="I switched from Python to Go at work.")],
12)
13
14context = zep.thread.get_user_context(thread_id="dana-1")
15print(context.context)  # prompt-ready block, built in the background

Ingestion is asynchronous, so new facts can take a moment to appear.

How Mem0 handles memory

Mem0 is simpler. Your code calls add with messages and a user_id. One LLM call extracts facts like “Dana uses Go at work.” Mem0 embeds them, links their entities, and stores them.

Since the April 2026 algorithm, Mem0 doesn’t update or delete during extraction. “Dana switched from Python to Go” is stored as a new fact next to any older “Dana uses Python” memory, and time-aware retrieval is meant to rank the current one first. You correct memories explicitly with update and delete.

1from mem0 import Memory
2
3memory = Memory()  # OpenAI + local Qdrant defaults
4memory.add("I switched from Python to Go at work.", user_id="dana")
5
6hits = memory.search("what language does Dana use?", filters={"user_id": "dana"}, top_k=5)
7for h in hits["results"]:
8    print(h["memory"], h["score"])

The graph difference matters. Mem0’s migration guide says graph memory “is removed from the open-source SDK.” The Platform has a built-in entity graph that boosts ranking, but it doesn’t track validity windows the way Zep does.

Open source and self-hosting

This is where the two diverge most.

Mem0 you can run yourself completely: the library, or the Docker server with Postgres and pgvector, a dashboard and API keys. You supply the LLM and embedder.

Zep you can’t, unless you buy Enterprise. Zep stopped maintaining Community Edition in April 2025; the code sits unsupported in the legacy/ folder of getzep/zep. Bring Your Own Cloud deployment is an Enterprise feature on the Zep pricing page. The open-source path is Graphiti: the same temporal graph engine, but you run Neo4j, FalkorDB or Neptune and build users, threads and context assembly yourself. Our Zep Docker guide covers what self-hosting looks like now.

Pricing

Zep CloudMem0 PlatformHindsight
Free10,000 credits/month10,000 adds and 1,000 retrievals/monthOpen source free to self-host; Cloud starts with free credits
Entry paidFlex: $125/month, 50,000 creditsFree with your own LLM key: 50,000 adds and 10,000 retrievals; usage-based past thatCloud: usage-based, no seat fee
Next tierFlex Plus: $375/month, 200,000 creditsCustom plans (sales-led), graph memory and DreamNo feature tiers; graph and temporal recall are in the MIT release
Billing unit1 credit per 350 bytes ingested; retrieval unmeteredRequests: adds and retrievals counted separatelyUsage-based (Cloud); self-hosted costs your LLM calls
EnterpriseCustom; BYOC, BYOK, SLACustom; on-prem, SSO, SLASelf-host anywhere (Docker, Helm)

Zep bills on ingestion; searches are free. Mem0 bills on requests, and retrievals are the tighter limit on the lower tiers. Which is cheaper depends on whether your app writes a lot and reads a little, or the reverse. Self-hosting Mem0 or Hindsight swaps those bills for your own LLM calls; Hindsight’s writes cost more than Mem0’s, because retain and consolidation both call an LLM.

Benchmarks and the LoCoMo dispute

The two companies have argued publicly over numbers.

  • Mem0’s 2025 paper scored Zep at 65.99% on LoCoMo (LLM-as-judge), below Mem0 at 66.88% and Mem0g at 68.44%. It also measured Zep’s graph at over 600,000 tokens per conversation.
  • Zep replied in May 2025 that Mem0 had set Zep up wrong: both speakers mapped to one user, timestamps pasted into message text instead of created_at, and searches run sequentially. Zep reported 75.14% for itself in its rebuttal.
  • Zep’s own paper reports 94.8% on DMR and up to 18.5% higher accuracy on LongMemEval than baselines.
  • Mem0 now reports 92.5 on LoCoMo and 94.4 on LongMemEval for its April 2026 algorithm, measured on its managed platform.
  • Mem0’s own Mem0 vs Hindsight page lists Hindsight at 94.6 on LongMemEval and 92 on LoCoMo, and ahead of Mem0 on BEAM: 73.9 vs 64.1 at 1M tokens and 64.1 vs 48.6 at 10M. The same page measures Hindsight returning 24K-44K tokens per retrieval against Mem0’s under 7K. Hindsight’s benchmark site reports the same scores.

Every figure here is vendor-run, with different models, judges and settings. The Mem0 paper breakdown and LLM memory evaluation explain why these numbers don’t line up.

Where Hindsight fits

Hindsight sits between the two designs. Like Zep, it extracts entities, relationships and time data and can search by time range, so “what changed in June?” works. Like Mem0, you can run all of it yourself, and unlike either, the open-source release includes graph, temporal recall, consolidation and reflect with no paid tier.

It’s the strongest pick when:

  • Histories are long. Its BEAM 1M and 10M leads over Mem0 (+9.8 and +15.5 points, from Mem0’s own page) are its biggest advantage in any published head-to-head.
  • You left Zep for self-hosting. Zep’s Community Edition is deprecated; Hindsight is a full memory server on PostgreSQL, so you don’t operate Neo4j or build users and context assembly the way you would with Graphiti.
  • The agent should learn, not just recall. Observations merge related facts into evidence-backed beliefs that get refined as facts change, and mental models keep standing answers up to date in the background.
  • You build coding agents or use a framework. It ships plugins for Claude Code, Codex, Cursor and Copilot, an MCP server, and integrations for LangGraph, CrewAI and the OpenAI Agents SDK.

The limits: it returns about 4x more context per retrieval than Mem0 by Mem0’s measurement, so set max_tokens lower if prompt size matters. It doesn’t store Zep-style validity windows on each fact. And its README says it “may be overkill” for simple n8n-style flows. More in Mem0 vs Hindsight.

Zep, Mem0 or Hindsight: how to choose

If you need…Pick
To know which version of a fact is current, with historyZep (or Graphiti)
Customer or account context built from business data plus chatZep
A fully self-hosted, open-source memory serverMem0
Open-source temporal graph and you can run a graph DBGraphiti
Simple per-user preference memory with a small APIMem0
Low entry price for a hosted serviceMem0
Retrieval cost that doesn’t grow with query volumeZep
Long histories (hundreds of thousands to millions of tokens per user)Hindsight
Graph and time-aware recall, fully self-hosted, no graph DBHindsight
An agent that reasons over its memories, not only retrieves themHindsight (reflect)
The fewest tokens per retrievalMem0

If facts in your domain change often (addresses, plans, account status), Zep’s validity windows are the stronger model; see temporal reasoning in AI memory. If you mostly store stable preferences and want to own the stack, Mem0 is the easier fit. If histories run long or you want every feature self-hosted, start with Hindsight. Other options, including Letta and Cognee, are compared in Zep alternatives and Mem0 alternatives. Vectorize also publishes a Mem0 vs Zep comparison.