Search iThub

Search tools, categories and collections. Type at least two characters.

Explore all tools
↑ ↓ to explore resultsEnter to open · Esc to close

Mem0

Apache-2.0 memory layer that gives AI agents persistent per-user memory, self-hosted or as a managed service

Visit website Save

Mem0 extracts facts from conversations with an LLM, stores them per user, agent or run, and returns the relevant ones through hybrid search. It ships Python and Node SDKs, a Docker server with dashboard, a CLI, an MCP server and a hosted Platform.

Pricing
Freemium
Deployment
Self-hosted
Platforms
Web, Windows, macOS, Linux
68,537stars8,148forks
0views
Updated

What is Mem0?

Mem0 (pronounced mem-zero) is a memory layer for AI assistants and agents. An application sends conversation turns to Mem0, which extracts short factual memories with an LLM, embeds them and stores them under a user, agent or run identifier. On the next request the application searches those memories and adds the relevant ones to its prompt, so preferences, past actions and earlier decisions carry over between sessions without resending the full history.

The project is developed by Mem0, a Y Combinator S24 company that its Y Combinator profile lists as founded in 2023 in San Francisco. The open-source code is licensed under Apache-2.0. The same company runs Mem0 Platform, a managed service at app.mem0.ai with a free tier and custom contracts, described on the pricing page.

There are three ways to run it. The library ships as mem0ai on PyPI (Python 3.10 or newer) and as mem0ai on npm (Node.js 18 or newer). The self-hosted server in the server/ directory is a Docker Compose stack with a FastAPI REST API on port 8888, a web dashboard on port 3000 and Postgres with pgvector, documented in the self-hosted setup guide. The hosted Platform adds graph memory, user profiles, memory consolidation and enterprise controls. The monorepo also carries a CLI for Python and npm, a hosted MCP server, agent skills and plugins for Claude Code, Codex, Cursor, OpenCode, OpenClaw and other agent hosts.

Releases are tagged per package. The latest GitHub release is Node SDK ts-v3.3.1, published on September 25, 2026 together with Python SDK v2.2.1. Both are bug-fix releases: Turbopuffer filters now apply every comparison operator, distance scores no longer invert ranking, the Node config stops injecting OpenAI defaults into other providers, and the Python add() raises VectorStoreError instead of reporting memories the vector store rejected. The previous minor releases added User Profiles methods to the Platform client. The larger change came with the v3 SDK line, which the v2 to v3 migration guide documents: single-pass ADD-only extraction, hybrid retrieval and changed search defaults.

Mem0 is a component, not an agent framework or a chat interface. It does not orchestrate tools, host models or replace a document RAG pipeline; it needs an LLM and an embedding model, with OpenAI gpt-5-mini and text-embedding-3-small as defaults. Benchmark scores on the README (LoCoMo, LongMemEval, BEAM) are measured on the managed Platform, and the project states that open-source results are directionally similar but not identical. The external graph store integration was removed from the open-source SDK in v3, so graph memory is now a Platform feature only.

Inside the application

Mem0 screenshots

Explore the interface. Open a screenshot to view it at full size.

Mem0 Platform dashboard Requests page with total memories, retrieval and add event counters and a table of DELETE_USER, SEARCH and ADD events with latency
Mem0 screenshot 1

Official documentation screenshot of the hosted dashboard's request log, with memory counts per user, agent and session.

Mem0 memory extraction diagram: store, context lookup, ADD-only extraction, deduplicate and embed, entity linking, writing to SQL, vector and entity stores
Memory extraction pipeline

Official diagram of the v3 extraction pipeline and the three persistent stores it writes to.

Mem0 playground chat where a user message produces two stored memories, likes long walks on weekends and lives in San Francisco
Playground memory extraction

Official playground example showing facts extracted from one chat message into the memory panel.

Mem0 REST API OpenAPI page listing configure, memories, search, history and reset endpoints
Self-hosted REST API

OpenAPI explorer of the self-hosted REST server, as shown in the official documentation.

Diagram of an agent stack where a memory reader feeds a collator next to tools and RAG, and a memory writer stores interactions for future sessions
Memory in an agent stack

Official architecture figure showing where memory reads and writes sit in an agent request loop.

Source: official Mem0 project page.

