Comparisons

Best open source agent memory

The best open source agent memory is Mem0: Apache 2.0, the largest community and a simple self-hosted server. Graphiti leads for temporal knowledge graphs.

Last updated December 2026

The best open source agent memory project for most teams is Mem0, because it is Apache 2.0 licensed, the most widely adopted option (about 68,000 GitHub stars when we checked), and it runs as a simple library or a self-hosted server. Graphiti is the stronger pick if you want a temporal knowledge graph, and Letta if you want a full stateful agent runtime rather than a memory component.

We make Exabase, which is a managed service and not open source, so it is not ranked here. This page gives a fair view of six open source projects, with licences and activity checked on each repository this month, and a short section on when a managed memory layer is the better trade.

What open source agent memory gives you

Agent memory is what lets an assistant remember a user’s plan, preferences and past decisions across sessions, instead of starting every conversation cold. A memory layer sits between your agent and its storage: it extracts facts from conversations, stores them, and retrieves the relevant ones before each model call. That keeps the prompt small. It also differs from the context window, which holds only what the model can see in a single call and is gone when the session ends.

Open source projects appeal for three reasons. You can run them in your own cloud, which some data policies require. You can read and change the code. And there is no per-call bill from a memory vendor, although you still pay for the model calls used to extract and summarise, plus the databases underneath.

The trade-off is operations. Most projects need at least a vector store, many also need a graph database, and all of them need someone to upgrade, monitor, back up and tune them. The quality problems are the same everywhere: contradiction resolution when a fact changes, entity resolution when one person or company appears under several names, and memory drift as stale facts pile up. Projects differ mainly in how they model memory: flat facts, a temporal knowledge graph, or memory blocks inside an agent runtime.

Verdict

Best overall: Mem0, for an Apache 2.0 memory layer with the largest community and the simplest start.

Best temporal knowledge graph: Graphiti, from the Zep team.

Best stateful agent runtime: Letta, formerly MemGPT.

Best for graph-based knowledge memory: Cognee.

Best for LangGraph users: LangMem.

Best for modelling users over time: Honcho, if AGPL licensing suits you.

At a glance

Project

Licence

GitHub stars (Dec 2026)

Memory model

Verdict

Mem0

Apache 2.0

About 68,100

Extracted facts, vector store

Best overall

Graphiti

Apache 2.0

About 32,500

Temporal knowledge graph

Best temporal graph

Cognee

Apache 2.0

About 31,200

Knowledge graph

Best graph knowledge memory

Letta

Apache 2.0

About 25,400

Stateful agents with memory

Best agent runtime

Honcho

AGPL 3.0

About 7,800

User and session modelling

Best for user modelling

LangMem

MIT

About 1,700

Memory tools on LangGraph’s store

Best for LangGraph

1. Mem0: the best open source agent memory overall

What it is. Mem0 describes itself as “the memory layer for AI agents”. You can use it as a Python library, run a self-hosted server with Docker Compose, or use Mem0’s hosted platform. It extracts memories from conversations and stores them in a vector store such as Qdrant.

Why it wins. The licence is Apache 2.0, so you can embed it in commercial products without copyleft obligations. It has by far the largest community of the projects here, which means more examples, integrations and answered issues. Its API is small: add memories, search them, and pass the results into your prompt.

Real-world example. A tutoring assistant serves 5,000 students. After each session it sends the transcript to a self-hosted Mem0 server, which stores facts such as “struggles with fractions” and “prefers worked examples”. Before the next session the assistant searches that student’s memories and adds the top five to its prompt, a few hundred tokens instead of the full history. The team runs Qdrant alongside Mem0 and owns the upgrades.

Not ideal if. You need rich relationships between entities, or strict guarantees about which fact is current. Like most vector-backed memory, quality depends on how well extraction and updates handle conflicting facts; our post on why a vector database is not a memory system explains the failure mode.

Compared with Exabase. Mem0 gives you code you can host. Exabase gives you a managed memory engine with published benchmark results and per-tenant isolation. See the Mem0 review, Mem0 alternatives and Exabase vs Mem0.

