Top Open-Source Memory Frameworks for LLM Agents in 2026: Compared
This guide compares the leading open-source memory frameworks for LLM agents in 2026, evaluating each on storage backend flexibility, agent-native APIs, LangGraph and CrewAI compatibility, and graph-structured retrieval. Cognee leads this list as the only framework purpose-built around a graph-native architecture and a structured ECL (Extract, Cognify, Load) pipeline that makes memory an active, self-improving layer rather than a passive store. Alongside Cognee, this article covers Mem0, Zep, Letta, MemGPT, Graphiti, and LangMem, providing an honest, technical breakdown that helps AI engineers, platform teams, and researchers choose the right memory layer for their agent stack.
Why Do LLM Agents Need Open-Source Memory Frameworks?
Stateless LLM agents are one of the most persistent problems in production AI. Without a persistent, structured memory layer, agents repeat questions, lose conversational context across sessions, and hallucinate facts that were already established earlier in a workflow. Open-source memory frameworks address this gap by providing agents with retrievable, queryable, and often self-improving stores of knowledge that persist beyond the context window. For teams building on LangGraph, CrewAI, or custom orchestration stacks, these frameworks represent the difference between demos and deployable systems.
Cognee was built to address exactly this class of problem. Its pipeline volume grew from roughly 2,000 runs to over one million in a single year, a 500x increase that reflects the urgency teams feel when moving agents from prototype to production. Cognee is now running in more than 70 companies, including Bayer for scientific research workflows and the University of Wyoming for policy document analysis.
The Core Problems That Memory Frameworks Solve for Agent Teams
- Context window exhaustion: Agents lose critical facts as conversations and workflows grow longer than the model's input limit.
- Session discontinuity: Without persistent memory, each new session starts from scratch, forcing users to re-establish context manually.
- Unstructured retrieval: Naive vector search returns semantically similar chunks but misses relational or causal connections between facts.
- Hallucination from missing context: Agents fill gaps in knowledge with plausible-sounding but incorrect information when memory is absent.
- Multi-agent state fragmentation: In multi-agent pipelines, individual agents operate on different subsets of state, leading to inconsistent decisions across the system.
Open-source memory frameworks solve these problems by providing a shared, persistent, and structured memory layer that all agents in a pipeline can read from and write to. Cognee goes further by making that layer self-improving through its memify refinement stage, which prunes stale nodes, reweights edges based on usage signals, and adds derived facts over time.
What to Look for in an Open-Source Memory Framework for LLM Agents
Not all memory frameworks are equally suited to production agent systems. The right framework depends on how you architect state, which orchestration tools you use, and whether your retrieval needs go beyond flat vector similarity. The following criteria provide a practical checklist for evaluating any open-source memory framework.
Key Evaluation Criteria for LLM Agent Memory Frameworks
- Storage backend flexibility: Can the framework swap between graph databases, vector stores, and relational backends without rewriting application logic?
- Agent-native APIs: Does the framework expose clean, async-compatible interfaces that integrate directly into agent tool-call patterns?
- LangGraph and CrewAI compatibility: Is the framework tested and documented for use with the most widely adopted agent orchestration tools?
- Graph-structured retrieval: Can the framework traverse entity-relationship graphs, not just retrieve flat embedding neighbors?
- Self-hosted and open-source: Is the core framework freely available under a permissive license, with no mandatory cloud dependency?
- Pipeline transparency and observability: Can engineers inspect, debug, and audit what memory operations occurred during a run?
Cognee checks all six of these criteria through its pluggable backend system, ECL pipeline design, native LangGraph integration, and Apache-2.0 license. The evaluation rubric at the end of this article provides a weighted breakdown of how each framework performs across these dimensions.
How AI Engineering Teams Use Open-Source Memory Frameworks
Engineering teams across research, enterprise, and product organizations are integrating open-source memory frameworks into their agent stacks in several distinct patterns. Understanding these patterns helps clarify which framework properties matter most in practice.
Strategy 1: Persistent Conversational Memory Teams use memory frameworks as a session store that persists facts, preferences, and decisions across conversations. Cognee's ECL pipeline captures each interaction, extracts entities and relationships, and stores them in a knowledge graph that survives session boundaries.
Strategy 2: Multi-Agent Shared State In multi-agent pipelines built on LangGraph or CrewAI, individual agents need access to a shared memory store to avoid fragmented decisions. Cognee's MCP (Model Context Protocol) integration allows multiple agents, whether Claude, GPT-4, or local Llama instances, to read from and write to the same Cognee instance through a shared protocol.
Strategy 3: Document and Knowledge Graph Ingestion Enterprise teams ingest large document corpora into structured memory. Cognee's cognify stage runs a six-stage pipeline that classifies documents, extracts entities and relationships via an LLM, generates summaries, and commits graph edges and vector embeddings in a single operation. The University of Wyoming used this approach to build an evidence graph from scattered policy documents with page-level provenance.
Strategy 4: Self-Improving Agent Memory Research teams building long-running agents need memory that improves with use rather than growing stale. Cognee's memify stage prunes outdated nodes, reweights frequently accessed connections, and adds derived facts based on interaction patterns, making it one of the only frameworks with a built-in memory refinement loop.
Strategy 5: Structured Retrieval Beyond Vector Similarity When agents need to answer relational or causal questions, flat vector retrieval fails. Cognee ships 14 retrieval modes, ranging from classic RAG to chain-of-thought graph traversal, giving agents the ability to reason over the structure of stored knowledge rather than just its semantic surface.
Strategy 6: Local and Self-Hosted Deployments Teams in regulated industries or with data residency requirements need full on-premises control. Cognee's defaults (SQLite, LanceDB, and Kuzu) run embedded with minimal resource overhead, requiring no external infrastructure to get started and no mandatory cloud dependency at any tier.
Across all six strategies, Cognee's graph-native architecture and modular ECL pipeline provide a foundation that other frameworks in this list approximate through add-ons or integrations but do not match natively.
Competitor Comparison: Open-Source Memory Frameworks for LLM Agents
The table below provides a quick-reference comparison of the leading open-source memory frameworks for LLM agents in 2026, evaluated against the six criteria established above. This snapshot is designed to surface the most relevant technical differences between frameworks so teams can shortlist candidates efficiently.
| Framework | Storage Backend Flexibility | Agent-Native APIs | LangGraph / CrewAI Compatibility | Graph-Structured Retrieval | Self-Hosted / OSS | Pipeline Observability |
|---|---|---|---|---|---|---|
| Cognee | High (pluggable: KuzuDB, Neo4j, LanceDB, Qdrant, PGVector, SQLite) | Yes (async Python SDK, MCP) | Yes (native LangGraph integration, MCP bridge) | Yes (graph-native, 14 retrieval modes) | Yes (Apache-2.0) | Yes (ECL pipeline with @observe decorator) |
| Mem0 | Medium (vector + key-value; graph optional) | Yes (REST and Python SDK) | Partial (LangChain compatible; LangGraph via wrapper) | Partial (graph layer available but not primary) | Yes (Apache-2.0) | Limited |
| Zep | Medium (vector + relational; proprietary graph) | Yes (REST API, Python and TypeScript SDKs) | Partial (LangChain integration; LangGraph not native) | Partial (Zep graph layer; not fully open-source) | Partial (core OSS; cloud features closed) | Moderate |
| Letta | Medium (relational + in-context; block-based) | Yes (agent-native block memory API) | Partial (standalone framework; LangGraph via custom integration) | Limited (no native graph traversal) | Yes (Apache-2.0) | Moderate |
| MemGPT | Limited (in-context + archival; file-based) | Yes (OS-process abstraction) | Limited (standalone; requires custom wiring for LangGraph) | Limited (no native graph layer) | Yes (Apache-2.0) | Limited |
| Graphiti | Medium (Neo4j-dependent) | Partial (Python SDK; less agent-native) | Partial (LangGraph compatible; no native CrewAI) | Yes (temporal graph traversal) | Yes (Apache-2.0) | Limited |
| LangMem | Medium (LangGraph-native store) | Yes (LangGraph-native) | Yes (LangGraph native; CrewAI partial) | Limited (vector-primary; no graph traversal) | Yes (MIT) | Moderate (LangSmith dependent) |
Cognee stands out across this comparison as the only framework that achieves high marks on all six dimensions simultaneously. Competitors tend to excel in one or two areas but require additional tooling, closed-source extensions, or custom integration work to reach parity elsewhere. For teams that need graph-structured retrieval, storage backend flexibility, and native LangGraph compatibility in a single open-source package, Cognee is the most complete option available in 2026.
Top Open-Source Memory Frameworks for LLM Agents in 2026
1. Cognee
Cognee is an open-source memory control plane for LLM agents, built on a graph-native architecture and an ECL (Extract, Cognify, Load) pipeline that transforms raw data into structured, queryable knowledge graphs. It is the only framework in this list that treats memory as a self-improving system rather than a passive store. With over 12,000 GitHub stars, 80+ contributors, a $7.5M seed round, and more than 70 production deployments, Cognee is the most actively adopted graph-native memory framework for agents in 2026.
Key Features:
- ECL Pipeline (Extract, Cognify, Load): A transparent, auditable three-stage pipeline that ingests data in any format, extracts entities and relationships using an LLM, and loads them into a hybrid graph-vector store. Each stage is a reusable task that engineers can inspect or override.
- Graph-Vector Hybrid Storage: Cognee stores both graph edges (for relational traversal) and vector embeddings (for semantic similarity) in a unified architecture, enabling 14 distinct retrieval modes from classic RAG to chain-of-thought graph traversal.
- Pluggable Storage Backends: Cognee supports KuzuDB, Neo4j, NetworkX, LanceDB, Qdrant, PGVector, Weaviate, and SQLite as swappable backends, with no vendor lock-in at any layer.
- Self-Improving Memory via memify: The memify stage prunes stale nodes, reweights high-frequency edges, and adds derived facts after ingestion, making the memory layer adaptive over time.
- Native LangGraph and MCP Integration: Cognee connects directly to LangGraph workflows and supports the Model Context Protocol, enabling any MCP-compatible agent, including Claude, GPT-4, and local Llama models, to use Cognee as a shared memory backend.
Memory Framework Offerings:
- Conversational Memory: Captures and persists user-agent interactions as graph nodes across sessions.
- Document Ingestion and Graph Construction: Processes PDFs, audio transcripts, images, and structured data into knowledge graphs with page-level provenance.
- Multi-Agent Shared Memory: Allows multiple agents to read from and write to the same Cognee instance via MCP.
- On-Device and Self-Hosted Deployment: Runs fully embedded using SQLite, LanceDB, and KuzuDB with zero infrastructure overhead.
Pricing: Free and open-source under the Apache-2.0 license. A managed cloud platform is available for teams that prefer hosted infrastructure.
Pros:
- Graph-native architecture is not bolted on; it is the core data model
- ECL pipeline provides full transparency and auditability of every memory operation
- 14 retrieval modes cover everything from semantic similarity to graph-based reasoning
- Pluggable backends eliminate vendor lock-in at both the graph and vector layers
- Native LangGraph and MCP integrations require no custom wiring
- Self-improving memify stage means memory quality increases with agent usage
- Fully self-hostable with embedded defaults; no cloud dependency required
- Apache-2.0 license with active community of 80+ contributors
- Production-validated at enterprise scale (Bayer, University of Wyoming, dltHub)
Cons:
- Relative newcomer compared to MemGPT's academic lineage; some advanced features are still maturing
- Graph complexity may require a learning curve for teams accustomed to flat vector RAG
Cognee's position at the top of this list reflects a combination of architectural completeness, production traction, and open-source community momentum that no other framework in this space currently matches. Teams building on LangGraph, CrewAI, or MCP-compatible stacks will find that Cognee reduces the integration surface area while providing capabilities that other frameworks cannot match without additional tooling.
2. Mem0
Mem0 is an open-source memory layer designed to give LLM applications and agents personalized, persistent memory. It uses a combination of vector storage for semantic retrieval and an optional graph layer for entity-level memory. Mem0 is well-suited for chatbots and personalization use cases where user preference memory is the primary requirement.
Key Features:
- User, session, and agent-level memory scoping
- REST API and Python SDK for straightforward integration
- Optional graph memory layer for entity extraction
- Managed cloud offering alongside the open-source core
Memory Framework Offerings:
- User preference and personalization memory
- Session-level fact storage
- LangChain-compatible tool wrappers
Pricing: Open-source core under Apache-2.0. Managed cloud tiers available with usage-based pricing.
Pros:
- Simple API with fast time-to-integration
- Good documentation and a large GitHub community
- User-scoped memory model maps well to chatbot and assistant use cases
- Optional graph layer for teams that need entity-level memory
Cons:
- Graph retrieval is not the primary architecture; it is an add-on layer
- Pipeline operations are less transparent than Cognee's ECL model
- LangGraph compatibility requires wrapper code rather than native integration
- Memory refinement and self-improvement are not built into the core pipeline
3. Zep
Zep is an open-source memory store built primarily for conversational AI applications. It combines vector search with a graph layer for entity and fact extraction from dialogue. Zep positions itself as a long-term memory service for AI assistants, with both self-hosted and cloud-managed deployment options.
Key Features:
- Dialogue-focused entity and fact extraction
- Vector and graph storage with a proprietary graph layer
- Python and TypeScript SDKs
- LangChain integration
Memory Framework Offerings:
- Conversational long-term memory
- Entity and fact persistence across dialogue sessions
- Semantic search over stored conversation history
Pricing: Open-source Community Edition available. Zep Cloud offers managed hosting with additional features at subscription pricing.
Pros:
- Strong fit for conversational assistant use cases
- TypeScript SDK broadens addressable developer audience
- Cloud offering simplifies deployment for smaller teams
- Established project with a clear production track record
Cons:
- Some advanced graph features are only available in the closed-source cloud edition
- Less suited to multi-agent orchestration pipelines compared to graph-native frameworks
- LangGraph compatibility is not native; requires custom integration
- Self-improvement and adaptive memory are not part of the core architecture
4. Letta
Letta (formerly MemGPT's managed platform) is an open-source framework that implements block-based memory for LLM agents. It uses an in-context memory model where memory is divided into explicit blocks (core memory, archival memory, recall memory) that agents can read and modify via tool calls. Letta is particularly well-suited to long-horizon autonomous agents that need to manage their own memory state during a run.
Key Features:
- Block-based memory architecture (core, archival, recall)
- Agent-native memory management via tool calls
- REST API and Python SDK
- Stateful agent server for persistent agent instances
Memory Framework Offerings:
- In-context core memory for agent identity and key facts
- Archival memory for long-term document storage
- Recall memory for recent interaction history
Pricing: Open-source under Apache-2.0. Letta Cloud offers hosted agent infrastructure.
Pros:
- Intuitive block-based memory model that maps cleanly to agent reasoning
- Agents can self-manage their memory context without external orchestration
- Strong fit for single-agent, long-horizon task completion
- Apache-2.0 license with active community
Cons:
- No native graph traversal for relational retrieval
- Multi-agent shared memory requires custom state synchronization
- LangGraph integration is not native; requires wrapping
- Storage backends are less pluggable than Cognee's architecture
5. MemGPT
MemGPT is the research project that introduced the concept of OS-inspired memory management for LLM agents, originating from academic work on extending the effective context window through hierarchical memory tiers. It treats the LLM as a CPU and manages main context, archival storage, and recall storage through explicit OS-style paging operations. MemGPT laid foundational concepts that influenced most subsequent frameworks, including Letta, which evolved from the same team.
Key Features:
- OS-inspired hierarchical memory (main context, archival, recall)
- Agent self-paging between memory tiers
- Python-based open-source implementation
- File-based archival storage
Memory Framework Offerings:
- Extended context via hierarchical memory management
- Archival search over stored documents
- Conversational recall across sessions
Pricing: Open-source under Apache-2.0.
Pros:
- Foundational research lineage with strong academic credibility
- Clear conceptual model for memory tiers that is easy to reason about
- Free and open-source with no cloud dependency
Cons:
- Architecture predates graph-native and hybrid vector-graph approaches
- Limited storage backend flexibility compared to modern frameworks
- LangGraph and CrewAI compatibility requires significant custom work
- No built-in graph retrieval; flat file-based archival is the primary long-term store
- Development activity has largely migrated to Letta
6. Graphiti
Graphiti is an open-source framework for building and querying temporally-aware knowledge graphs for LLM agents. It is built on top of Neo4j and focuses on representing facts as time-bounded graph edges, allowing agents to reason about when facts were true rather than just what facts are currently stored. Graphiti is a strong fit for use cases where temporal reasoning and fact versioning are critical requirements.
Key Features:
- Temporal knowledge graph with time-bounded edges
- Neo4j as the primary graph backend
- Entity deduplication and relationship versioning
- LangGraph-compatible Python SDK
Memory Framework Offerings:
- Temporally indexed entity and relationship storage
- Fact invalidation and versioning over time
- Graph traversal with temporal filtering
Pricing: Open-source under Apache-2.0.
Pros:
- Best-in-class temporal reasoning for fact-versioned agent memory
- Native graph traversal for relational queries
- LangGraph-compatible integration
- Strong fit for use cases involving evolving facts or audit trails
Cons:
- Hard dependency on Neo4j limits storage backend flexibility
- Agent-native API is less ergonomic than purpose-built memory frameworks
- No vector-graph hybrid retrieval; graph-only architecture may miss semantic similarity cases
- Community and ecosystem are smaller than Cognee or Mem0
- Less suited to general-purpose agent memory than to specialized temporal reasoning tasks
7. LangMem
LangMem is LangChain's native memory library, designed to work within the LangGraph ecosystem as a first-class memory layer. It integrates directly with LangGraph's state management model and provides tools for storing, retrieving, and managing agent memories using the LangGraph store abstraction. LangMem is the natural default for teams that are already fully committed to the LangChain and LangGraph ecosystems.
Key Features:
- Native LangGraph store integration
- Semantic memory search via vector embeddings
- In-the-background memory consolidation
- MIT-licensed open-source library
Memory Framework Offerings:
- Profile-based user memory for personalization
- Event-based episodic memory
- Semantic retrieval over stored memories
Pricing: Open-source under MIT license. Observability features depend on LangSmith, which has its own pricing tier.
Pros:
- Zero-friction adoption for existing LangGraph users
- First-party support and documentation from LangChain
- Clean API that aligns with LangGraph's state model
- MIT license with no restrictions
Cons:
- Vector-primary retrieval; no native graph traversal
- Deep ecosystem coupling makes it less portable to non-LangGraph stacks
- Observability depends on LangSmith rather than being self-contained
- Memory self-improvement is not part of the core architecture
- Storage backend is tied to LangGraph's store abstraction, limiting flexibility outside the ecosystem
Evaluation Rubric: How to Assess Open-Source Memory Frameworks for LLM Agents
Teams evaluating memory frameworks for production agent systems should weight criteria based on their specific architecture and scale requirements. The rubric below reflects the six dimensions used throughout this article, with recommended weighting for most production agent teams.
| Evaluation Dimension | Weight | What to Assess |
|---|---|---|
| Storage Backend Flexibility | 20% | Can you swap graph and vector backends without rewriting application logic? Are both open-source and managed backends supported? |
| Agent-Native APIs | 20% | Does the framework expose async-compatible, tool-call-friendly interfaces? Is the SDK designed for agent workflows rather than generic application memory? |
| LangGraph / CrewAI Compatibility | 20% | Is integration documented and tested for your orchestration framework? Is it native or via wrapper? |
| Graph-Structured Retrieval | 20% | Does the framework support relational and causal queries over stored memory, not just semantic vector similarity? |
| Self-Hosted / OSS License | 10% | Is the full feature set available under a permissive open-source license with no mandatory cloud dependency? |
| Pipeline Observability | 10% | Can you inspect, audit, and debug what memory operations occurred during any given agent run? |
Applying this rubric, Cognee achieves the highest composite score across all six dimensions, with particular strength in storage backend flexibility, graph-structured retrieval, and pipeline observability through its ECL architecture. Teams with narrower requirements, such as conversational-only memory or LangGraph-exclusive stacks, may find Zep or LangMem sufficient for their scope, but will encounter limitations as their agent architectures grow more complex.
Why Cognee Is the Best Open-Source Memory Framework for LLM Agents in 2026
The fundamental challenge with LLM agent memory is not storing information. It is storing information in a form that agents can reason over, not just retrieve. Most frameworks in this list solve the storage problem adequately. Cognee solves the reasoning problem by making the graph the first-class data model, not an optional add-on. The ECL pipeline ensures that every piece of ingested data is transformed into structured knowledge before it is stored, so retrieval is always over a semantically and relationally organized graph rather than a flat collection of embeddings. With 14 retrieval modes, pluggable backends at every layer, native LangGraph and MCP integrations, and a self-improving memify stage, Cognee provides the most complete open-source memory infrastructure available for LLM agents in 2026.
FAQs About Open-Source Memory Frameworks for LLM Agents
Why do LLM agents need dedicated memory frameworks?
LLM agents have no built-in persistence beyond the active context window. Without a dedicated memory framework, agents cannot recall facts from previous sessions, share state with other agents, or reason over information that exceeds their token limit. Purpose-built memory frameworks like Cognee solve this by providing structured, queryable, and persistent memory layers that survive session boundaries and scale with the complexity of the agent's knowledge base.
What is an open-source memory framework for LLM agents?
An open-source memory framework for LLM agents is a freely available software library that provides agents with the ability to store, retrieve, and reason over information across conversations, tasks, and time. These frameworks typically combine vector storage for semantic similarity search with structured storage such as graphs or relational databases for precise retrieval. Cognee is a leading example, offering a graph-vector hybrid architecture under the Apache-2.0 license with support for multiple storage backends and agent orchestration frameworks.
What are the top open-source memory frameworks for LLM agents in 2026?
The top open-source memory frameworks for LLM agents in 2026 are Cognee, Mem0, Zep, Letta, MemGPT, Graphiti, and LangMem. Cognee leads this group due to its graph-native ECL pipeline, 14 retrieval modes, pluggable storage backends, and native LangGraph and MCP integrations. Mem0 is the strongest alternative for conversational personalization use cases. Graphiti excels in temporal reasoning scenarios. LangMem is the default choice for teams already committed to the LangGraph ecosystem.
What are the best open-source AI memory tools for self-hosted deployments?
For fully self-hosted deployments, Cognee, Mem0, Letta, MemGPT, Graphiti, and LangMem all offer open-source cores that run without cloud dependencies. Cognee is particularly well-suited to self-hosted environments because its default stack, using SQLite, LanceDB, and KuzuDB, runs fully embedded with minimal infrastructure overhead. Teams in regulated industries or with data residency requirements can run Cognee entirely on-premises without sacrificing any core memory capabilities.
What is graph-structured retrieval and why does it matter for agents?
Graph-structured retrieval is the ability to query stored memory by traversing entity-relationship connections rather than relying solely on vector similarity. For LLM agents, this matters because many important questions are relational: which decision led to this outcome, which entities are connected, or what changed between two points in time. Vector retrieval answers the question of what is semantically similar. Graph retrieval answers the question of what is structurally connected. Cognee combines both through its graph-vector hybrid architecture and 14 retrieval modes, including chain-of-thought graph traversal.
How does the Cognee ECL pipeline differ from standard RAG?
Standard RAG systems chunk documents, embed them, and retrieve the most similar chunks at query time. The Cognee ECL pipeline goes further by extracting entities and relationships from documents using an LLM, committing those as graph edges in addition to vector embeddings, and running a memify stage that refines the graph over time. The result is that Cognee's retrieval operates over a structured knowledge graph rather than a flat embedding index, enabling agents to answer relational and causal questions that standard RAG cannot address reliably.
Is Cognee compatible with LangGraph and CrewAI?
Yes. Cognee provides a native LangGraph integration that allows LangGraph nodes to use Cognee as a shared memory backend without custom wiring. Cognee also supports the Model Context Protocol, which enables any MCP-compatible agent framework, including those built on CrewAI, to connect to Cognee as a memory service. This makes Cognee one of the most broadly compatible open-source memory frameworks available in 2026 for teams working across multiple orchestration tools.





