Model or dataset
mem0ai/mem0 avatar
mem0ai/mem0

Mem0: A Memory Layer for AI Agents, Reviewed for Self-Hosting and SDK Users

Mem0 stores and retrieves user, session, and agent memories so AI applications can carry preferences and context across conversations.

66,317 stars7,809 forksTypeScriptApache-2.0

At a glance

What is it?
Mem0 stores user, session and agent memories so assistants keep context across conversations. This review covers how its extraction and retrieval pipeline works, how to install the library or the self-hosted server, and where the trade-offs sit.
Who is it for?
Adopt Mem0 if you are building an assistant that needs to carry preferences and past context between sessions and you want the retrieval logic handled for you, either through the library or the self-hosted server. Do not adopt it if you cannot accept an extra LLM call on every write, or if you need strict overwrite semantics, because the current extraction algorithm is ADD-only and memories accumulate rather than being replaced.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What Mem0 Actually Solves for Agent Builders

A chat application that keeps a raw transcript and replays it into the prompt gets expensive fast, and the model still has to re-derive that a user prefers dark mode from a paragraph of small talk. Mem0 addresses that gap: it extracts durable facts from conversation turns, stores them, and returns the relevant ones at query time. The README frames the target audience directly, listing customer support chatbots, AI assistants and autonomous systems, with healthcare and productivity named as application areas.

The scope is deliberately narrower than a general vector database. Mem0 ships its own extraction and retrieval pipeline on top of a store, and exposes it through a Python package (mem0ai), a TypeScript package (mem0ai on npm), a CLI (@mem0/cli or mem0-cli), and a server you can run yourself. The repository is primarily TypeScript, with the Python SDK published from pyproject.toml as version 2.0.20 and the latest Python release noted as v2.0.19.

What makes the project worth a look rather than a weekend script is the separation it draws between three memory levels: user, session and agent state. That distinction matters in practice. A session memory should die with the conversation; a user preference should not. If your application already conflates those, Mem0 is asking you to separate them, and that is the main design decision it imposes on you.

Inside the Retrieval Pipeline: ADD-Only Extraction and Multi-Signal Search

The April 2026 algorithm change is the most consequential thing in the README, and it is worth reading carefully because it changes how you reason about stored data. Extraction is now single-pass and ADD-only: one LLM call, with no UPDATE or DELETE step. Memories accumulate. Nothing is overwritten. The project's own benchmark table claims 92.5 on LoCoMo (up from 71.4) and 94.4 on LongMemEval (up from 67.8), at roughly 7K tokens and around one second p50 latency per query.

Those numbers come from the managed platform, and the README says so plainly: the scores include proprietary optimizations not available in the open-source SDK, and open-source users should expect directionally similar gains but not identical numbers. That caveat is doing real work. Treat the table as evidence that the retrieval design improved, not as a promise about your deployment.

Retrieval itself fuses several signals. Semantic similarity, BM25 keyword matching and entity matching are scored in parallel and combined. Entity linking extracts entities, embeds them, and links them across memories to boost retrieval. A temporal layer ranks the right dated instance for questions about current state, past events and upcoming plans. The BM25 and entity paths are not in the base install: pyproject.toml puts spacy under the nlp optional dependency, and the README pairs it with a manual model download.

ADD-only is a trade-off, not a free win. It removes a class of destructive errors where a bad UPDATE wipes a good memory, and it makes writes cheaper to reason about. In exchange, contradictions are not resolved at write time, so a user who changes their mind leaves both statements in the store and the ranking layer has to sort it out.

Installing Mem0 and Running a First Memory

The library path is the shortest route to a working memory. The README gives this install command, and the NLP extra is separate because it pulls in spacy:

bash
pip install mem0ai
pip install mem0ai[nlp]
python -m spacy download en_core_web_sm

The base install is enough to store and search memories. Adding the nlp extra and the spacy model is what enables the hybrid path with BM25 keyword matching and entity extraction described above. If you skip it, expect semantic retrieval only.

For a quick check from the terminal, the CLI is published under two names depending on your ecosystem, and the README's example uses a user id to scope the memory:

bash
npm install -g @mem0/cli
mem0 init
mem0 add "Prefers dark mode and vim keybindings" --user-id alice
mem0 search "What does Alice prefer?" --user-id alice

After the search you should see the preference you just added come back, scoped to alice. That scoping is the point: the same query without --user-id is a different question.

If you would rather run the server, the README recommends a single bootstrap command from the server directory. Note that self-hosted auth is on by default, which is a change from earlier builds:

bash
cd server && make bootstrap

The manual alternative starts the stack with docker compose up -d and serves on http://localhost:3000, where a browser wizard finishes setup. The README also lists ADMIN_API_KEY and AUTH_DISABLED=true as options, with AUTH_DISABLED explicitly labelled for local dev only. Do not carry that setting into anything reachable from a network.

Where Mem0 Is the Wrong Tool

The ADD-only extraction model is the first place to stop and think. If your application needs a memory that is corrected in place, for example a billing address that must have exactly one current value, Mem0's default behaviour is to accumulate rather than replace. The README does not document a rollback or a memory-level delete path in the excerpt available here, and the migration guide is referenced but not reproduced. Verify that before you design around it.

