Mem0 vs Letta: Memory Layer or Stateful Agent?

9 min read

Mem0 vs Letta (MemGPT) compared in 2026: memory model, who decides what to store, Python support, self-hosting, pricing, and which one fits your agent.

Mem0 vs Letta comes down to one question: do you want a memory service for an agent you already have, or a runtime where the agent manages its own memory? Mem0 is a memory layer your code calls with add and search. Letta (formerly MemGPT) is a stateful agent harness whose agents read, edit and consolidate their own memory files.

The two are often listed side by side, but they sit at different levels of the stack. A third option, Hindsight, sits between them: a memory layer like Mem0 that you call from any agent, but one that consolidates and reasons over memories in the background, the way Letta’s agents do, all under MIT. This page compares them on memory model, control, language support, hosting and cost, using each project’s README, docs and pricing page as of 12 October 2026.

What are Mem0 and Letta?

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 the relevant ones on search. Letta is an Apache 2.0 harness for stateful agents, grown from the MemGPT research, where each agent keeps editable memory files, searchable message history and background consolidation.

Mem0 runs as a Python or Node library, a self-hosted Docker server, or the hosted Mem0 Platform. It doesn’t run your agent. It answers “what should this agent know about this user right now?”

Letta in 2026 means Letta Code: a CLI, desktop app, App Server and TypeScript Agent SDK, with optional Letta Cloud hosting. The old Python API server (letta-ai/letta) is retired; its README points to letta-code and keeps the V1 server on an archive branch. Our Letta guide covers that history.

Mem0 vs Letta at a glance

Mem0LettaHindsight
What it isMemory layer (library, server, hosted API)Stateful agent harness (CLI, desktop, App Server, cloud)Memory server (self-hosted or Hindsight Cloud)
LicenseApache 2.0Apache 2.0MIT, full server included
Who decides what to rememberYour code calls add; an LLM extracts factsThe agent itself, plus background “dreaming”Your code or an integration calls retain; an LLM extracts facts, then background consolidation
Memory formatShort extracted facts with embeddings and entitiesMarkdown memory files in a git-backed store (MemFS), plus message historyFacts, experiences, observations, mental models in PostgreSQL
Portable to the others?Export via API; MacPaw’s .mem tool has a Mem0 adapter.af Agent File, Letta-to-LettaTransfer ZIP, Hindsight-to-Hindsight; see agent memory formats
RetrievalSemantic + BM25 + entity matching, fusedFiles in context; agent-driven message searchSemantic + BM25 + graph + temporal, fused and reranked; reflect for reasoned answers
UpdatesADD-only since April 2026; explicit update/deleteAgent rewrites files; every edit is a git commitObservations refined as new evidence arrives, not overwritten
SDKsPython, TypeScript, REST, CLITypeScript Agent SDK; Python client deprecatedPython, TypeScript, Go, REST, CLI
Self-hostLibrary, or Docker server with Postgres + pgvectorLocal backend or letta serverDocker, pip, Helm or embedded Postgres; every feature included
Hosted pricingFree (own LLM key after 30 days); Custom plansFree; Pro $20/mo; API plan $20/mo + usageUsage-based, free credits, no seat fee
FitsAdding memory to an existing agent or appBuilding a long-lived agent from scratchAdding memory that learns to an existing agent

Prices are list prices from mem0.ai/pricing and Letta’s pricing page. Hindsight details are from its README.

How memory works in Mem0

Mem0 is application-driven. After an exchange, your code sends the messages to add. An LLM pulls out durable facts such as “Dana prefers short answers” in a single pass. Mem0 embeds them, links their entities, and stores them under the IDs you passed.

Before the next model call, your code runs search with a query and a filter like {"user_id": "dana"}. Mem0 ranks memories by semantic similarity, keyword match and entity overlap, and you put the top results into the prompt.

Since the April 2026 release, extraction is ADD-only: Mem0 never rewrites or deletes on its own. A changed fact is stored next to the old one, and you call update or delete when you need a correction. The same release removed graph memory from the open-source SDK, per Mem0’s migration guide; graph memory and temporal reasoning are now hosted Platform features.

 1from mem0 import Memory
 2
 3memory = Memory()  # OpenAI + local Qdrant defaults; needs OPENAI_API_KEY
 4
 5memory.add(
 6    [
 7        {"role": "user", "content": "Keep answers short, I read on my phone."},
 8        {"role": "assistant", "content": "Got it, short answers from now on."},
 9    ],
10    user_id="dana",
11)
12
13hits = memory.search("how should I format replies?", filters={"user_id": "dana"}, top_k=3)
14context = "\n".join(h["memory"] for h in hits["results"])

The agent never sees Mem0 directly. It gets whatever your code injects.

How memory works in Letta

Letta is agent-driven, following the MemGPT paper idea of an LLM that pages its own memory in and out like an operating system.

  • Memory files (MemFS). Each memory is a Markdown file with front matter in a git-backed filesystem. Root-level files load into the system prompt every turn. Deeper folders stay out of context until the agent opens them. Every edit is a commit, so you get history and can sync memory to your own repo.
  • Message search. The agent can search its full conversation history. On Letta Cloud this supports full-text, vector and hybrid search; local backends use full-text only.
  • Dreaming. Background subagents review recent conversations, consolidate lessons and update memory, triggered after a set number of steps or on context compaction.
  • Skills. Agents save reusable instruction files and refine them over time.

