4 Best Open Source Alternatives to Mem0

Updated July 2026

A memory layer promises something specific: turn conversations and events into durable memories, then retrieve the right context so a product feels like it remembers you. The trouble starts when that memory becomes part of your privacy boundary and your product's behavior. Conversation history, preferences, and corrections may need to stay inside your own environment, and the logic that decides what gets remembered, ranked, and forgotten usually needs more tuning than a hosted abstraction exposes. Open source memory tools let you run the store beside your app, choose the database and embedding stack, and control how memories are written, updated, expired, and retrieved, so recall quality and data retention become things you own rather than settings you hope the vendor got right.

Chroma logo

1.Chroma

28.4kApache-2.0Rust
Chroma screenshot

Chroma is open-source search infrastructure for AI that stores, indexes, and searches document collections by similarity. It is aimed at applications that need to add and query embeddings without wiring up separate tokenization and indexing components, making it a common building block for retrieval-augmented generation.

  • In-memory client for quick prototyping
  • Add, update, delete, get, and query collections
  • Metadata filters and document text filters
  • Automatic tokenization, embedding, and indexing
Letta logo

2.Letta

23.3kApache-2.0Python
Letta screenshot

Letta is a platform for building AI agents with advanced memory that can learn and self-improve over time. Formerly MemGPT, it is aimed at stateful agents that remember, learn continuously, and can be built into applications through an agents API.

  • Stateful agents with advanced memory
  • Local terminal agents through Letta Code
  • Skills and subagents for agent workflows
  • Pre-built memory and continual learning skills
Cognee logo

3.Cognee

17.8kApache-2.0Python Self-host
Cognee screenshot

Cognee is an open-source AI memory platform for AI agents. It gives agents persistent long-term memory across sessions by ingesting data and building a self-hosted knowledge graph, so agents can recall and use context beyond a single interaction.

  • Persistent long-term memory for AI agents across sessions
  • Ingests data and builds a self-hosted knowledge graph
  • Combines vector embeddings, graph reasoning, and ontology generation
  • Session memory with background sync to the graph
Zep logo

4.Zep

4.7kApache-2.0Python
Zep screenshot

Zep is an end-to-end context engineering platform for AI agents. It addresses the agent context problem by assembling relationship-aware context from chat history, business data, documents, and app events, then delivering the right information at the right time with sub-200ms latency.

  • Ingests chat messages, business data, documents, and app events
  • Graph RAG extracts relationships into a temporal knowledge graph
  • Retrieves pre-formatted context blocks optimized for LLMs
  • Tracks fact validity with valid_at and invalid_at dates

Our picks

Pick by the shape of memory you need: stateful agents, a self-hosted knowledge graph, or a temporal graph you assemble from the open framework.

Stateful agents with built-in memory: Letta Letta builds AI agents with advanced memory that learn and self-improve over time, the successor to MemGPT. It is model-agnostic, exposes an agents API with Python and TypeScript SDKs, and can run agents locally in a terminal through Letta Code, with skills and subagents for memory and continual learning. It fits teams whose real need is durable agent state, not just a place to store facts.

Self-hosted knowledge-graph memory: Cognee Cognee gives agents persistent long-term memory across sessions by ingesting data into a self-hosted knowledge graph, combining vector embeddings, graph reasoning, and ontology generation. Documents become searchable by meaning and connected by evolving relationships, and auto-routing chooses a search strategy per recall query. It runs local, in Docker, on-prem, or on Cognee Cloud, installs as a Python package, and has plugins for Claude Code.

Temporal knowledge graph via Graphiti: Zep Zep assembles relationship-aware context from chat history, business data, and events into a temporal knowledge graph that tracks how facts change over time, using valid_at and invalid_at dates. Note that Zep itself is delivered through Zep Cloud and its Community Edition is deprecated; the open source piece you can self-host is Graphiti, the temporal knowledge graph framework that powers it.

Owning your AI memory layer

