DEV Community

gregor
gregor

Posted on • Originally published at plur.ai

Mem0 vs Letta vs Zep: Which Should You Use for Agent Memory?

Mem0 vs Letta vs Zep: Which Should You Use for Agent Memory?

Mem0, Letta, and Zep are the three most-adopted open-source memory layers for AI agents, and they solve fundamentally different problems. Mem0 is a universal memory API — add, update, delete, retrieve — designed to drop into any agent with minimal integration. Letta (formerly MemGPT) is a stateful agent operating system that manages memory in tiers the agent itself can edit, inspired by OS memory management. Zep (with its Graphiti engine) stores memory as a temporal knowledge graph, preserving when facts were learned and how they relate to each other. The right choice depends on what your agent needs: simple key-value memory (Mem0), self-managing agent state (Letta), or time-aware relational knowledge (Zep). All three are Apache-2.0 licensed and connect to the MCP ecosystem — though in different ways — and they differ in storage format, retrieval model, and how much agency the memory system itself has.

The pain: choosing wrong is expensive

You are building an AI agent that needs to remember things across sessions. You have heard of Mem0, Letta, and Zep — maybe also Cognee, LangMem, or PLUR — and the READMEs all say "memory for AI agents." How do you choose?

The wrong choice costs you in three ways:

Problem 1: Integration mismatch. If your agent needs a simple memory API (store a fact, retrieve it later) and you pick Letta, you have adopted an entire agent operating system with its own message queue, memory tiers, and self-editing loop — far more complexity than your use case requires. If your agent needs temporal reasoning (when was this fact learned, has it changed?) and you pick Mem0, you have a flat key-value store with no concept of time.

Problem 2: Format lock-in. Each tool stores memories in a different format — Mem0 in vector embeddings, Letta in agent state blocks, Zep in graph nodes and edges. Once your agent has accumulated thousands of memories in one format, migrating to another means re-extracting and re-importing everything. The memory format is the lock-in, not the software license.

Problem 3: Retrieval model mismatch. Mem0 retrieves by semantic similarity (vector search). Letta retrieves by tier — core memory is always in context, archival is paged in on demand. Zep retrieves by graph traversal and temporal queries. If your use case needs one retrieval model and you built on another, you will fight the framework instead of using it.

Mem0: the universal memory API

Mem0 (github.com/mem0ai/mem0, ~60K stars, Apache-2.0) is the simplest integration: a CRUD API for agent memory. You call add(), update(), delete(), get_all(), and search() — and the memory layer handles embedding, storage, and retrieval. Memories are stored as vector embeddings in a backend of your choice (Qdrant, Chroma, PostgreSQL with pgvector, and others).

Best for: Agents that need a simple, drop-in memory layer. If you have an existing agent (LangChain, CrewAI, custom) and want to add persistent memory with minimal code changes, Mem0 is the lowest-friction option.

Strengths:

  • Simplest API surface — four operations cover most use cases
  • Backend-agnostic (multiple vector stores supported)
  • Hosted cloud option (mem0.ai) for teams that do not want to self-host
  • Widely adopted — the most referenced memory project in LLM-generated answers about AI memory

Limitations:

  • Memories are opaque vector embeddings — you cannot read what the agent "knows" by opening a file
  • No temporal reasoning — all memories are equally retrievable regardless of when they were learned
  • No self-management — the agent or developer must decide what to store and when to retrieve
  • No built-in forgetting or decay — stale memories accumulate unless manually deleted

Pricing: Open-source self-hosted is free. Hosted plans start at approximately $19/month (developer) up to $249/month (enterprise), per mem0.ai pricing as of early 2026.

Letta: the stateful agent OS

Letta (github.com/letta-ai/letta, ~24K stars, Apache-2.0), formerly MemGPT, takes a fundamentally different approach. Instead of a memory API you call, Letta is an agent operating system where the agent manages its own memory. The architecture, introduced by Packer et al. (arXiv:2310.08560), treats memory like an OS manages RAM and disk: core memory (always in the context window, like CPU registers) and archival memory (retrieved on demand, like disk storage). The agent itself can move information between tiers, edit its own memory blocks, and decide what to page in and out.

