mem0ai/mem0
The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
📚 What is Mem0?
Mem0 (pronounced mem‑zero) is an open‑source memory layer you can plug into any LLM‑powered assistant or agent. It stores facts, preferences, and context about users, sessions, or the agent itself, and then retrieves the most relevant pieces when the model generates a response. In short, it gives chat‑bots and autonomous agents a long‑term memory so they can act consistently across conversations.
🚀 Core Features (as described in the README)
| Feature | What it does | Why it matters |
|---|---|---|
| Multi‑Level Memory | Separate stores for User, Session, and Agent state. | Keeps personal preferences separate from short‑term dialogue, enabling true personalization. |
| Hybrid Retrieval | Combines semantic vector search, BM25 keyword matching, and entity linking. | Improves relevance, especially when exact wording differs from how the fact was stored. |
| Temporal Reasoning | Scores memories by recency and time‑stamps. | Lets the system answer “what did I say yesterday?” or “what’s my upcoming plan?” correctly. |
| Single‑Pass ADD‑Only Extraction (new algorithm, Apr 2026) | One LLM call to add a memory; no update/delete loops. | Faster, cheaper, and more token‑efficient. |
| Agent‑Generated Facts | When an agent confirms an action, that fact is stored with the same weight as user‑provided facts. | Gives agents the ability to remember their own decisions. |
| Cross‑Platform SDKs | Python (mem0ai), JavaScript/Node (mem0ai), CLI (mem0-cli). |
Easy to integrate into existing codebases, regardless of language. |
| Managed Cloud Option | Hosted service with dashboard, auth, and scaling. | Zero‑ops for teams that don’t want to run the server themselves. |
| Self‑Hosted Server | Docker‑compose stack with optional auth, Qdrant vector store, admin UI. | Full control for privacy‑sensitive or on‑prem environments. |
🛠️ Getting Started (quick‑start flow)
- Install –
pip install mem0ai(ornpm install mem0ai). - Create an agent key –
mem0 init --agent --agent-caller <name>. - Add a memory –
mem0 add "I am using mem0". - Search –
mem0 search "am I using mem0".
The same steps work via the Python SDK:
from mem0 import Memory
memory = Memory()
memory.add([{"role":"user","content":"I love dark mode"}], user_id="alice")
print(memory.search(query="What does Alice prefer?", filters={"user_id":"alice"}))
📊 Research & Benchmarks
Mem0 publishes a new memory algorithm (April 2026) that improves token efficiency and latency. Benchmarks (run on their production stack) show:
- LoCoMo: 92.5 ↑ 21 pts, 7 K tokens, 0.88 s p50 latency.
- LongMemEval: 94.4 ↑ 27 pts, 6.8 K tokens, 1.09 s latency.
- BEAM (1 M): 64.1 pts, 6.7 K tokens, 1.00 s latency.
The evaluation framework is open‑sourced in mem0ai/memory-benchmarks for reproducibility.
🤝 Integrations & Ecosystem
- ChatGPT, Claude, Perplexity – Browser extension stores memories across these web UIs.
- LangGraph – Build stateful agents with LangGraph + Mem0.
- CrewAI – Tailor multi‑agent workflows.
- Vercel AI SDK – Ready‑made skill packages (
mem0,mem0-cli,mem0-vercel-ai-sdk). - Skills catalog – CLI commands (
/mem0-integrate,/mem0-test-integration,/mem0-oss-to-platform) let you wire Mem0 into any repo.
📦 Packages & Deployment Options
| Option | When to use | Setup | Auth & Dashboard |
|---|---|---|---|
| Python / npm library | Quick prototyping, unit tests | pip install mem0ai (or npm install mem0ai) |
– |
| Self‑hosted server | On‑prem, data‑privacy, team deployment | cd server && make bootstrap (Docker compose) |
Built‑in admin UI |
| Managed Cloud | Production with zero ops | Sign up at app.mem0.ai |
Full dashboard, API‑key management |
📚 Where to Learn More
- Docs – https://docs.mem0.ai (quickstart, API reference, migration guides).
- Demo – https://mem0.dev/demo (live ChatGPT with memory).
- Paper – arXiv:2504.19413 (citable research on scalable long‑term memory).
- Community – Discord, X/Twitter, and a public Y Combinator S24 batch.
⚖️ License
Apache 2.0 – you can use, modify, and redistribute Mem0 in commercial or open‑source projects.
TL;DR
Mem0 is a practical, open‑source memory service for LLM‑based assistants. It offers hybrid retrieval, temporal reasoning, and a simple SDK/CLI, with both self‑hosted and managed cloud options. If you need your AI agents to remember users across sessions without building a vector store from scratch, Mem0 is a ready‑to‑use solution.
Related
- Project
- Project
- Project
- Project
- Project