Overview
Mem0 (pronounced "mem-zero") is a memory layer you add to LLM-based assistants and agents. It extracts useful facts from conversations, stores them, and recalls them later, so your agent remembers user preferences and history across separate sessions instead of starting fresh each time.
It fits the agent-memory category as a memory framework: you keep your existing model and app, and Mem0 handles capturing, storing, and retrieving what the user said. It supports multiple levels of memory (user, session, and agent state) and backs them with vector, graph, and key-value stores.
It is aimed at developers building customer-support chatbots, AI assistants, and autonomous systems. You can run it as a Python or JavaScript library for prototyping, host the server yourself with Docker, or use the managed cloud platform.
What it does
- Multi-level memory that retains user, session, and agent state for personalization
- Pluggable storage across vector, graph, and key-value backends
- Multi-signal retrieval that fuses semantic, BM25 keyword, and entity matching
- Temporal reasoning that ranks the right dated memory for current, past, and upcoming queries
- Python and JavaScript SDKs, plus a CLI for managing memories from the terminal
- Library, self-hosted Docker server, and managed cloud deployment options
Getting started
Install the SDK for your language, or use the CLI to manage memories from the terminal. The library is the quickest way to test and prototype.
Install the Python library
Install the core package from PyPI. For hybrid search with BM25 keyword matching and entity extraction, install the NLP extra and the spaCy model.
pip install mem0ai
# Optional: hybrid search with BM25 + entity extraction
pip install mem0ai[nlp]
python -m spacy download en_core_web_smOr install the JavaScript SDK
Use npm if you are working in a JS or TypeScript project.
npm install mem0aiAdd and search memories from the CLI
Initialize the CLI, store a memory for a user, then search it back. Pass --user-id to scope memories to a specific person.
mem0 init
mem0 add "Prefers dark mode and vim keybindings" --user-id alice
mem0 search "What does Alice prefer?" --user-id aliceRun the server yourself (optional)
For a team setup, start the self-hosted stack with Docker Compose. The dashboard is served at localhost:3000.
cd server && docker compose up -dCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Give a customer-support chatbot recall of a user's past tickets and history for tailored help
- Keep an AI assistant's conversations consistent and context-rich across separate sessions
- Track user preferences (like dark mode or keybindings) so an agent personalizes its behavior
- Store agent-confirmed actions and facts so autonomous systems learn over time
How Mem0 compares
Mem0 alongside other open-source agent memory tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Mem0 | ★ 59.6k | A memory layer that lets LLM agents remember users across sessions |
| Graphiti | ★ 28.1k | A library that builds a temporal knowledge graph from an agent's conversations and data so facts can be tracked and queried as they change over time. |
| Supermemory | ★ 27.8k | A memory and context engine that ingests information across tools and sessions and can run fully locally, acting as a second brain for AI applications. |
| Cognee | ★ 24.1k | A graph-native memory engine that turns raw documents and conversations into a queryable knowledge graph for agents that need to build lasting knowledge. |
| Letta | ★ 23.6k | A framework (formerly MemGPT) for building stateful agents with long-term memory that persists across sessions and conversations. |
| Memvid | ★ 15.7k | Memvid packs an AI agent's data, embeddings, and search index into one portable file, so it can retrieve memory fast without running a vector database. |
| Memori | ★ 15.5k | An SQL-native memory engine that gives any LLM persistent, structured memory stored in standard PostgreSQL or MySQL databases instead of a vector store. |
| MemU | ★ 13.9k | A memory layer for AI agents that organizes structured storage and intent capture to reduce the tokens needed to keep context across conversations. |