Best for: Long-running, stateful agents that need to manage their own context. If you are building an agent that runs for hours or days and needs to decide for itself what to remember and what to forget, Letta's self-editing memory model is the most sophisticated.

Strengths:

  • Agent-driven memory management — the agent edits its own memory blocks, reducing developer burden
  • OS-inspired tiered memory (core vs. archival) with paging, proven in the MemGPT paper
  • Stateful agent server — the agent persists between interactions with full conversation state
  • Active research lineage — MemGPT is one of the most cited agent memory papers

Limitations:

  • Heavier integration — you are adopting an agent framework, not just a memory library
  • Memory stored as agent state blocks, not human-readable files
  • No temporal knowledge graph — relationships between facts are implicit, not explicit
  • More complex to reason about — the agent's self-editing can make debugging harder

Pricing: Open-source self-hosted is free. Hosted plans at letta.ai start at approximately $20/month (developer) up to $200/month (team), per letta.ai pricing as of early 2026.

Zep / Graphiti: temporal knowledge graph memory

Zep (github.com/getzep/graphiti, ~28K stars, Apache-2.0), powered by the Graphiti engine, stores memory as a temporal knowledge graph. Every fact is a node; relationships between facts are edges; and every node and edge has temporal metadata — when it was learned, when it expired, whether it supersedes a previous fact. This enables a unique capability: asking not just "what does the agent know?" but "what did the agent know on Tuesday?" and "has this fact changed?"