2. Graphiti: best temporal knowledge graph

What it is. An Apache 2.0 framework from the Zep team for building temporal knowledge graphs, where facts carry the time they became true and stopped being true. It supports Neo4j, FalkorDB and Amazon Neptune; Kuzu support is marked deprecated.

Best for. Agents that must answer “what was true when”, such as account histories or compliance timelines. Because each edge carries validity dates, an old fact is marked as ended rather than deleted, so you can still ask what the agent believed last quarter.

Not ideal if. You do not want to run a graph database.

Compared with Exabase. See Exabase vs Graphiti and Zep alternatives.

3. Cognee: best for graph-based knowledge memory

What it is. An Apache 2.0 “AI memory platform for agents” that turns documents and conversations into a searchable knowledge graph that persists across sessions. Its news feed lists v1.6.1 in September 2026.

Best for. Teams that want memory built from documents as well as chats, with graph retrieval.

Not ideal if. You want the smallest possible footprint.

Compared with Exabase. See the Cognee review, Cognee vs Mem0 and Exabase vs Cognee.

4. Letta: best stateful agent runtime

What it is. An Apache 2.0 “platform for stateful agents”, formerly MemGPT. Where the others are memory components, Letta runs the agent itself and manages what stays in context, following the MemGPT approach.

Best for. Teams who want the runtime and the memory in one system.

Not ideal if. You already have an agent framework and only want a memory layer.

Compared with Exabase. See the Letta review, Mem0 vs Letta and Exabase vs Letta.

5. Honcho: best for modelling users over time

What it is. A “memory library for building stateful agents” from Plastic Labs, focused on building a picture of each user across sessions. Its server is at version 3.4.1.

Licence note. Honcho is AGPL 3.0. If you modify it and offer it over a network, you must publish your changes, which some companies rule out. Check with your own legal team.

Compared with Exabase. See Exabase vs Honcho.

6. LangMem: best for LangGraph users

What it is. An MIT-licensed library from LangChain that gives agents memory tools and background memory management, with native integration into LangGraph’s long-term memory store.

Best for. Teams already building on LangGraph who want memory without another service.

Not ideal if. You do not use LangGraph; the value is in that integration. Our post on when to outgrow your framework’s built-in memory covers the signs.

Compared with Exabase. See the LangMem review, LangMem vs Mem0 and Exabase vs LangMem.

When managed memory is the better trade

Open source is the right call when you must self-host or want to own the code. It is worth being clear about the costs: the databases underneath, extraction model calls, upgrades, evaluation and on-call time. Our post on open source vs managed agent memory goes into the trade in more depth.

Exabase is the managed option we build. Exabase Memory runs on M-1, a proprietary engine that extracts facts, preferences and events, tracks relationships, and resolves contradictions when a newer fact replaces an older one, so “moved to Berlin” supersedes “lives in Toronto”. M-1 scores 96.4% on LongMemEval and is first on BEAM at 100K, 1M and 10M tokens, as set out in our LongMemEval results. Retrieval is hybrid with recency weighting, optional query expansion and reranking, at about 200ms for simple retrieval.

Each user, project or customer gets its own Base, so memories are isolated without filters in your code; the memory scoping guide shows how, and creating memories covers inferred and verbatim writes. The same Base holds files and search, which helps when an assistant needs documents as well as facts.

Where open source is stronger. Exabase cannot be self-hosted and its code is not open, so if your policy requires running memory inside your own cloud, or you want to modify the engine, choose one of the projects above. The Free plan is $0 a month with 200 credits a month; Scale is $149 a month. See agent memory for the full picture.

How to choose

You want a widely used, permissively licensed memory layer you can self-host. Choose Mem0.

You need facts with time ranges and history. Choose Graphiti.

You want memory built from documents as well as chats, as a graph. Choose Cognee.

You want the agent runtime and memory together. Choose Letta.

You are on LangGraph. Choose LangMem.

You want to model users deeply and AGPL is acceptable. Choose Honcho.