Key capabilities

  • Memory add and search API The core calls are add(), search(), get_all(), update(), delete() and history(). Messages go in as a string, a dict or a list of chat messages, and the LLM extracts the facts worth keeping. Since v3, search() and get_all() take entity identifiers inside a filters object; top-level user_id keyword arguments raise a ValueError.
  • Scoped memory by user, agent and run Every memory belongs to a user_id, agent_id or run_id, which separates long-term user preferences from facts an agent recorded about its own actions and from short-lived session context. Empty or whitespace-only identifiers are rejected. The scoping model is the same in the open-source SDK and the Platform, which makes a later migration a matter of changing the client.
  • Single-pass ADD-only extraction The v3 algorithm makes one LLM call per add() and only appends memories; it no longer emits UPDATE or DELETE events. Older facts are kept and newer dated facts outrank them through time-aware retrieval. Code written against v2 that expects UPDATE or DELETE events must be adjusted, as listed in the migration guide.
  • Hybrid retrieval with entity linking Search scores semantic similarity, BM25 keyword matches and shared entities in parallel and fuses the results. Entity extraction and lemmatization need the mem0ai[nlp] extra with spaCy and the en_core_web_sm model, which installs on Python 3.10 to 3.12 only. Qdrant users also need fastembed for BM25; without it search silently falls back to semantic-only and logs a warning.
  • Search defaults and reranking Since v3 the default top_k is 20 instead of 100, results below a relevance threshold of 0.1 are dropped, and reranking is off unless rerank=True is passed and a reranker is configured. These defaults change what an upgraded application sees, so evaluation sets should be rerun after an upgrade. Metadata filters support logical operators and nested conditions.
  • Pluggable vector stores The Python SDK documents 27 vector store backends, including Qdrant, Chroma, pgvector, Pinecone, Weaviate, Milvus, Elasticsearch, OpenSearch, Redis, Valkey, MongoDB, FAISS, Turbopuffer, Amazon S3 Vectors and Azure AI Search. The TypeScript SDK supports a shorter list of 12, including Qdrant, Redis, pgvector, Supabase, Milvus and an in-memory store. The library default is a local Qdrant collection at /tmp/qdrant with a SQLite history file at ~/.mem0/history.db.
  • LLM and embedding providers Documented LLM providers include OpenAI, Anthropic, AWS Bedrock, Azure OpenAI, Google AI, Groq, DeepSeek, Mistral, xAI, Together, LiteLLM, vLLM, LM Studio and Ollama; 11 embedding providers include OpenAI, Hugging Face, FastEmbed, Ollama and Vertex AI. Local models through Ollama or LM Studio keep extraction off third-party APIs. A non-default embedding dimension must be set with embedding_model_dims on the vector store.
  • Self-hosted REST server and dashboard The server/ stack runs the API on port 8888, the dashboard on port 3000 and a pgvector/pgvector:pg17 database. make bootstrap starts it, creates the admin account and prints the first API key; make up leaves account creation to a browser wizard. The dashboard shows a live request audit log, stored memories, entities with cascade delete, API keys and runtime LLM and embedder configuration. A prebuilt image is published as mem0/mem0-api-server.
  • Authentication on the self-hosted server Auth is on by default and the server refuses to start without JWT_SECRET. Programmatic clients send per-user X-API-Key values with an m0sk_ prefix, of which the server stores only the prefix and a bcrypt hash. A legacy shared ADMIN_API_KEY remains for older clients, and AUTH_DISABLED=true is documented for local development only. The bundled image accepts only the openai, anthropic and gemini providers until you rebuild it with more packages.
  • OpenAI-compatible chat client mem0.proxy.main.Mem0 mirrors client.chat.completions.create() and accepts user_id, agent_id and run_id next to the usual messages and model. Each call saves relevant facts and injects stored ones, so existing OpenAI-style code gains memory with few changes. It can target the managed Platform or a local configuration such as a Qdrant host.
  • Async, multimodal and custom instructions AsyncMemory offers non-blocking calls for high-throughput services and, since v2.2.1, works as an async context manager again. Multimodal inputs let images and other media be turned into memories. custom_instructions replaces the older custom extraction prompt and tells the extractor what to keep or ignore for a given domain.
  • Mem0 Platform managed service The hosted service runs extraction, storage and reranking with no vector database to operate and adds webhooks, memory exports, custom categories, usage analytics and a playground. Platform-only features include graph memory with entity relationships, User Profiles (an LLM-maintained JSON summary per user shaped by a JSON Schema) and Dream memory consolidation. Several of these are listed only on the Custom plan.
  • Hosted MCP server The Mem0 MCP server runs at https://mcp.mem0.ai/mcp over HTTPS and exposes tools such as add_memory, search_memories, update_memory, delete_entities and list_events. npx mcp-add (Node.js 18 or newer) writes the entry for Claude Code, Cursor, Windsurf, VS Code and OpenCode; Claude Desktop and Codex are configured manually. Sign-in uses a browser OAuth flow or an API key, and memories stored this way live in the Mem0 account, not on the local machine.
  • Command-line interface The mem0 CLI is published as @mem0/cli on npm and mem0-cli on PyPI with identical commands: init, add, search, list, get, update and delete. The --agent flag switches output to JSON for scripts and coding agents. It talks to the Platform API, and an agent can create an account with mem0 init --agent that a human later claims by email.
  • Agent plugins and skills The repository ships plugins for Claude Code, Codex, Cursor, OpenCode, OpenClaw, Hermes, Kimi, Antigravity, Pi Agent and DeepSeek, plus a Vercel AI SDK provider, AWS Strands integration, n8n nodes and a Zapier app. Agent skills install with npx skills add https://github.com/mem0ai/mem0 --skill mem0 and include pipelines that wire Mem0 into an existing repository or migrate an OSS project to the Platform. Plugin versions are released separately from the SDKs.
  • Framework integrations Documented integrations cover LangGraph, LangChain, CrewAI, LlamaIndex, AutoGen, Agno, Mastra, Dify, LiveKit, Pipecat and ElevenLabs among others. Most wrap the same add and search calls. Check whether an integration targets the Platform client or the open-source Memory class before choosing it.
  • Installation Python: pip install mem0ai, or pip install mem0ai[nlp] plus python -m spacy download en_core_web_sm for hybrid search. Node.js: npm install mem0ai; the PGVector store needs pg installed separately since ts-v3.3.1. Server: clone the repository, copy server/.env.example to server/.env, set OPENAI_API_KEY and JWT_SECRET, then run make bootstrap with Docker and Docker Compose installed.
  • Telemetry setting The Python package depends on PostHog and sends anonymous usage events to us.i.posthog.com by default, with hot-path events sampled at 10 percent. Set MEM0_TELEMETRY=false to turn it off, and MEM0_TELEMETRY_SAMPLE_RATE to change sampling. Air-gapped or regulated deployments should set the variable explicitly and confirm the egress with a network capture.
