Repolode
mem0ai

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. 1

    Install the Python library

    pip install mem0ai
  2. 2

    Install the npm SDK (alternative for JavaScript)

    npm install mem0ai
  3. 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