Best AI Memory Framework: How to Choose by Use Case

9 min read

Which AI memory framework should you pick? A decision guide by use case: Mem0, Zep, Letta, Cognee, LangMem, Supermemory, Hindsight and Honcho, with prices.

The best AI memory framework depends on what your agent needs to remember and where you need it to run. For chat personalization, Mem0 or Supermemory are the quickest to add. For facts that change over time, Zep or Graphiti. For LangGraph apps, LangMem. For long histories, coding agents and agents that learn from experience, Hindsight. Test two on your own data before you commit.

This page is the advice. For the raw facts on each system (license, storage, retrieval, benchmarks) see the LLM memory comparison table. For background on memory types, start with AI agent memory explained.

What is the best AI memory framework for your agent?

An AI memory framework is a library or service that stores what an agent learns from interactions and returns the relevant parts on later calls. It’s also called a memory layer, memory API or memory provider. The terms overlap: a “layer” sits between your app and the LLM, an “API” or “provider” is usually the hosted version of the same thing.

Here’s the short answer by situation. All facts were checked against each project’s README and docs on 8 October 2026.

If you need…Start withAlso consider
Per-user memory for a chatbot or assistant, fastMem0Supermemory, Memobase
Facts that change, with “what was true when”Zep (managed) or Graphiti (self-hosted)Hindsight
Long histories (millions of tokens per user)HindsightMem0
Every feature self-hosted, no paid tierHindsightGraphiti
Memory inside a LangGraph agentLangMemAny provider with a LangGraph integration
An agent that edits and manages its own memoryLettaLangMem (hot-path tools)
A knowledge graph built from docs, code and ticketsCogneeSupermemory (connectors), Graphiti
An agent that learns from past tasks and reflectsHindsightLetta, MemOS
Memory for coding agents (Claude Code, Codex, Cursor)HindsightSupermemory, Cognee, Mem0
Modeling many people and agents in one appHonchoZep
Local, human-readable notes your AI shares with youBasic MemoryLetta Code (MemFS)

Do you need a memory framework at all?

Not always. A framework adds an LLM call per write, a database, and another thing to operate. Skip it if:

  • Sessions are short and nothing needs to carry over.
  • The full conversation fits comfortably in the context window and cost isn’t a concern.
  • What the agent needs is a fixed set of documents. That’s RAG, not memory; see RAG vs agent memory.

You need one when users come back across sessions, when conversations outgrow the window, or when the agent should apply what it learned before. The LongMemEval paper found commercial chat assistants and long-context LLMs lost about 30% accuracy when recalling information across long interactions, which is the gap memory systems try to close.

Also check what your agent framework already gives you. LangGraph has short-term (thread) and long-term (store) memory built in. CrewAI, the OpenAI Agents SDK and Microsoft Agent Framework each have their own memory options; see CrewAI long-term memory, OpenAI Agents SDK memory and Microsoft Agent Framework memory. Java teams on Spring AI get a chat memory window with JDBC, Redis or Neo4j storage (Spring AI chat memory), and Dify’s Chatflow apps keep per-conversation history in each LLM node (Dify LLM memory notes). A dedicated framework is worth it when the built-in option can’t extract facts, handle updates, or share memory across agents.

Five questions that decide the choice

  1. Must it run on your infrastructure? If yes, rule out hosted-only products and check the license (Apache-2.0 and MIT are permissive; AGPL-3.0 has network-use obligations).
  2. What shape is the memory? User preferences and facts suit extraction into a vector store. Relationships and changing facts suit a graph.
  3. Who decides what to save? Your code (automatic, predictable) or the agent through tool calls (flexible, adds latency and failure modes).
  4. What framework are you on? Native integrations save weeks. Many systems ship LangGraph and CrewAI integrations, but check the list for yours.
  5. What does a wrong memory cost you? In support or health use cases, provenance and the ability to delete matter more than benchmark points.

Best memory framework by use case

Personalized chat assistants and customer support

Mem0 is built for this. Its README targets assistants, customer support and personalization, with user, session and agent scopes. You can use it as a Python/npm library, a self-hosted server (Postgres + pgvector), or the hosted platform. One caveat: graph memory was removed from the open-source SDK in v3 and is now a platform feature, and Mem0 says its published benchmark scores reflect platform-only optimizations.

Supermemory fits if you also want document search and connectors in the same API. Its profile() call returns a static and dynamic user profile, which you can drop into a system prompt. Memobase takes a profile-first approach too, with a user profile and event timeline kept per user. More on this setup in how to add memory to a chatbot.

Facts that change over time

Zep and its open-source core Graphiti store facts in a temporal knowledge graph. Each fact has a validity window, so when a user changes jobs the old fact is marked superseded, not deleted. That supports questions like “where did she work in March?” Graphiti is self-hosted only and needs a graph database (Neo4j, FalkorDB or Amazon Neptune). Zep is the managed version with users, threads and a dashboard. Zep’s own README puts it plainly: choose Graphiti “if you’re comfortable building/operating the surrounding system.” See what is Zep memory and temporal reasoning in AI memory.

Agents built on LangGraph

LangMem gives LangGraph agents memory tools (create_manage_memory_tool, create_search_memory_tool) and a background memory manager, and stores data in LangGraph’s store. It’s MIT licensed and adds no new service to run if you’re already on LangGraph. It’s the least work in that stack, though it’s tied to LangGraph’s storage model.

