█

AI/TLDR

Mem0

A memory layer that lets LLM agents remember users across sessions

Agent MemoryOpen source
Language
Python
$pip install mem0ai

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
Claude-Mem★ 102kPersistent memory layer for coding agents: it captures what an agent does during a session, compresses it into semantic summaries, and injects the relevant parts back into later sessions.
Mem0★ 67.4kA memory layer that lets LLM agents remember users across sessions
MemPalace★ 59.6kLocal-first agent memory that stores conversations verbatim instead of summarising them, with a structured palace index, pluggable vector backends and an MCP server.
Hindsight★ 51.1kAn agent memory server that stores facts and experiences, consolidates them into observations and mental models, and serves them back through retain, recall, and reflect operations.
OpenViking★ 40.2kA context database that stores an agent's memories, resources, and skills as one browsable viking:// filesystem with three-tier (abstract/overview/details) on-demand loading.
Cognee★ 32.5kA graph-native memory engine that turns raw documents and conversations into a queryable knowledge graph for agents that need to build lasting knowledge.
Graphiti★ 32kA 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★ 31.3kA memory and context engine that ingests information across tools and sessions and can run fully locally, acting as a second brain for AI applications.