You would rather not run memory infrastructure at all. Consider Exabase.

Whatever you choose, build a small evaluation first: 30 conversations where facts change, and questions that test whether the agent uses the current fact. Our best agent memory platforms roundup covers managed options, and RAG vs agent memory explains why document retrieval alone does not solve this.

How we compared

We checked each project’s GitHub repository in December 2026 for licence, star count and recent activity, and read each project’s own description of what it does. We judged them on licence terms, community size, memory model, infrastructure needed and how well they handle changing facts. Star counts are rounded and change daily.

Frequently asked questions

What is the best open source agent memory?

Mem0 is the best open source agent memory for most teams, because it is Apache 2.0 licensed, has the largest community and runs as a library or self-hosted server.

Why is Mem0 the best open source agent memory?

Mem0 pairs a permissive licence with a small API and the most community support, so it is the easiest open source memory layer to adopt and keep running.

Is Mem0 fully open source?

Yes. The Mem0 repository is Apache 2.0 licensed. Mem0 also sells a hosted platform.

Is Letta open source?

Yes. Letta, formerly MemGPT, is Apache 2.0 licensed.

Is Zep open source?

Zep’s Graphiti framework is open source under Apache 2.0. Zep’s hosted service is commercial; see Exabase vs Zep.

Which open source memory uses a knowledge graph?

Graphiti and Cognee both build knowledge graphs; Graphiti adds time to every fact.

What licence should I look for?

Apache 2.0 and MIT are permissive. AGPL 3.0, used by Honcho, requires you to share changes if you offer a modified version over a network.

Do I need a vector database for agent memory?

Most open source projects use one, and graph projects add a graph database. See vector database vs memory.

What does self-hosting agent memory cost?

The licence is free, but you pay for databases, extraction model calls and the engineering time to run them.

Is Exabase open source?

No. Exabase is a managed service and cannot be self-hosted.

Is Exabase free?

Yes, to start. The Free plan is $0 a month with 1 GB of storage and 200 credits a month; Scale is $149 a month.

Related pages: Best agent memory platforms, Best MCP memory servers, Best knowledge graph for AI agents, Exabase vs Mem0, Letta alternatives, Cognee alternatives, Long-term memory, Agent memory, Long-term memory in AI, Best AI agent frameworks

Compare similar apps and tools:

6 best open source Firecrawl alternatives in 2026

AWS vs Google vs Azure agent memory compared (2026)

6 best web search APIs for AI agents in 2026

7 best vector databases for multi-tenant apps in 2026

5 best reverse image search APIs in 2026

6 best digital asset management APIs in 2026

6 best handwriting OCR APIs and tools in 2026

5 best receipt OCR APIs in 2026

6 best open source document parsers in 2026

6 best embedding models in 2026

6 best durable execution platforms for AI agents in 2026

7 best AI agent sandboxes in 2026

7 best file systems for AI agents in 2026

6 best knowledge graphs for AI agents in 2026

7 best AI context platforms in 2026

7 best RAG as a service platforms in 2026

6 best MCP memory servers in 2026

7 best reranking models in 2026

9 best file storage options for AI agents in 2026

5 best HTML to markdown APIs in 2026

7 best AI agent frameworks in 2026

6 best open source agent memory projects in 2026

6 best multimodal search APIs in 2026

7 best semantic search APIs in 2026

6 best company enrichment APIs in 2026

Best logo APIs in 2026 (after Clearbit)

5 best screenshot APIs in 2026

7 best link preview APIs in 2026

5 best resume parser APIs in 2026

8 best invoice extraction APIs in 2026

7 best video understanding APIs in 2026

7 best speech to text APIs in 2026

8 best PDF parsers for LLMs in 2026

7 best OCR APIs in 2026

7 best vector databases in 2026

8 best AI agent infrastructure tools in 2026

9 best RAG infrastructure platforms in 2026

9 best PDF extraction APIs in 2026

9 best web scraping APIs in 2026

9 best document extraction APIs in 2026

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.