Agents that manage their own memory

Letta (formerly MemGPT) is a full agent harness, not a plug-in library. Agents rewrite their own memory, skills and prompts, and memory lives in MemFS, a git-backed filesystem. Background “dreaming” reviews recent conversations to update memory. Choose it if you want the agent runtime and memory as one product. If you only want to add memory to an existing agent, a memory layer is a smaller change. Letta’s current code is in letta-ai/letta-code; the older Letta V1 API server is archived. See Letta AI guide, Mem0 vs Letta and Letta vs LangChain memory.

Knowledge from documents, code and tickets

Cognee turns documents, code and conversations into a knowledge graph with remember, recall, improve and forget operations. It runs locally on file-based defaults and can build memory with no LLM key, using small local models. It also imports memory from Mem0, Letta, Zep and Graphiti. Note that running the full graph on Postgres is labeled a demo feature, with the production version sold as a licensed product. Supermemory covers similar ground with managed connectors (Google Drive, Notion, Gmail, GitHub).

Agents that should learn from experience

Hindsight is aimed at agents that improve over time rather than only recalling chat history. It separates world facts from the agent’s own experiences, consolidates them into observations (beliefs with supporting evidence), and offers a reflect call that reasons over memory to answer harder questions. It’s MIT licensed, runs from one Docker command or embedded in Python, and has a usage-based cloud. Its README says it “may be overkill” for simple workflows like basic n8n automations, which is a fair warning: if you only need user preferences, Mem0 or Supermemory are simpler.

It also leads Mem0 on long histories. On BEAM, a test with up to 10 million tokens of history, it scores 73.9 at 1M tokens and 64.1 at 10M, versus Mem0’s 64.1 and 48.6 (Mem0’s own comparison). On LongMemEval the two are close (94.6 vs 94.4), and Mem0 is slightly ahead on LoCoMo (92.5 vs 92). All of these are vendor-run. The cost: Hindsight returns about 4x more context per retrieval by Mem0’s measurement, so set max_tokens if prompt size matters, and every write calls an LLM. See Mem0 vs Hindsight.

Letta is the other strong option here, through skill learning and self-edited prompts. MemOS also targets “cross-task skill reuse” and self-evolving memory.

Coding agents

Most memory vendors now ship plugins for Claude Code, Codex and Cursor. Hindsight’s hindsight-coding-agents package wires up Claude Code, Codex, Cursor, Copilot, opencode, Cline and others natively, builds a per-repo bank from git history and past sessions, and injects it as the agent starts. Others include Supermemory (open-source plugins), Cognee (Claude Code and Codex plugins), Honcho, and Mem0 (agent skills). Letta Code is itself a coding-capable agent harness. The right pick here usually depends on whether you want local storage or a cloud account. See AI coding agent memory and AI memory MCP servers.

Many users, agents and groups

Honcho models everything as “peers” (users, agents, groups) and builds a representation of each one in the background. It can model what one peer knows about another. It’s AGPL-3.0, with a managed option. See Honcho LLM memory.

Hosted pricing at a glance

Prices from each vendor’s pricing page on 8 October 2026. They change often.

ServiceFree tierPaid entryBilling basis
Mem0 Platform10,000 adds, 1,000 retrievals/month for 30 days; then 50,000 / 10,000 with your own LLM keyCustom plans only (graph memory on Custom); usage-based billing past free limitsRequests per month
Zep Cloud10,000 credits/monthFlex $125/mo (50,000 credits)Credits (1 credit per 350-byte episode)
Supermemory$5 monthly creditsPro $19/mo ($20 credits)Credit balance
LettaUp to 3 stateful agents, bring your own keysPro $20/mo; API plan $20/mo + $0.10 per active agentPlan + usage
Hindsight CloudFree starting creditsPay as you go: retain $10 and recall $0.75 per 1M tokens, reflect $0.05 per callToken usage

All of these except Zep’s platform also have a free self-hosted route (Graphiti covers Zep’s open-source side; Supermemory’s local binary is free but not open source). Hindsight’s self-hosted version includes every memory feature its cloud has, while Mem0 keeps graph memory, temporal reasoning and Dream consolidation on its hosted Platform. Since 26 October 2026 Mem0’s free plan also needs your own LLM key after 30 days, and graph memory and Dream are only on custom plans; what is Mem0 has the new limits and what a key costs per 1,000 adds.

How to test a memory framework before you commit

Benchmark tables in READMEs are mostly self-reported and run with different models and judges, so they won’t tell you which system works best on your data. A one-day test will:

  1. Collect 20-50 real conversations or tasks from your app (or write realistic ones).
  2. Write questions with known answers, including some where facts changed and some where the right answer is “I don’t know.”
  3. Ingest the same data into two candidates with the same LLM and embedding model where possible. A self-hosted default can be a small English-only embedder, so check what each one ships with; embedding models for RAG and agent memory lists the options and Hindsight’s defaults.
  4. Run the questions and score answers by hand or with an LLM judge.
  5. Measure tokens and latency for both writes and reads, not just accuracy.
  6. Test deletion: remove a user’s data and confirm it’s gone from results.
  7. Check operations: how hard is it to back up, upgrade and monitor?

For benchmark details and pitfalls, see LLM memory evaluation. For repos, licenses and GitHub activity, see open-source memory systems compared. Vectorize, the company behind Hindsight, also publishes a vendor comparison of AI agent memory systems; read it as one vendor’s view.