
Dump full chat history into the prompt and you pay for it in tokens, latency, and the context cap. A memory layer instead lets the agent ask “what do I already know that’s relevant?” and get back a compact block of facts. This guide covers what each tool is, exact free-tier numbers (from official pricing pages), runnable code, and a decision tree.
Quick Comparison: Mem0 vs Zep vs Letta
| Dimension | Mem0 | Zep (Graphiti) | Letta (MemGPT) |
|---|---|---|---|
| What it is | Drop-in memory layer | Context platform on a temporal graph | Full stateful-agent runtime |
| Core data model | Vector + graph memories | Temporal knowledge graph | Editable in-context memory blocks |
| License (self-host) | Apache 2.0 | Graphiti: Apache 2.0 | Apache 2.0 |
| GitHub stars | ~60.7k | Graphiti ~28.7k | ~23.8k |
| Hosted free tier | 10,000 adds + 1,000 retrievals/mo | 10,000 credits/mo, 2 projects | 3 managed agents, BYOK |
| Credit card to start | No | No | No |
| Framework integration | Yes — CrewAI, LangGraph, etc. | Yes — via SDK / MCP | Is the framework itself |
| Best at | Personalization, fast to ship | Facts that change over time | Long-running autonomous agents |
One-sentence version: reach for Mem0 to bolt memory onto an existing agent in an afternoon; Zep when the relationships between facts and how they evolve matter; Letta when memory is the foundation you build the whole agent on.
What “Agent Memory” Actually Means
Practical agent memory splits into three kinds:
- Short-term / working memory — the current conversation, already handled by your context window. Not what these tools are for.
- Long-term semantic memory — durable facts: “Alex prefers Python,” “the deploy target is Oracle Cloud.” The main event.
- Episodic memory — a record of past events: “last Tuesday we tried approach X and it failed.”
The hard part isn’t storing text — it’s extraction (what’s worth remembering from a noisy chat), consolidation (updating a fact when a newer one contradicts it), and retrieval (surfacing exactly the right facts without flooding the prompt). Each tool takes a distinct stance on those three.
Mem0: The Drop-In Memory Layer
Mem0 (pronounced “mem-zero”) is the most widely adopted of the three — 60k+ GitHub stars, Y Combinator backing. It adds a persistent, self-improving memory layer to any LLM app in about three lines, sitting beside your model rather than replacing your framework, so it plugs into CrewAI, LangGraph, and raw OpenAI-SDK code alike.
On add(), Mem0 runs an LLM pass to extract salient facts, then decides whether to add, update, merge, or delete — so stale facts get reconciled instead of piling up. On search(), it runs hybrid retrieval (semantic + BM25 keyword + entity matching) scoped to a user, session, or agent ID. An optional graph-memory mode also stores entities and their relationships.
Free tier and pricing
- Open-source (Apache 2.0) —
pip install mem0ai, bring your own vector store (Qdrant, Chroma, pgvector) and LLM key. No quota, no cost beyond infrastructure. The truly unlimited path. - Hosted Hobby tier — managed API, free: 10,000 memory-add requests and 1,000 retrieval requests per month, unlimited end users, 1 project, no credit card.
Paid ladder: Starter $19/mo (50k adds / 5k retrievals), Growth $79/mo (200k / 20k, 3 projects), Pro $249/mo (500k / 50k, unlimited projects, graph memory). Enterprise is usage-based.
# pip install mem0ai
from mem0 import Memory
m = Memory() # local: Qdrant + SQLite, your own LLM key via env
messages = [
{"role": "user", "content": "Hi, I'm Alex. I love basketball and I code in Python."},
{"role": "assistant", "content": "Got it, Alex — I'll remember that."},
]
m.add(messages, user_id="alex")
# Later, on a brand-new session, retrieve what's relevant
results = m.search("What are this user's hobbies?", filters={"user_id": "alex"})
for r in results["results"]:
print(r["memory"], "score:", r["score"])
Switching to hosted is a one-import change — from mem0 import MemoryClient, pass your API key, and the same add() / search() methods run against Mem0’s managed store.
Use Mem0 when: you have an existing agent and want personalization fast; you want one memory layer across multiple frameworks; you want to start hosted and later self-host without rewriting code. Pair with a free LLM key from Gemini or Groq for a $0 setup.
Zep: Memory That Understands Time
Zep’s premise: facts aren’t static, and a flat list of memories loses how they relate and when they changed. It’s built on Graphiti, its open-source (Apache-2.0, ~28.7k stars) temporal knowledge graph. Instead of storing “Alex uses Python,” Graphiti stores Alex and Python as nodes, “uses” as an edge, and stamps that edge with when it became true — and when it stopped.
Why this matters: a user says “I’m on Starter” in January, “I upgraded to Pro” in June. A vector store now holds two contradictory facts and retrieves either. Graphiti marks the Starter edge invalid as of June and answers both “what plan?” (Pro) and “when did they upgrade?” (June) — history preserved, not overwritten. That plus multi-hop traversal (“who on the account has admin rights?”) is what a flat vector store can’t do.
Free tier and pricing
Zep meters in credits: an episode (ingested chunk) up to 350 bytes = 1 credit, each additional 350 bytes = another credit; webhooks cost 1/8 credit.
- Free — $0: 10,000 credits/month (no rollover), 2 projects, 5 custom entity/edge types, lower-priority processing. No credit card.
- Flex — $125/mo: 50,000 credits/mo, 600 req/min, 5 projects, 30-day rollover, overage $25 per 10,000 credits.
- Flex Plus — $375/mo: 200,000 credits/mo, 1,000 req/min, 10 projects, observations, webhooks, analytics.
- Enterprise: custom credits, SLA, custom deployment.
Free-forever path: self-host Graphiti. The Apache-2.0 engine that powers Zep Cloud runs against a Neo4j or FalkorDB instance and your own LLM key — the temporal graph with no credit meter.
# pip install zep-cloud
from zep_cloud.client import Zep
client = Zep(api_key="YOUR_ZEP_KEY")
# Users and threads are first-class
client.user.add(user_id="alex", first_name="Alex", email="[email protected]")
client.thread.create(thread_id="session-1", user_id="alex")
# Ingest turns — Zep extracts facts into the graph asynchronously
client.thread.add_messages(
thread_id="session-1",
messages=[{"role": "user", "name": "Alex",
"content": "I just upgraded from Starter to the Pro plan."}],
)
# Before generating a reply, pull the context block for the graph
memory = client.thread.get_user_context(thread_id="session-1")
print(memory.context) # ready-to-inject facts, temporally resolved
Use Zep when: your domain has facts that change over time (subscriptions, statuses, relationships); you need multi-hop reasoning over connected entities; you’re building support, CRM, or healthcare agents where “what was true when” is a real question.
Letta (formerly MemGPT): Memory as the Whole Agent
Letta grew out of the MemGPT research paper, which treated the LLM like an operating system paging information in and out of a limited context window. It’s not a library you bolt on; it’s a stateful-agent runtime where memory is the agent. Every Letta agent runs on a server, persists its entire state to a database, and can resume weeks later exactly where it left off.
Its core concept is the memory block: a labeled, editable string pinned into the system prompt (e.g. a persona block and a human block). Crucially, the agent has tools to rewrite its own memory blocks — learn something durable, call a memory-edit tool, the change persists. Overflow moves to an external archival store the agent can search on demand. That’s the “LLM operating system” model.
Free tier and pricing
- Self-hosted (Apache 2.0):
docker runthe open-source server, bring your own model (including local Ollama), pay only infrastructure + LLM. No login. The unlimited path. - Letta Cloud, Free: up to 3 managed stateful agents, bring-your-own-key, limited Letta Auto usage, no credit card.
- Pro — $20/mo: up to 20 agents, weekly + monthly Letta Auto quota, pay-as-you-go overage.
- API / Developer — $20/mo base: unlimited agents at $0.10 per active agent/mo plus $0.00015/second of tool execution.
# pip install letta-client (or self-host the server, then point the client at it)
from letta_client import Letta
client = Letta(token="YOUR_LETTA_KEY") # or Letta(base_url="http://localhost:8283")
agent = client.agents.create(
model="openai/gpt-4o-mini",
embedding="openai/text-embedding-3-small",
memory_blocks=[
{"label": "persona", "value": "You are a helpful coding assistant."},
{"label": "human", "value": "Name: Alex. Prefers Python."},
],
)
# The agent persists — send a message now, resume the same agent next week
response = client.agents.messages.create(
agent_id=agent.id,
messages=[{"role": "user", "content": "What language do I prefer?"}],
)
for msg in response.messages:
print(msg)
Use Letta when: you’re building a long-running autonomous agent from scratch; you want the agent to manage its own memory; you need agents that persist and resume across sessions as first-class server objects.
The Dimensions That Actually Matter
Architecture & retrieval. Mem0 is vector-first with optional graph (hybrid semantic + keyword). Zep is graph-first (semantic + full-text + graph traversal, respecting time). Letta is context-first — memory lives in the prompt as editable blocks, archival search as overflow. “Smart cache of facts” → Mem0; “database of evolving relationships” → Zep; “agent that curates its own notes” → Letta.
Time and contradiction handling. Zep’s clearest win: Graphiti’s bi-temporal model invalidates old edges and keeps history queryable. Mem0 reconciles contradictions but doesn’t preserve a queryable timeline. Letta’s temporal correctness is only as good as the agent’s own bookkeeping.
Speed to ship. Mem0 wins — two methods (add, search) and it drops into an existing agent framework without restructuring. Zep adds users/threads and an async ingestion delay. Letta asks you to adopt its whole runtime — biggest commitment, biggest payoff if agents are your product.
The free ceiling. All three are Apache-2.0 at the core, so self-hosting makes all three free forever — you pay only for the box and LLM tokens. Hosted free tiers differ in shape: Mem0’s is sized for a real small app (10k adds/mo), Zep’s 10k credits go fast on chatty conversations, and Letta’s caps agents (3) rather than volume.
Free-Tier Math: How Far Does Each Go?
Rough estimate for a personal assistant handling ~30 turns/day:
- Mem0 Hobby: if ~half your turns produce an add, ~15/day ≈ 450/month — well inside 10,000. Retrievals are the tighter limit at 1,000/month (~33/day), so search on meaningful turns.
- Zep Free: 10,000 credits ≈ 10,000 small episodes/month (~330/day) — fine for one active user, tight for a multi-user demo. Longer messages burn multiple credits each.
- Letta Free: volume is unmetered on your own key; the constraint is 3 agents. Perfect for a single assistant, limiting if you spin up an agent per user.
Takeaway: for anything beyond a single-user prototype, plan to self-host the open-source core — the actual “free forever” answer for all three.
Which One Should You Use? A Decision Tree
- Existing agent, want memory today → Mem0. Three lines, framework-agnostic, hosted free tier.
- Facts change over time and history matters (subscriptions, statuses, org charts, medical/CRM data) → Zep / Graphiti. The only one that answers “what was true when.”
- Long-running autonomous agent as the product → Letta. Memory-as-the-agent, persistent and resumable.
- Zero cost at any scale → self-host the Apache-2.0 core of whichever fits, on a free VPS with a free LLM key.
- Personalization in a hobby chatbot → Mem0 open-source, local Qdrant, done in an afternoon.
A memory layer is one slot in a complete $0 agent: a framework like CrewAI or LangGraph for orchestration, an MCP server for tools, a free search API, a free LLM key — plus Langfuse for observability to see what the agent recalled and why. Mem0, Zep, and Letta all snap in without a credit card.
FAQ
Is Mem0 really free?
Yes, two ways. The open-source SDK (Apache 2.0) is unlimited — run it against your own vector store and LLM key. The hosted platform has a free Hobby tier with 10,000 memory adds and 1,000 retrievals per month, no credit card.
What is the difference between Zep and Graphiti?
Graphiti is the open-source (Apache-2.0) temporal knowledge-graph engine. Zep Cloud is the managed product built on top of it, adding a hosted API, users/threads abstractions, a dashboard, and SLAs. Self-hosting Graphiti gives you the core engine for free.
Is Letta the same as MemGPT?
Yes. Letta is the renamed, productized continuation of the MemGPT research project. The company kept the open-source server (Apache 2.0) and added Letta Cloud on top.
Can I use these with local models instead of OpenAI?
All three support bring-your-own-model. Mem0 and Letta work with local Ollama models out of the box; Graphiti needs an LLM for fact extraction and accepts any OpenAI-compatible endpoint, so a local or free-tier API works.
The Bottom Line
Agent memory became infrastructure in 2026, and you no longer have to build it yourself. Mem0 is the fastest way to make any agent remember — start there if unsure. Zep is the answer the moment time and relationships between facts matter. Letta is where you go when the agent’s memory is the product. All three are Apache-2.0 at the core, so the ceiling on all of them is genuinely free.
Related Reads
- CrewAI vs AutoGPT vs LangGraph: Which Free Agent Framework Should You Use in 2026?
- CrewAI: Free Open-Source Multi-Agent AI Framework for Python
- MCP (Model Context Protocol): Connect AI Agents to Any Tool or API
- Langfuse: Free Open-Source LLM Observability
- Cline: Free Open-Source AI Coding Agent for VS Code (Cursor Alternative)