AI/TLDR

Mem0

A memory layer that lets LLM agents remember users across sessions

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.

bashbash
pip install mem0ai

# Optional: hybrid search with BM25 + entity extraction
pip install mem0ai[nlp]
python -m spacy download en_core_web_sm

Or install the JavaScript SDK

Use npm if you are working in a JS or TypeScript project.

bashbash
npm install mem0ai

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

bashbash
mem0 init
mem0 add "Prefers dark mode and vim keybindings" --user-id alice
mem0 search "What does Alice prefer?" --user-id alice

Run the server yourself (optional)

For a team setup, start the self-hosted stack with Docker Compose. The dashboard is served at localhost:3000.

bashbash
cd server && docker compose up -d

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

ToolStarsWhat it does
Mem0★ 59.6kA memory layer that lets LLM agents remember users across sessions
Graphiti★ 28.1kA 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.8kA 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.1kA 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.6kA framework (formerly MemGPT) for building stateful agents with long-term memory that persists across sessions and conversations.
Memvid★ 15.7kMemvid 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.5kAn 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.9kA memory layer for AI agents that organizes structured storage and intent capture to reduce the tokens needed to keep context across conversations.