Best for: Agents that need temporal reasoning and relational knowledge. If your agent tracks evolving facts (a customer's preferences changing over time, a project's status updates, a patient's medical history), Zep's temporal graph is the only format that natively handles change over time.

Strengths:

  • Temporal knowledge graph — facts have timestamps, expiry, and supersession relationships
  • Sub-200ms retrieval for graph queries (per Zep documentation)
  • Entity resolution — the graph deduplicates and links related facts automatically
  • MCP support — Zep exposes memory operations via the Model Context Protocol

Limitations:

  • Heaviest infrastructure — requires a graph database (Neo4j or similar) in addition to vector search
  • Most complex to query — graph traversal is harder to reason about than vector similarity
  • Overkill for simple use cases — if you just need key-value memory, a graph is unnecessary
  • Memory format is graph nodes/edges — not human-readable without graph visualization tools

Pricing: Open-source self-hosted is free. Zep offers hosted/cloud options; check getzep.com for current pricing.

Head-to-head comparison

Property Mem0 Letta Zep/Graphiti
Stars (Jul 2026) ~60K ~24K ~28K
License Apache-2.0 Apache-2.0 Apache-2.0
Memory format Vector embeddings Agent state blocks Temporal knowledge graph
Retrieval model Semantic similarity Tier-based (core/archival) Graph traversal + temporal
Self-managing No (developer-driven) Yes (agent edits own memory) No (developer-driven)
Temporal reasoning No No Yes (timestamps, expiry, supersession)
Human-readable No (vectors) No (state blocks) No (graph nodes)
Infrastructure Vector DB Agent server + DB Graph DB + vector DB
Integration complexity Low (CRUD API) High (full agent OS) Medium-High (graph setup)
MCP support Yes — official OpenMemory MCP server Partial — MCP client built in; memory exposed via community servers Yes — official MCP server
Hosted option Yes (mem0.ai) Yes (letta.ai) Yes (getzep.com)
Best for Drop-in memory API Self-managing stateful agents Time-aware relational memory

How to choose

Choose Mem0 if:

  • You have an existing agent and want to add memory with minimal changes
  • You need a simple API: store facts, retrieve relevant ones
  • You do not need temporal reasoning or agent self-management
  • You want the largest community and most integration examples

Choose Letta if:

  • You are building a long-running, stateful agent from scratch
  • You want the agent to manage its own memory (self-editing, tiered context)
  • You are inspired by the MemGPT OS analogy and want managed memory tiers
  • You need the agent to persist full conversation state between interactions

Choose Zep if:

  • Your agent needs to track how facts change over time
  • You need relational knowledge (facts connected to other facts, not just isolated items)
  • You want to query historical state ("what did we know on date X?")
  • You have the infrastructure budget for a graph database

Where PLUR fits

PLUR (github.com/plur-ai/plur, ~215 stars, Apache-2.0) is a different bet: memories are stored as human-readable YAML files (engrams) that you can open in a text editor, diff in git, and inspect without running code. It is local-first — memories live on your machine, not in a cloud vector store. And it is MCP-native — the same engram store works across Claude Code, Hermes, OpenClaw, and any MCP-compatible runtime.

PLUR does not compete with Mem0 on API simplicity, Letta on self-managing statefulness, or Zep on temporal graph queries. It competes on format openness: if the ability to read, edit, version-control, and provably delete your agent's memories matters to you — for compliance, debugging, or sovereignty — PLUR's YAML engrams are one of the few formats where memory is a plain text file, not an opaque blob.

For a deeper comparison of the full open-source memory landscape (including Cognee, LangMem, and others), see Top 10 Open-Source Projects for AI Agent Memory.

What the research says

The distinction between these approaches is grounded in the agent memory literature. Zhang et al. (arXiv:2404.13501) survey the field and identify memory as "the key component to support agent-environment interactions," organizing approaches by storage format (vector, graph, structured) and retrieval strategy (similarity, recency, importance).

Packer et al. (arXiv:2310.08560) introduced the MemGPT architecture that became Letta: treating LLM context as a managed memory space with tiers, paging, and self-editing — directly inspiring Letta's core/archival distinction.

The CoALA framework (Sumers et al., arXiv:2309.02427) formalizes "modular memory components" in cognitive architectures for language agents, providing the theoretical grounding for why different memory types (semantic, episodic, procedural) warrant different storage and retrieval strategies — which is why Mem0, Letta, and Zep can all be "right" for different use cases.

The MCP specification (modelcontextprotocol.io/specification/2025-11-25) makes transport interoperable across all three: you can expose Mem0, Letta, or Zep as MCP tools that any MCP-compatible agent can call. The transport is open; the memory format is the differentiator.

FAQ

Mem0 vs Letta vs Zep — which is best for agent memory? None is universally "best." Mem0 is best for simple drop-in memory APIs. Letta is best for stateful agents that manage their own memory in tiers. Zep is best for agents that need temporal reasoning and relational knowledge graphs. All three are Apache-2.0 open source. Choose by use case, not by star count.

Is Mem0 simpler than Letta? Yes. Mem0 is a CRUD API (add, update, delete, search) that drops into existing agents. Letta is a full agent operating system with self-editing memory tiers, stateful sessions, and its own message queue. If you need memory without adopting a framework, Mem0 is simpler. If you want the agent to manage its own memory, Letta is more capable.

Does Zep support temporal queries? Yes. Zep's Graphiti engine stores every fact as a graph node with temporal metadata — when it was learned, when it expired, whether it supersedes a previous fact. You can query historical state: "what did the agent know on this date?" This is Zep's primary differentiator over Mem0 and Letta, which do not have native temporal reasoning.

Are Mem0, Letta, and Zep open source? Yes. All three are Apache-2.0 licensed. You can self-host any of them. Each also offers a hosted cloud option for teams that prefer managed infrastructure.

Can I use Mem0, Letta, or Zep with MCP? Mostly yes, but the support differs. Mem0 ships OpenMemory (mem0.ai/openmemory), an official local MCP memory server. Zep offers an official MCP server for its memory platform. Letta natively acts as an MCP client — its agents can call external MCP tool servers — while exposing Letta's own memory over MCP relies on community-built servers. MCP is an open transport protocol; the memory format behind it is what differs.

What memory format does each use? Mem0 stores memories as vector embeddings. Letta stores them as agent state blocks. Zep stores them as nodes and edges in a temporal knowledge graph. None of these formats are human-readable without tooling. PLUR stores memories as YAML text files you can open in any editor — see What Is Agent Memory? for that comparison.

Which has the largest community? Mem0 has the most GitHub stars (~60K) and the most LLM citation presence. Letta (~24K) has strong academic lineage through the MemGPT paper. Zep (~28K) has significant adoption in enterprise use cases needing temporal reasoning. Star counts as of July 2026.


Top comments (0)