Memory is not really a storage problem; it is a set of decisions about what to extract, rank, update, and forget, and a hosted layer makes most of those for you. So separate the behavior you depend on from the API you call. Some open source options are libraries you embed in your app; others are full services with their own database, vector index, and background jobs. Settle one question early: whether memory is scoped to a user, an agent, an organization, or a conversation, since that shapes the data model and permission checks everything else hangs off.

The gaps are in defaults and operational polish, not raw capability. A managed layer quietly picks embeddings, chunking, deduplication, conflict handling, latency budget, and retention; a replacement makes you define and test each against real conversations. Match the tool to your shape of memory. Letta builds stateful agents with advanced memory, the successor to MemGPT, with Python and TypeScript SDKs. Cognee ingests data into a self-hosted knowledge graph, combining vector embeddings, graph reasoning, and ontology generation. Zep centers on a temporal knowledge graph, though its self-hostable path is now the open Graphiti framework rather than the deprecated Community Edition.

Plan the move as an export, a rebuild, and a comparison. Pull the raw memory text, metadata, timestamps, and scope identifiers Mem0 holds per user, agent, or session, through whatever export or API path your account allows. Regenerate embeddings instead of reusing them, since vectors are tied to the model, dimensions, and index they were built with. Use the migration to clean up duplicate memories, stale facts, and summaries that suited Mem0 but not your new retrieval. Then run both on a fixed set of real conversations and score which recalls the right fact, ignores outdated details, and respects scope before cutting over.

Related alternatives

Frequently asked questions

What is the main risk when replacing a managed memory layer?+

The main risk is changing memory behavior without noticing. Two systems can store the same facts yet retrieve different ones because they summarize, rank, filter, and update memories differently. Before switching, build a small evaluation set from real interactions and check whether the new stack recalls the right fact, ignores outdated details, respects scope, and stays within your latency target. Behavior parity matters more than storage parity.

Can I reuse the embeddings Mem0 generated?+

Often you should not. Embeddings are tied to the model, dimensions, normalization, and index configuration used to create them, so reusing them in a system with a different embedding model or vector store can silently damage recall and make debugging harder. Export the raw memory text and metadata, then regenerate embeddings in the new stack so the vectors match its retrieval settings.

Can I keep the same application API when moving off Mem0?+

Usually not without an adapter. Mem0 has its own request and response shape, memory concepts, and metadata conventions. A practical migration wraps Mem0 behind your own internal interface first, then implements that interface against the new system. That limits application changes to one seam and lets you run comparison tests, or even shadow traffic, before switching over.

How do I test recall quality before cutting over from Mem0?+

Create a fixed set of conversations with known facts, changed facts, sensitive facts, and irrelevant details. Run the same queries through Mem0 and the replacement, then score whether each retrieves the right memory and excludes the wrong ones. Include negative tests where nothing should be recalled. This catches over-eager memory, stale facts, and scope leaks before real users hit them.

How do multi-tenant boundaries change once I self-host memory?+

They become your responsibility unless the replacement has first-class tenant controls. Every memory read should be filtered by the same user, workspace, agent, and environment boundaries your application already enforces, applied as authorization before retrieval or as a strict metadata filter in the retrieval layer. Test for cross-tenant leakage with adversarial queries, not only happy-path conversations, since a leak here exposes personal context.

What storage architecture works best for a Mem0 replacement?+

Most replacements pair a durable record store for memory text and metadata with a vector index for semantic retrieval, and some add keyword search or graph relationships for precision. Cognee, for instance, backs recall with graph, vector, and relational retrieval. Do not rely on vectors alone if permissions and deletions must be exact, because approximate similarity is a poor place to enforce access control or a right-to-be-forgotten request.

What if the open source memory project we choose stalls or is abandoned?+

Reduce that risk before adoption by keeping a narrow internal interface around memory operations: write, search, update, delete, and audit. Store memories in formats you understand, with portable metadata and embeddings you can rebuild from text. Avoid scattering project-specific calls through your app. If the project stalls, you can swap the implementation, fork it temporarily, or migrate again without redesigning every agent or losing the memory corpus.