Index Agentica

Memory layers for AI agents

Mem0, LangMem, the Claude memory tool, Graphiti, Zep, Cognee and Letta compared on memory model, who writes memories, self-hosting and license, hosted pricing, MCP servers, SDK languages and framework ties.

Type
Comparison
Author
Agentica Author
Published
Last verified

Comparison

Memory layers for AI agents
EntryMemory modelHow memories are writtenSelf-host and licenseHosted pricingMCP serverSDK languagesFramework ties
Mem0Extracted facts in a vector store, scoped by user_id, agent_id and run_id. Graph memory has been removed from the open-source package and is Platform-onlyYour app calls add() and an LLM extracts facts. The Platform adds background consolidation (Dream), memory decay and webhooksApache-2.0. Use as a library or run the self-hosted server with docker compose (auth on by default)Hobby free (10k adds and 1k retrievals per month); Starter $19/mo; Pro $249/mo. Graph memory and Dream are listed on Pro and aboveHosted at https://mcp.mem0.ai/mcp, with OAuth sign-in or an API key as a bearer tokenPython (mem0ai) and Node (mem0ai), plus a CLIFramework-agnostic, with a LangGraph integration
LangMemMemories stored as items in a LangGraph BaseStore (for example InMemoryStore or AsyncPostgresStore), searched by namespaceBoth: hot-path manage and search tools the agent calls, and a background memory manager. Also does prompt optimizationMIT library; you run it with your own storeNo hosted service of its ownNone foundPythonBuilt for LangGraph, through its long-term memory store
Claude Memory ToolFiles under a /memories directory that Claude reads and editsIn the conversation: Claude issues view, create, str_replace, insert, delete and rename commands, and your app executes themClient-side tool, so storage is whatever backend you implement. Your code must reject paths outside /memoriesNo separate fee; it is a tool type in the Claude APINot applicable; it is a Claude API tool (type memory_20250818)Helpers in Python, TypeScript, C# and Java; a local filesystem helper in Python and TypeScript. No helper in Go or RubyClaude 4 and later models only
GraphitiTemporal knowledge graph with bi-temporal tracking; outdated facts are invalidated, not deletedYour app ingests episodes and Graphiti extracts entities and facts incrementallyApache-2.0, self-hosted only. Needs Neo4j, FalkorDB or Amazon NeptuneNone for Graphiti itself; Zep is the managed product from the same teamExperimental Graphiti MCP server: HTTP at localhost:8000/mcp/ or stdio, Docker Compose with FalkorDB by defaultPython 3.10+Framework-agnostic
ZepManaged context graph built on a proprietary engine (temporal knowledge graph)Your app sends messages or data as episodes; Zep builds the graph in the backgroundManaged SaaS or BYOC; proprietary. The getzep/zep repo now holds examples onlyFree trial 10k credits/month; Flex $125/mo (50k credits); Flex Plus $375/mo (200k). One credit per episode up to 350 bytes; retrieval and storage freeContext MCP server at https://api.getzep.com/mcp, with end-user sign-in through your IdP; seats vary by planPython, TypeScript and GoFramework-agnostic
CogneeCombined graph, vector and relational memoryYour app calls remember, recall and improve; can run on local models when no LLM key is setApache-2.0. API, UI and MCP run locally. Using Postgres as the graph store is for demos; the production option is licensedCloud Free $0 (1M tokens, 1 workspace); Standard $1 per 1M tokens plus $5 per extra workspace; Enterprise BYOCCognee MCP server (Docker quickstart, port 8001 by default) for Claude Code, Cursor, Codex and othersPython; also an OpenClaw plugin on npmFramework-agnostic
LettaMemFS: a git-versioned memory filesystemThe agent edits its own memory in the conversation, plus background dreamingApache-2.0 (letta-code). Runs locally without an account, or as a self-hosted App Server. The old letta-ai/letta server is retiredFree (BYOK, up to 3 stateful agents); Pro $20/mo (up to 20 agents); developer API plans are usage-basedHosted Letta MCP server; agents can also connect to stdio, HTTP and SSE MCP serversTypeScript (Agent SDK); CLI on npm (Node 22.19+)A full stateful agent runtime, not a plug-in layer

Verdict: Inside LangGraph, use LangMem. On Claude, the memory tool is the simplest option and the data stays in your storage. Mem0 is the most portable layer, with a free tier and a hosted MCP endpoint, but graph memory is now paid-only. For facts that change over time, use Graphiti (self-hosted) or Zep (managed, metered per episode). Cognee mixes graph and vector memory and runs on local models. Letta is a whole agent runtime that edits its own memory.

How to read this table

Ask two questions first: what shape does a memory take, and who writes it? File-based memory (Claude memory tool, Letta's MemFS) lets the model curate plain text itself. A fact-extraction layer (Mem0, LangMem) turns conversations into short searchable facts. A temporal graph (Graphiti, Zep, Cognee) also records how facts relate and when they stopped being true.

Writing memories during the conversation (the agent calls a tool) makes them visible and easy to debug, but it adds latency and costs tokens. Background writing (a manager, consolidation or "dreaming" job) keeps the response fast, but the memories show up later. LangMem, Mem0 Platform and Letta offer both.

Standout findings

Choosing

For a step-by-step build with these tools, see Give an agent long-term memory. If you only need a vector store you control, pgvector or Qdrant under your own extraction logic may be enough. Supermemory is another hosted option that this table does not cover.

Directory entries in this comparison

Related

Sources

Machine-readable