Agent memory system that stores, recalls and reflects on memories so AI agents learn over time instead of only replaying chat history.
mem0ai/mem0
A memory layer for AI agents and apps that stores and retrieves user, session, and agent context across conversations.
- Stars
- 67,505
- Forks
- 7,965
- Open issues
- 856
- Last commit
- 14 hours ago
What is it?
Mem0 is a memory infrastructure layer that sits between an AI assistant or agent and its language model. It extracts facts from conversations, stores them, and retrieves relevant ones on later turns, so the assistant can recall user preferences and history without resending everything in the prompt. Memory is organized at the user, session, and agent level.
The project ships as a Python package (pip install mem0ai) and an npm SDK, and it can be used in three ways: as an embedded library, as a self-hosted server with Docker Compose that includes a dashboard and API keys, or as a managed cloud platform. A command-line tool (mem0 CLI) is also available for adding and searching memories from a terminal.
The current algorithm combines semantic search, BM25 keyword matching, and entity matching, and it is configurable with different LLMs and embedding models. Retrieval uses optional NLP extras for hybrid search. The project includes skills for AI coding assistants to help integrate it into existing codebases.
Key features
- 01Stores user, session, and agent memories and retrieves them by semantic, keyword, and entity matching.
- 02Available as a Python and npm SDK, a self-hosted Docker server, or a managed cloud platform.
- 03Includes a CLI for adding and searching memories from the terminal.
- 04Works with multiple LLM and embedding providers, with OpenAI models as defaults.
- 05Provides agent skills for AI coding assistants such as Claude Code and Cursor.
Use cases
- Adding persistent personalization to a chatbot or AI assistant.
- Recalling past tickets and user history in customer support bots.
- Giving LangGraph or CrewAI agents long-term memory across sessions.
Quick start
- 1
Install the Python library
pip install mem0ai - 2
Install the npm SDK (alternative for JavaScript)
npm install mem0ai - 3
Set up the self-hosted server with one command
cd server && make bootstrap
Things to know
- The default LLM and embedding model are OpenAI services, so you need an OpenAI API key unless you configure alternatives.
- Self-hosting requires Docker and a multi-service setup, which adds operational effort.
- The README notes that published benchmark scores come from the managed platform, so open-source results may differ.
Topics
FAQ
- What is mem0?
- A memory layer for AI agents and apps that stores and retrieves user, session, and agent context across conversations. Mem0 is a memory infrastructure layer that sits between an AI assistant or agent and its language model. It extracts facts from conversations, stores them, and retrieves relevant ones on later turns, so the assistant can recall user preferences and history without resending everything in the prompt. Memory is organized at the user, session, and agent level.
- Is mem0 free to use? What license does it have?
- mem0 is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is mem0 still maintained?
- Actively maintained. The last commit to mem0 was on Oct 20, 2026.
- What can I use mem0 for?
- Adding persistent personalization to a chatbot or AI assistant. Recalling past tickets and user history in customer support bots. Giving LangGraph or CrewAI agents long-term memory across sessions.
- How do I install mem0?
- Install the Python library: pip install mem0ai Install the npm SDK (alternative for JavaScript): npm install mem0ai Set up the self-hosted server with one command: cd server && make bootstrap
- Where can I get mem0?
- The source code and installation instructions are on GitHub: https://github.com/mem0ai/mem0
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A visual platform for building, testing and deploying AI agents and workflows, with built-in API and MCP server exposure.
A Python framework for building LLM-powered applications and agents, with standard interfaces for models, embeddings, vector stores and third-party integrations.
Memory operating system for LLMs and AI agents that stores, retrieves, and manages long-term memory as an editable graph.
Python framework for building autonomous AI agents that research, plan, code and run tasks, with memory, RAG and 100+ LLM providers.
A modular Agentic RAG tutorial and project built with LangGraph, featuring hierarchical indexing, conversation memory, and query clarification.