In the classic Letta API these were memory blocks (core memory) and archival memory (a vector store of passages). The blocks still exist in the REST API, but new work centers on Letta Code.

The result is memory you can open in a text editor and diff. The tradeoff is that the agent, and the model behind it, decides what’s worth keeping.

Language support and integration

This is often the deciding factor.

Mem0 fits into almost anything. It has Python and TypeScript SDKs, a REST API, a CLI, and documented integrations with LangGraph, CrewAI, AutoGen, the OpenAI Agents SDK, Google ADK, Mastra and the Vercel AI SDK. You keep your framework and add memory calls.

Letta wants to be the framework. Its FAQ says the Agent SDK is “currently available only for TypeScript.” The Python letta-client package still talks to the REST API, but its docs page calls it deprecated with no new features. For Python, Letta suggests running the App Server and using its WebSocket protocol. The open-source Docker image is “no longer supported as a backend for Letta Code.”

Self-hosting and cost

Mem0 open source costs nothing beyond your LLM, embedder and vector store. Every add makes one extraction LLM call, so cost scales with message volume. The self-hosted server bundles Postgres with pgvector, a dashboard and per-user API keys. Since 26 October 2026 the hosted Platform’s Free plan allows 10,000 adds and 1,000 retrievals a month for 30 days, then 50,000 and 10,000 once you connect your own LLM key, which pays for extraction; higher limits are on sales-led Custom plans.

Letta Code is free to run locally with your own model keys; your agent state and MemFS stay on disk, and you’re responsible for backups. Hosted plans start at Free, then Pro at $20/month. The API plan is $20/month plus $0.10 per active agent per month and $0.00015 per second of tool execution.

The cost profiles differ. With Mem0 you pay per extraction and per search on top of your agent’s own model calls. With Letta, memory work happens inside the agent’s turns and dreaming runs, so it shows up as more agent tokens.

Benchmarks: what’s comparable

There’s no clean head-to-head. Mem0 reports 92.5 on LoCoMo and 94.4 on LongMemEval for its April 2026 algorithm, run on its managed platform. Letta publishes no memory benchmark scores in its README.

The one direct comparison is Letta’s August 2025 filesystem experiment: an agent with plain file tools reached 74.0% on LoCoMo with GPT-4o-mini, above the 68.5% that Mem0’s 2025 paper reported for its best graph variant. That compared against Mem0’s older algorithm and was run by Letta. See the Mem0 paper breakdown for the full context.

Hindsight reports 94.6 on LongMemEval and 92 on LoCoMo, and on the long-history BEAM test leads Mem0 73.9 to 64.1 at 1M tokens and 64.1 to 48.6 at 10M. Mem0’s own Hindsight comparison lists the same scores, and notes that Mem0 returns about 4x fewer tokens per retrieval. All of these are vendor-run.

Where Hindsight fits

Hindsight is a memory layer, so it fits the same place as Mem0: next to an agent you already have. It’s the stronger pick when:

  • You want Letta-style learning without adopting Letta. Background consolidation turns facts into observations, evidence-backed beliefs refined over time, and mental models keep standing answers up to date. Your agent stays in LangGraph, CrewAI or your own code.
  • Histories are long. Its biggest lead over Mem0 is on BEAM 1M and 10M (+9.8 and +15.5 points).
  • You want graph and temporal recall in open source. Mem0 moved graph memory to its Platform; Hindsight ships graph, temporal recall, consolidation and reflect in the MIT release.
  • You’re on Python. It has Python, TypeScript and Go clients, plus integrations for LangGraph, CrewAI, Pydantic AI and the OpenAI Agents SDK.

Its limits: writes cost more than Mem0’s single pass, since retain and consolidation both call an LLM, and it returns more context per retrieval (about 4x Mem0’s, by Mem0’s numbers; max_tokens is yours to set). Memory lives in a database, not in files you can diff like Letta’s MemFS. More in Mem0 vs Hindsight.

Mem0, Letta or Hindsight: how to choose

If you…Pick
Already have an agent in LangGraph, CrewAI or custom PythonMem0
Need per-user preference memory in a chat or support appMem0
Want memory as a service with a dashboard and API keysMem0
Are building a long-lived assistant or coding agent from scratchLetta
Want the agent to edit its own memory and skillsLetta
Want memory as readable, git-versioned filesLetta
Want consolidation and reasoning over memory, without switching agent runtimeHindsight
Have long histories (hundreds of thousands to millions of tokens per user)Hindsight
Need graph memory in open sourceHindsight; also Graphiti or Cognee
Want the smallest token cost per retrievalMem0

Other memory layers take different positions: Zep and Graphiti track facts over time, and Cognee builds knowledge graphs from documents. The Mem0 alternatives and Letta alternatives pages compare them, and Vectorize has its own Mem0 vs Letta write-up. For the concepts, see AI agent memory explained.