The second constraint is cost and latency on the write path. Extraction is an LLM call. Every memory write is a model invocation, and the benchmark table's token figures describe retrieval, not ingestion. An application that writes on every message pays per message. For a high-volume logging use case, a plain vector store with your own embeddings will be cheaper and simpler, because you are not asking anyone to decide what is worth remembering.

Third, the benchmark caveat cuts both ways. The headline numbers are from the managed platform. If you are evaluating Mem0 on self-hosted infrastructure, you are evaluating a different configuration than the one in the table, and the README says as much. Any comparison you run should be against the OSS SDK on your own store, not against the published figures.

Finally, the library and the platform are not feature-equivalent. The README's own comparison table lists advanced features as available on the Cloud Platform, with self-hosted showing teasers and the library showing none. If a capability is only in the platform, the open-source repository will not have it.

Mem0 Compared with a Plain Vector Store and LangChain Memory

The honest alternative is not another memory product. It is a vector database plus your own extraction prompt. With Qdrant, Chroma or pgvector you embed text and retrieve by cosine similarity. The difference in approach is where the intelligence sits. A plain store retrieves what is semantically close to the query. Mem0 additionally runs an extraction model to decide what is worth storing, links entities across memories, and fuses keyword, entity and semantic scores before ranking. That is more machinery, and it is the reason the project needs an LLM key at all.

LangChain's memory modules sit closer to the framework than to the store. They are convenient when your application is already built on LangChain chains and you want conversation buffers or summary memory attached to them. Mem0 is framework-agnostic and treats memory as a service with its own lifecycle, which is why it ships a server, a CLI and cross-platform SDKs rather than a chain component. The repository does list langchain, langchain-community and langchain-core under its extras dependencies, so the two are not mutually exclusive.

The practical test: if you can write the extraction prompt yourself in an afternoon and your retrieval needs are pure similarity, you do not need Mem0. If you want entity linking, temporal ranking and a fused retrieval score without building them, the project is doing work you would otherwise own.

Maintenance, Licence and Upgrade Cost

The repository is not archived, and the last push was on 2026-08-27. Recent releases include mem0-strands-v0.1.1 and deepseek-plugin-v0.1.1 on the same date, plus the Python SDK v2.0.19 on 2026-08-24, so integration work is ongoing across several surfaces rather than only the core package.

The licence is Apache-2.0, declared in pyproject.toml as license = "Apache-2.0" with license-files = ["LICENSE"]. That is a permissive licence with an explicit patent grant, and it is the same licence on the repository. It does not cover the managed platform, which is a separate commercial service. The README's benchmark caveat makes the boundary concrete: the platform includes optimizations not present in the open-source SDK. If you need the exact behaviour behind the published numbers, the licence on this repository will not give it to you.

Upgrade cost is concentrated in the algorithm transition. The README points to a migration guide at docs.mem0.ai/migration/oss-v2-to-v3 for moving from the old OSS v2 behaviour to the ADD-only v3 algorithm. That is a semantic change, not a version bump: code that assumed memories get updated will behave differently after the move, because nothing is overwritten. Budget time for re-testing retrieval quality on your own data. The Python package also pins requires-python to >=3.10,<4.0, and the Makefile carries separate test targets for 3.10, 3.11 and 3.12, so older interpreters are out.

On the self-hosted side, the auth change deserves attention during upgrades. The README warns that upgrading from a pre-auth build requires setting ADMIN_API_KEY, registering an admin through the wizard, or disabling auth for local development. A deployment that upgrades without doing one of those will not authenticate.

Editorial conclusion

Adopt Mem0 if you are building an assistant that needs to carry preferences and past context between sessions and you want the retrieval logic handled for you, either through the library or the self-hosted server. Do not adopt it if you cannot accept an extra LLM call on every write, or if you need strict overwrite semantics, because the current extraction algorithm is ADD-only and memories accumulate rather than being replaced. Before committing, verify the two things the README leaves open: which vector store you will configure for the library path, and whether you need the nlp extra, since the hybrid BM25 and entity retrieval path depends on installing mem0ai[nlp] plus the spacy en_core_web_sm model.

Frequently asked questions

Can Mem0 be self-hosted?

Yes. The README documents a self-hosted server started with make bootstrap from the server directory, or manually with docker compose up -d serving on http://localhost:3000. Auth is enabled by default, and the README's comparison table notes that self-hosted exposes some advanced features only as teasers compared with the cloud platform.

What are the best alternatives to Mem0 for AI agent memory?

The README does not name competing memory products, so no ranked list can be given. The closest architectural alternative described above is a plain vector store such as Qdrant or Chroma with your own extraction prompt, which retrieves by similarity without an extraction model or entity linking step.

What are the key differences between Mem0 and OpenMemory?

The README and repository files do not describe OpenMemory, so the differences cannot be stated. What the README does distinguish is the three deployment shapes for Mem0 itself: the library, the self-hosted server, and the cloud platform.

Who is the founder of Mem0 AI?

No founder is identified in the repository files. The pyproject.toml lists Mem0 as the author with the contact address [email protected], and the README links to a Y Combinator company page, but no individual is named.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
For maintainers

Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mem0ai-mem0.svg)](https://hysenlabs.com/projects/mem0ai-mem0)
Community notes

Community notes