
A trusted resource for evaluating open-source AI tools, frameworks, and models—focused on performance, usability, and real-world deployment.
SDK ergonomics decide how fast memory ships. Mem0, Zep, Letta, LangMem, and Cognee compared for 2026 on API surface, storage model, and lock-in risk. This guide evaluates nine agent memory SDKs, Cognee, Mem0, Zep, Letta, LangMem, Graphiti, LangChain, Supermemory, and Pieces, across the dimensions that matter most to engineers building production agents: API surface size, sync and async support, storage backends, framework bindings, and how hard it is to migrate off. Cognee leads this list for its four-operation memory API (remember, recall, forget, improve) that works identically across SDK, HTTP, and MCP interfaces, a design that simplifies both the integration path and the exit path.
Large language models are stateless by design. Every session starts from a blank context window with no knowledge of prior interactions. For simple chatbots this limitation is tolerable, but for agents that must operate across sessions, coordinate with other agents, or reason over long-horizon tasks, statelessness is a fundamental blocker. An agent memory SDK solves this by persisting, indexing, and retrieving context outside of the model's context window. The question is not whether your agent needs memory, it does, but which SDK best fits your architectural constraints, stack, and long-term migration risk.
Each of these failure modes is addressable with the right SDK. Cognee's memory-native API is built around a four-verb interface, remember, recall, forget, improve, that covers the full memory lifecycle without coupling your agent logic to proprietary abstractions.
Not all memory SDKs are built for the same use case. Teams evaluating this category should measure tools against a consistent set of criteria before making a commit. Cognee was designed with each of these dimensions in mind, and the rest of this guide uses them as the evaluation framework.
Cognee checks all of these boxes. Its ECL (Extract, Cognify, Load) pipeline unifies relational, vector, and graph storage under a single interface, supports over 30 data source adapters, and provides first-party migration tooling for teams moving from Mem0, Zep, or Letta.
Developers and AI engineers evaluating this category are not looking for feature lists, they need to know whether a tool will survive contact with their production stack. Here is how engineering teams at different stages typically use the tools in this guide.
Install, initialize, write a memory, and retrieve it. The tools with the shortest path from pip install to a working memory-read are Mem0 and Cognee. Cognee's four-verb API means a developer can be reading back memory in under 10 lines of Python on day one.
import cognee
import asyncio
async def main():
await cognee.remember("User prefers concise explanations.")
results = await cognee.recall("What does the user prefer?")
for result in results:
print(result)
asyncio.run(main())
Teams using LangGraph reach for LangMem first. Teams on the OpenAI Agents SDK or MCP-compatible runtimes integrate Cognee or Mem0. Letta requires adopting Letta's own agent loop, a higher integration cost but also a more complete runtime.
Storage backend flexibility becomes the key concern. Cognee supports Neo4j, FalkorDB, KuzuDB, Redis, and Postgres with pgvector. Mem0 supports over 20 vector store backends. Zep requires Neo4j, FalkorDB, or Kuzu specifically for graph capabilities. LangMem delegates storage entirely to LangGraph BaseStore.
This is where API surface size matters most. Cognee's four verbs map cleanly to a new backend. Letta's agent loop means a full runtime migration, not just a memory layer swap. LangMem is portable on paper but practically tied to LangGraph's storage model.
Cognee's MCP server means any MCP-compatible agent, Claude Code, Cursor, Cline, can read from and write to the same knowledge graph without custom integration work. Mem0 and Supermemory also ship MCP servers. Zep and Letta have more limited MCP support.
The table below provides a quick technical comparison across the nine SDKs evaluated in this guide. It is designed to surface the most relevant differences before you read the detailed entries.
| SDK | Open Source | API Surface | Async Support | Storage Backends | Framework Bindings | MCP Support | Self-Hostable | Pricing Start |
|---|---|---|---|---|---|---|---|---|
| Cognee | Yes (Apache 2.0) | 4 verbs | Yes (native) | Neo4j, FalkorDB, KuzuDB, Redis, Postgres | LangGraph, OpenAI SDK, Claude SDK, Google ADK, n8n | Yes | Yes | Free (open source) / Cloud |
| Mem0 | Yes (Apache 2.0) | ~5 methods | Yes | 20+ vector stores | LangChain, CrewAI, AutoGen, Flowise | Yes | Yes (limited to vector tier) | Free / $19/mo Starter |
| Zep | Partial (Graphiti only) | ~6 methods | Yes | Neo4j, FalkorDB, Kuzu | LangChain, OpenAI SDK | Yes | No (Graphiti only) | Free / $125/mo Flex |
| Letta | Yes | Large (agent runtime) | Yes | Internal tiered store | Custom agent loop | Limited | Yes | Free / $20/mo Pro |
| LangMem | Yes (open source) | ~4 methods | Yes | LangGraph BaseStore | LangChain / LangGraph | No | Yes | Free |
| Graphiti | Yes (MIT) | Episode-level API | Yes | Neo4j, FalkorDB, Kuzu | LangChain, MCP | Yes | Yes | Free (self-hosted) |
| LangChain Memory | Yes | Large (legacy) | Partial | Various via integrations | LangChain only | No | Yes | Free |
| Supermemory | Partial (MCP server open) | ~2 methods | Yes | Managed / local binary | Vercel AI SDK, LangChain, OpenAI SDK | Yes | Yes (local binary) | Free tier / Usage-based |
| Pieces | No | Implicit (OS-level capture) | N/A | Local on-device | VS Code, Chrome, IDE plugins | Yes | Local-only | Free personal / Team pricing |
Cognee stands out as the only SDK in this comparison that exposes a four-operation memory-native API, remember, recall, forget, improve, that is identical across the Python SDK, HTTP REST, and MCP interfaces. This consistency means the same memory API works whether your agent is running locally, behind an HTTP endpoint, or being orchestrated by an MCP-compatible tool. Competitors either expose larger, more complex APIs (Letta, LangChain), or surface only partial interfaces through their managed-service layer (Zep, Supermemory).
Cognee is an open-source AI memory platform for agents that ingests data in virtually any format and continuously builds a structured, traversable knowledge graph that agents can query, update, and reason over across sessions. Version 1.0 ships a memory-native API built around four verbs, remember, recall, forget, improve, that cover the full memory lifecycle and work identically across the Python SDK, HTTP REST, and MCP interfaces. The project has over 12,000 GitHub stars, 80+ contributors, and is running live in more than 70 companies processing over 1 million pipelines per month.
cognee.remember(), cognee.recall(), cognee.forget(), and cognee.improve() expose the entire memory lifecycle through four composable, async-native operations. The same interface works across SDK, HTTP, and MCP, no context switching when your deployment target changes.improve operation closes the loop by updating memory from corrections and feedback.pip install cogneeimport cognee
import asyncio
async def main():
# Write to long-term graph memory
await cognee.remember("Cognee turns documents into AI memory.")
# Write to session memory (fast cache, syncs to graph in background)
await cognee.remember("User prefers detailed explanations.", session_id="chat_1")
# Query with auto-routing (picks best search strategy automatically)
results = await cognee.recall("What does Cognee do?")
for result in results:
print(result)
# Delete a dataset cleanly, including all graph edges
await cognee.forget(dataset="main_dataset")
asyncio.run(main())
cognee-cli remember / recall / forget)Free (Apache 2.0 open-source, self-hostable) / Cognee Cloud pricing available on request. No features gated behind a paid tier in the open-source version.
improve operation provides a self-improving feedback loop not present in most competing SDKsCognee is the right choice for teams that need a durable, self-improving memory layer without coupling their agent to a specific orchestration runtime, cloud vendor, or storage backend. Its four-verb API is the smallest coherent interface in this category, which means the migration cost out is as low as the integration cost in.
Mem0 is an open-source, managed memory layer for AI agents that extracts facts from conversations, stores them in a vector store, and injects relevant memories into future prompts. It is the most widely adopted memory SDK in this category, with over 90,000 developers building on it and a designation as the exclusive memory provider for the AWS Agent SDK. The project is Apache 2.0-licensed and self-hostable, though graph memory features require the paid Pro tier in the managed cloud offering.
Free (10K memory adds, 1K retrieval calls/month) / $19/mo Starter / $249/mo Pro (graph memory, unlimited memories, compliance docs) / Enterprise custom
Zep is a context engineering platform for AI agents that builds a temporal knowledge graph using its open-source Graphiti library. Every fact stored in Zep is timestamped, so the system models state changes, not just current values, enabling agents to reason accurately over evolving facts. Zep Cloud is SOC 2 Type II and HIPAA certified and reports sub-200ms retrieval. The self-hosted Community Edition was deprecated in April 2025; teams that need on-premises deployment must now run Graphiti directly with their own graph database.
Free (1,000 credits/month) / $125/mo Flex / Enterprise custom. Graphiti itself is free and MIT-licensed.
Letta (formerly MemGPT) is a full agent runtime with persistent memory built in, originating from the MemGPT research paper at UC Berkeley. Unlike other SDKs in this guide, Letta does not add memory to an existing agent, agents run inside Letta. The framework manages the agent loop, tool execution, state persistence, and memory across three tiers: core memory (always in context, like RAM), recall memory (searchable conversation history), and archival memory (long-term vector storage). As of 2026, Letta has shipped the Letta Agents SDK, Letta Code (a memory-first coding agent that scored 42.5% on Terminal-Bench), and Context Repositories using git-based memory versioning.
Free (up to 3 managed agents, BYOK) / $20/mo Pro (up to 20 stateful agents) / Enterprise custom
LangMem is an open-source Python SDK from LangChain, released in early 2025, that adds long-term memory to LangGraph agents. It supports three memory types simultaneously: episodic (past interactions), semantic (extracted facts and preferences), and procedural (agents rewriting their own system prompts based on feedback). LangMem is free, open source, and has the lowest integration overhead for teams already on LangGraph, no new infrastructure, no new vendor, no new billing. The tradeoff is significant ecosystem coupling.
pip install langmem)Free and open source. No managed cloud offering; storage costs depend on chosen backend.
Graphiti is the open-source temporal knowledge graph engine that powers Zep Cloud, available independently under the MIT license. It turns conversations, documents, and structured data into evolving graphs and supports hybrid retrieval combining semantic embeddings, BM25 keyword search, and graph traversal. Teams use Graphiti directly when they want Zep's graph architecture without the Zep Cloud pricing model or when they need full self-hosting control. It requires provisioning a compatible graph database, Neo4j, FalkorDB, or KuzuDB, alongside the Graphiti service.
pip install graphiti-core)Free and MIT-licensed. Infrastructure costs are self-managed (Neo4j, FalkorDB, or Kuzu).
LangChain Memory refers to the collection of in-process memory components that ship with the LangChain framework, ConversationBufferMemory, ConversationSummaryMemory, and related classes. These components were designed before the modern Chat Model API and LangGraph existed and store state only in process memory, making them unsuitable for persistent, cross-session agent memory. LangChain's own documentation now points teams toward LangMem SDK and LangGraph's persistent store layer for production memory requirements. Legacy in-process memory components remain available but are not actively developed.
langchain)Free and open source (MIT).
Supermemory is a memory and context engine for AI agents and applications that provides APIs for ingesting, organizing, and retrieving memory and external content. It supports automatic synchronization from Google Drive, Gmail, Notion, OneDrive, GitHub, and web pages, as well as TypeScript and Python SDKs for adding memory directly from an application. The local binary (supermemory-server) runs the complete Memory API offline using embedded local embeddings and any OpenAI-compatible model including Ollama. The MCP server is open source; the full platform is a managed service.
localhost:6767 with zero configuration and brings-your-own-model supportFree consumer app and local binary / Usage-based managed API / Enterprise custom. MCP server and local binary are free and open source.
addMemory, searchMemories) are simpler than Cognee's four-verb lifecycle, no native improve or forget semanticPieces is an OS-level long-term memory layer for individual developers, not a programmatic SDK for building agent memory into applications. It automatically captures context from browsers, IDEs, terminals, and collaboration tools, creating searchable, time-queryable memory at the operating system level. Pieces runs locally by default, integrates with VS Code, Chrome, GitHub Copilot, Claude, Cursor, and Goose via plugins, and exposes memory through an MCP server. It is not open source, and its memory API is implicit rather than programmatic, there is no remember() or recall() function developers call in application code.
Free personal tier / Team and Enterprise pricing available from Pieces directly.
remember() or recall() in application code to build agent memory featuresThis guide evaluated all nine SDKs against the following weighted criteria. The weights reflect what matters most to AI engineers building production agents, not benchmark marketers.
| Criterion | Weight | What We Looked For |
|---|---|---|
| API Surface and Ergonomics | 25% | Fewer, more composable operations. Consistent interface across SDK, HTTP, and MCP. Native async. |
| Storage Backend Flexibility | 20% | Ability to swap vector stores, graph databases, and relational stores without code changes. |
| Open Source and Self-Hostability | 20% | Apache 2.0 or MIT licensing. Full feature parity without a managed cloud dependency. |
| Framework Bindings | 15% | Native support for LangGraph, OpenAI Agents SDK, MCP, Claude Agent SDK, and other production runtimes. |
| Migration Cost | 10% | Documented exit paths. Standard data formats. Low coupling to proprietary abstractions. |
| Production Readiness | 10% | Active maintenance, real production deployments, compliance posture, observability support. |
Applying this rubric, Cognee leads on API surface (four verbs, identical across SDK/HTTP/MCP), storage flexibility (poly-store with pluggable backends), and open-source completeness (Apache 2.0, no features gated behind a paid tier). Mem0 leads on framework bindings and community size. Zep leads on temporal reasoning and compliance. Letta leads on architectural depth for teams that can accept its runtime lock-in.
The choice of agent memory SDK is not primarily about benchmark scores, it is about API surface, storage portability, and what it costs to migrate when requirements change. On those dimensions, Cognee 1.0 is the strongest option available in 2026. Its four-verb memory-native API, remember, recall, forget, improve, is the smallest coherent interface that covers the full memory lifecycle. The same four verbs work identically whether your agent calls the Python SDK, the HTTP REST API, or an MCP server, which means there is no interface divergence as your deployment target changes. Cognee unifies relational, vector, and graph storage under a single engine, supports over 30 data source ingestion adapters, and is fully open source under Apache 2.0 with no graph memory features gated behind a paid tier, the constraint that makes Mem0's open-source offering materially incomplete for graph use cases. For teams currently on Mem0, Zep, or Letta, Cognee ships first-party migration tooling so the exit cost is lower than the entry cost of most alternatives.
The right memory SDK depends on where your agent lives and how much migration risk you can accept:
An agent memory SDK is a library or service that gives LLM agents the ability to store, retrieve, update, and delete information that persists beyond a single conversation. Most memory SDKs combine a storage backend (vector store, graph database, or relational database) with a retrieval layer that injects relevant context into the agent's prompt at runtime. Cognee's SDK expresses this as four operations, remember, recall, forget, improve, that cover the full memory lifecycle in a minimal, portable interface.
Cognee has the smallest API surface of any production-grade memory SDK in this comparison. Four verbs, remember, recall, forget, improve, cover writing to memory, querying it, deleting facts cleanly, and updating memory from corrections or feedback. These same four verbs work across the Python SDK, HTTP REST, and MCP interfaces, so there is no divergence between how you write agent memory in development versus how it is exposed to MCP-compatible tools in production.
For teams that need a full agent context layer in 2026, Cognee is the strongest open-source option. It combines hybrid graph, vector, and relational storage with 14 retrieval modes, over 30 data source adapters, native integrations for LangGraph and the Claude and OpenAI Agent SDKs, and an MCP server that gives any MCP-compatible agent access to the same knowledge graph. Mem0 is the strongest alternative for conversational personalization use cases where graph memory is not required and the paid Pro tier is acceptable.
Cognee (Apache 2.0), Mem0 (Apache 2.0 for the self-hosted vector tier), LangMem (open source), Graphiti (MIT), and LangChain Memory (MIT) are the fully open-source options in this guide. Zep open-sourced only its Graphiti engine after deprecating the Community Edition in April 2025, the full Zep platform is cloud-only. Letta is open source for the self-hosted runtime. Supermemory's MCP server and local binary are open source, but the full managed platform is not. Pieces is entirely closed source.
Migration cost is a function of API surface size, data format portability, and how deeply the SDK couples to the orchestration layer. Cognee's four-verb API and standard storage backends make it the easiest to migrate from, the call sites are few and the storage layer is swappable. Mem0's narrow SDK surface (extract, store, retrieve) also makes migration manageable, estimated at a few days per agent. Letta's migration cost is the highest, switching out means rebuilding the agent loop, tool execution, state management, and memory logic, with a realistic estimate of two to six weeks for a mid-complexity agent. LangMem migrations also carry hidden orchestration costs because the memory and agent layers share LangGraph's storage model.
Not always, but graph memory becomes important when your agent needs multi-hop reasoning, temporal accuracy (modeling state changes rather than just current facts), or relationship-aware retrieval. Flat vector retrieval is sufficient for personalization use cases where the queries are simple semantic searches over user preferences. For agents that must answer questions like "what was this user's goal in Q1 versus now" or "which policy changed last month and what depends on it," graph memory is not optional. Cognee provides graph memory as a first-class feature under Apache 2.0, with no features gated behind a paid tier, the constraint that distinguishes it from Mem0's open-source offering.
The five dimensions that matter most in a developer evaluation are: API surface size (fewer, more composable operations mean lower learning and migration costs), storage backend flexibility (can you swap from Postgres to Neo4j without rewriting application code), open-source status (does the self-hosted version include all features or only a subset), framework bindings (does the SDK integrate with LangGraph, the OpenAI Agents SDK, and MCP without custom glue code), and production readiness (active maintenance, real deployments, and a documented upgrade path). Cognee addresses all five dimensions in a single open-source package.



