Memory for agents that forget

Mem0 is a memory layer you add to an AI agent so it remembers across conversations. Instead of re-sending the whole history every turn, Mem0 extracts the durable facts (a user’s preferences, names, decisions), stores them, and retrieves the relevant ones when they matter. That cuts token cost and makes an assistant feel like it actually knows you. It is agent-agnostic: a thin layer you call, not a framework that dictates how your agent is built. At 58,664 stars as of 2026-06, it is one of the most popular memory solutions for LLM apps.

The design separates extraction (what is worth remembering), storage (in a vector store), and retrieval (multi-signal, blending semantic search with keyword and entity cues).

What it does

You call add to record a conversation turn and search to pull relevant memories before a response. Memories are scoped to a user, a session, or an agent, so you can keep per-user facts separate from per-session context. Under the hood it uses an LLM to extract facts and a vector store to index them, and the retrieval combines signals rather than relying on raw semantic similarity alone, which is what makes recall more precise than a flat RAG collection.

Install

pip install mem0ai

There is also an npm package. You configure an LLM (OpenAI by default, many others supported through providers) and a vector store (Qdrant by default, with Pinecone, Weaviate, pgvector, and others available). For a team deployment, the self-hosted OpenMemory server runs via Docker with a dashboard and API keys.

Open-source library versus the managed platform

Settle this before you design around it. Mem0 ships as an Apache-2.0 open-source library and self-hosted server, and as a separate managed Mem0 Platform (SaaS). The open-source side gives you the core add/search memory with your own LLM and vector store. The hosted platform adds managed retrieval, scaling, and analytics that you would otherwise operate yourself. The license on the code is genuinely permissive, so you can build commercially on the library; just know that some of the smoothest, scale-ready features live on the paid platform, and read where that boundary falls for your use case.

Where it fits, and where it doesn’t

Mem0 is a strong fit when you want to bolt long-term memory onto an existing agent without adopting a whole framework, when per-user personalization matters, or when you want to cut the token cost of resending history. The agent-agnostic design means it drops into most stacks.

Where it gets harder: you own the vector-store and LLM-provider setup, and the issue tracker shows that integration (embedding dimensions, provider quirks, batch behavior) is where the real friction lives. Retrieval quality depends on tuning, and some failure modes are silent, so verify that memories are actually stored and recalled. If you want a full stateful-agent framework rather than a memory layer, Letta is the closer fit.

mem0 versus the alternatives

Mem0Lettaraw RAG over a vector store
Stars58,66423,354n/a
Shapeagent-agnostic memory layerstateful-agent frameworkdocument retrieval
Memory modeluser, session, agent scopescore plus archival memoryone flat collection
Retrievalmulti-signal (semantic, keyword, entity)core context plus archivalsemantic only
Managed optionMem0 PlatformLetta Cloudyour vector DB vendor

Counts are from GitHub as of June 2026. Letta is a full stateful-agent framework with memory built in, a heavier commitment than a memory layer. Raw RAG over a vector store retrieves documents but has no notion of agent state or scoped memory. Mem0’s niche is being the thin, drop-in memory layer between those.

The star curve

The star curve rose fast as agent builders hit the same wall at once, that LLMs forget everything between sessions, and Mem0 offered a clean answer. The continued daily commits and a v3 retrieval algorithm show active development rather than a one-time spike.

What the issue tracker warns you about

The recurring friction is integration, not concept. Embedding-dimension mismatches with vector stores are common, and some providers need extra configuration to work correctly. A few failure modes are silent: a partial embedding failure or a truncated extraction can drop memories without an error, so add checks that what you expect to store is actually stored. Provider quirks across the many supported LLMs leak through. And the self-hosted versus platform feature gap is underdocumented, so confirm a feature is in the open-source path before relying on it.

For a full stateful-agent framework, see Letta. For the document-parsing side of RAG, see docling and unstructured. For the agents you would add memory to, see cline and OpenHands. For what is trending, see LLM tooling, the daily digest, and the weekly report.

FAQ

Mem0 vs Letta, which should I use? Mem0 is a memory layer you add to any agent without changing your architecture. Letta is a full stateful-agent framework with memory built in. Choose Mem0 to add memory to an existing stack, Letta if you want the framework to own the agent lifecycle.

Is Mem0 free? The library and self-hosted OpenMemory server are Apache-2.0 and free, so you can build commercially on them. There is also a paid Mem0 Platform that adds managed retrieval, scaling, and analytics. Check which features are open-source versus platform-only.

Does Mem0 need a vector store? Yes. It stores memories in a vector store, with Qdrant as the default and Pinecone, Weaviate, pgvector, and others supported. You also configure an LLM provider for fact extraction.

How does Mem0 retrieve memories? It combines signals rather than using semantic similarity alone, blending vector search with keyword and entity cues, which makes recall more precise than a flat RAG collection. Retrieval quality still depends on your setup and tuning.

Can Mem0 run locally? Yes. With a local LLM (via Ollama, for example) and a local vector store, you can run the open-source library and self-hosted server without a cloud dependency, though some hosted-platform features are not available that way.