Advertisements

Where Mem0 fits

Giving a support assistant memory of past conversations

Call search() with the customer identifier in filters before each model call, place the returned memories in the system prompt, then call add() with the user and assistant turns after the reply. Keep the customer identifier stable across channels so memories attach to one person. Check that a fact stated in one session is retrieved in a new session, and that one customer never sees another customer's memories when identifiers are close or reused.

Persisting agent state across runs

Store facts an agent learned about its own actions under agent_id, and per-task scratch context under run_id, so long-lived knowledge and temporary context can be listed and deleted separately. Since v3, agent-generated facts carry the same weight as user statements, so confirmed actions are recalled later. Test that a finished run can be cleaned up with delete_all() without removing the agent's long-term memories.

Running memory entirely on your own infrastructure

Deploy the server/ Compose stack, or configure the library with a local vector store and an Ollama or vLLM model for both extraction and embeddings. Disable telemetry with MEM0_TELEMETRY=false, put HTTPS in front of port 8888 and issue per-user API keys from the dashboard. Verify with a packet capture that no request leaves the network, and check that the chosen embedding dimension matches embedding_model_dims on the vector store.

Adding memory to a coding assistant

Point Claude Code, Cursor, Windsurf, VS Code or OpenCode at the hosted MCP server with npx mcp-add, or install the Claude Code or Codex plugin from the repository for skills and lifecycle hooks. The agent then decides when to store and look up project conventions. Remember that these memories sit in the Mem0 cloud account, so review what the agent saves before using it on proprietary code, and use the CLI to list and delete entries.

Upgrading an existing integration to the v3 SDKs

Follow the migration guide: move entity identifiers into filters, rename custom_fact_extraction_prompt to custom_instructions, remove graph_store settings and install the [nlp] extra. Pass top_k=100, threshold=0.0 or rerank=True only where the old behavior is still required. Rerun a fixed evaluation set before and after, because ADD-only extraction keeps older facts that v2 used to overwrite.

Moving from open source to the managed Platform

Teams that outgrow a self-run vector store can switch to MemoryClient with an API key; the agent skill mem0-oss-to-platform automates the code change, and a migration guide covers importing hosted Qdrant vectors. Compare free-tier limits with expected traffic first, and confirm which needed features, such as graph memory or SSO, are only on the Custom plan.

Install

pip install mem0ai

Reviews of Mem0

No reviews yet

Be the first to share your experience with Mem0.

Loading review form…

Alternatives to Mem0

Compare Mem0 with these tools →