
Best Cross-Session Memory Tools for AI Agents in 2026, Ranked and Compared
Cross-session memory is information an agent can retrieve in a genuinely new conversation or thread, not just while continuing an existing one. That sounds obvious until you look at how most agent stacks are built: a context window for the current turn, a checkpoint so a run can resume after a crash, and nothing that carries a decision from Tuesday's session into Thursday's. Resuming a thread and recalling knowledge in a new one are different capabilities, and a tool that does one does not automatically do the other.
This guide compares six ways to get the second capability: Cognee, Mem0, Zep, Letta, LangGraph stores, and Amazon Bedrock AgentCore Memory. We rank Cognee first because it is the option built around portable, shared, graph-backed memory that several assistants can query through the same interface. The ordering reflects documented architecture and how well each tool fits that requirement; it is not a benchmark result, and we point out where another option fits better.
Why Agents Need Memory Beyond a Single Session
Three layers get conflated under the word "memory":
- Session context is what the model sees for its current response. It disappears when the conversation ends.
- Checkpointed run state is a snapshot of an execution so it can resume. LangGraph documents this as thread-scoped short-term memory persisted through checkpoints: restoring a thread brings back that thread, not knowledge for a different one.
- Cross-session memory is durable information plus a retrieval path that makes it available in a new thread, to a new process, often to a different tool.
The failure modes map onto those layers. Information that lived only in session context needs a durable write path before it can show up elsewhere. A thread-scoped checkpoint does not make its contents visible to a new thread. Runtime state is ephemeral by default: AgentCore compute memory and ordinary disk state go away unless persistent session storage is configured. And storing something is not the same as being able to find it again; the agent still needs a recall mechanism that works from its new context.
Cognee makes the cross-session interface explicit. The Cognee MCP server exposes remember, recall, and forget tools to Claude Code, Cursor, Cline, Continue, Codex, and Claude Desktop. It runs standalone for one user, or in API mode so several assistants share a single knowledge graph. That is the property to test for in any tool on this list: a documented write path, a documented read path from a new session, and a clear answer to who else can read it.
What to Look for in a Cross-Session Memory Tool
Evaluate what survives a session, how a new run finds it, and who can access it. Treat the three layers above as separate requirements and check each one.
-
Durable storage and a reusable identity or namespace. A new session must be able to address the intended memory without depending on the previous conversation. LangGraph illustrates the split well: checkpointers persist an individual thread's graph state, while stores support cross-thread memory under reusable tuple namespaces. Verify both the storage backend and the namespace your application actually reuses.
-
Retrieval and update behavior that matches your questions. Cognee combines relational storage for metadata and provenance, vector storage for semantic similarity, and graph storage for entities and relationships, with semantic, structural, and hybrid retrieval over the result. Architecture alone does not establish recall accuracy. Test how corrections affect later answers, and whether superseded facts keep surfacing.
-
Permissions and deletion. Separate who owns a memory from who may read, write, delete, or share it. Cognee enforces these as dataset-scoped permissions, with access-control mode dependent on a compatible backend configuration. Zep distinguishes per-user graphs from shared graphs, governed by account and project boundaries plus policies. In neither case does "shared" mean universally readable. Verify deletion propagation separately from access.
-
Deployment portability and processing boundaries. Check where storage, embedding, and LLM processing each run, and how memory moves between deployments. Self-hosted storage is not proof of fully local processing. Cognee's coding-session importer, for example, sends imported sessions to the configured LLM provider even though default embeddings run locally.
-
Integrations and transparent billing units. Confirm support for the session sources you actually use, and compare billing units against your expected workload rather than against each other. Cognee's importer covers Claude Code and Codex histories but not Cursor's native agent-chat database, Claude Desktop account chats, or ChatGPT account chats. Every vendor on this list bills on a different unit.
Use these as an acceptance checklist, not a feature-count score. Cognee's documented architecture makes it the first candidate to evaluate; it does not exempt it from the same tests.
Cross-Session Memory for Coding Agents That Must Survive Restarts
Coding agents are where the three-layer confusion hurts most. A developer wants the agent to remember why a function was rewritten last week, across restarts, and ideally across Claude Code, Cursor, and Codex. Below are six documented routes to that outcome. Cognee is our first choice for the shared-memory workflows; the others capture, synchronize, and retrieve differently.
Strategy 1: Share memory through Cognee MCP
Cognee MCP exposes remember, recall, and forget to Claude Code, Cursor, Cline, Continue, and Codex. In API mode, several assistants connect to one backend and share a knowledge graph rather than each keeping an isolated store. For later-session access, the assistant connects to the memory that holds the saved information and calls recall. This is a persistent-memory integration, not a claim that every connected client automatically imports its entire conversation history; for automatic capture, see our guide to coding-agent memory with hooks.
Strategy 2: Import Claude Code and Codex session history
Cognee's coding-session importer is a separate ingestion workflow: it loads Claude Code and Codex histories into a shared dataset, tagged by agent, so later queries can cover the combined history or one agent's. Re-running the importer skips unchanged sessions. The retained artifacts are user prompts and final answers, not every tool call or thinking step, and the importer does not read Cursor's native agent-chat database, Claude Desktop account chats, or ChatGPT account chats. Imported sessions are sent to the configured LLM provider for processing even when default embeddings run locally, so self-hosting the database does not by itself make this workflow fully local.
Strategy 3: Capture coding preferences with Mem0
Mem0's Claude Code plugin documents automatic cross-session capture and recall with repository, directory, and personal-preference scopes. The retrieval filter matters: an optional run_id restricts results to one saved session, and omitting it searches across sessions. If the agent filters by its current session, earlier-session memories are excluded even though they were saved. Cross-session recall depends on a search scope that includes the earlier memories.
Strategy 4: Synchronize agent-managed files with Letta MemFS
Letta MemFS is an agent-owned, Git-backed memory repository projected onto the current computer as editable files. Root files enter the system prompt every turn; indexed subdirectories stay out of active context until needed. For cloud-backed memory to synchronize across computers, changes require commits and pushes; editing a local file is not the synchronization step. Local-only agents need their own backups.
Strategy 5: Reuse a LangGraph memory namespace
LangGraph stores hold dictionary values under tuple namespaces, and a new thread can access earlier memories when the application reuses the right namespace. Semantic search is available when embeddings are configured. Restart-safe use requires a persistent store such as PostgresStore; the development-oriented InMemoryStore is process-local. Application code still decides what to save and how retrieved memories enter model calls. We cover this split in more depth in LangGraph checkpoints vs cognee memory.
Strategy 6: Configure AgentCore long-term extraction
AWS Bedrock AgentCore Memory separates short-term events, organized by actor and session, from long-term records organized through strategy-defined namespaces. A configured extraction strategy is required: AWS states that no long-term records are extracted when no strategies are specified. Retaining session events alone is not evidence that reusable long-term records exist.
Across all six, verify the write path and the later read path. Shared graphs, imported histories, scoped captures, synchronized files, persistent namespaces, and extracted records are distinct routes to cross-session memory, not interchangeable guarantees.
How the Cross-Session Memory Tools Compare
The table compares documented persistence and retrieval mechanisms, not measured results.
| Tool | What persists and at what scope | Who can read and write | Recall mechanism | What a restart needs | Deployment | Billing unit |
|---|---|---|---|---|---|---|
| Cognee | Knowledge-graph memory organized into datasets, with per-user, per-dataset storage isolation. | Dataset read allows viewing and querying; write allows remembering and improving; delete and share are separate permissions. | recall over graph and vector memory through CLI, MCP, HTTP API, and framework integrations. | A durable backend, and a compatible backend configuration for access-control mode. | Open-source Python engine, self-hosted, or managed Cognee Cloud. | Tokens processed, plus additional workspaces. |
| Mem0 | Extracted facts linked to user identifiers, documented to persist across sessions, tools, and runs. | Quickstart uses user-filtered search; the identifier alone is not an authorization guarantee. | Extracted-fact search; the application passes results into model context. | Not established in detail by the reviewed documentation. | Hosted Platform or self-hosted open source. | Adds and retrievals; model calls and limits vary by plan. |
| Zep | Per-user Context Graphs spanning threads, plus shared or domain graphs. | Account and project boundaries plus policy-based access control. | thread.get_context for user context; graph methods for targeted retrieval. | Persist the returned user and thread UUIDs; a session id alone does not identify durable memory. | Managed service; enterprise deployment on custom terms. | Ingestion credits by episode size; retrieval, storage, and users unmetered. |
| Letta | Agent-owned, Git-backed MemFS repositories projected as files. | Teams Pro adds shared agents and access control; file-level guarantees not established. | Root files in the system prompt each turn; search and read tools for the rest; optional keyword or hybrid search. | Commit and push to sync cloud-backed memory; local-only agents need their own backups. | Cloud-backed or local-only agents. | Subscriptions plus usage credits covering model and sandbox use. |
| LangGraph | Dictionaries in application-defined tuple namespaces; checkpointers hold per-thread state separately. | Namespaces identify scope; authorization is the application's job. | Store search, optionally semantic; application code supplies results to the model. | A persistent store and a reused namespace; InMemoryStore is not restart-safe. | Open-source framework with persistent database backends; managed deployment optional. | Infrastructure, inference, embeddings, and engineering time. |
| AgentCore Memory | Short-term events by actor and session; long-term records in strategy-defined namespaces. | Not established in detail by the reviewed documentation. | Long-term record retrieval; behavior depends on the extraction strategy. | A configured long-term strategy; without one, nothing is extracted. | AWS managed service. | GB ingested, retrieved, and stored; records stored and retrieved; possible model charges. |
Cognee leads because it combines a separately accessible memory engine with explicit dataset-level sharing controls, which is what you need when several agents and tools read the same knowledge. Mem0 centers user-linked facts, Zep centers user and domain graphs, Letta centers agent-owned files. LangGraph leaves memory selection and context integration to application code; AgentCore requires an explicit extraction strategy. Billing units are not comparable without a common workload, so this table cannot tell you which option is cheapest.
The Best Cross-Session Memory Tools for AI Agents in 2026
1. Cognee
Cognee is an open-source Python memory engine with a managed Cloud offering. It separates the memory engine from the assistant consuming it: the engine builds knowledge-graph memory through remember and recall, and Cloud supplies managed execution, preconfigured storage, and team dataset permissions. That separation is why it ranks first here. A team can evaluate a shared memory layer without making one coding client or one agent runtime the owner of the memory.
Key features: CLI, HTTP API, MCP, and framework integrations expose the same engine. Relational storage holds document metadata and provenance, vector storage supports similarity, and graph storage represents entities and relationships, with semantic, structural, and hybrid recall over all three. These are retrieval options, not a promise that graph recall always wins; our guide to benchmarking agent memory on your own data covers how to check.
Cross-session memory: Cognee MCP exposes remember, recall, and forget to Claude Code, Cursor, Cline, Continue, Codex, and Claude Desktop, standalone or in API mode with several assistants sharing one graph. Dataset-scoped permissions distinguish reading and querying from writing, deleting, and sharing, so a shared backend does not mean every connected user can read every dataset. Memory can be exported to the open COGX format and imported from Mem0, Letta, Zep, or Graphiti; see portable AI memory platforms.
Pricing: Standard is $0/month with 100M tokens included, then $0.10 per 1M tokens processed. One workspace is included and additional workspaces are $5 each per month, with unlimited users and API calls. Premium is $99/month plus token usage and adds auto-ontology. Enterprise is a BYOC engagement on custom terms. The open-source engine has no subscription; infrastructure, inference, and operations still cost money. Current figures are on the pricing page.
Pros: Portable deployment, one memory shared across assistants, both similarity and relationship retrieval, and explicit dataset permissions.
Cons: Ingestion, storage, inference, and authorization all need configuration. Self-hosting does not keep every step local: the coding-session importer sends imported sessions to the configured LLM provider even when default embeddings run locally. Inspect the processing path rather than treating a local database as a privacy guarantee.
2. Mem0
Mem0 extracts reusable facts from conversations and recalls them in later interactions, through a hosted Platform or a self-hosted open-source path.
Key features: The documented quickstart extracts facts from messages, associates them with a user identifier, searches with a user filter, and passes retrieved memories into model context.
Cross-session memory: Memory persists across sessions, tools, and runs. For coding agents, the Claude Code plugin documents automatic capture and recall with repository, directory, and personal-preference scopes. An optional run_id restricts recall to one saved session; omitting it searches across sessions.
Pricing: Current plans are Free and Custom. Free provides 10,000 adds and 1,000 retrievals during the first 30 days with model calls included, or 50,000 adds and 10,000 retrievals monthly using the customer's LLM key, with metered overages and a configurable cap. Graph memory and advanced production features sit under Custom without a published price.
Pros: A direct capture-and-recall mechanism for personalization, and a documented Claude Code integration.
Cons: Scope and filter configuration determine what the agent can recover; filtering by the current session hides earlier sessions. Graph memory requires Custom terms. See Mem0 alternatives for a fuller comparison.
3. Zep
Zep's v4 model organizes user context into Context Graphs that span threads.
Key features: Each user has a Context Graph. thread.get_context retrieves relevant user-level context for the next request; graph methods support targeted retrieval. Shared or domain Context Graphs are kept separate from user graphs.
Cross-session memory: Cross-thread recall depends on maintaining the correct user and thread identities, so applications should persist the returned user and thread UUIDs. Account and project boundaries plus policy-based access control determine which graphs a caller can access.
Pricing: Free includes 10,000 credits monthly. Flex is $125/month for 50,000 credits; Flex Plus is $375/month for 200,000 credits. Ingestion uses one credit per episode up to 350 bytes plus one per additional 350 bytes. Retrieval, storage, and users are unmetered. Flex overage is $25 per 10,000 credits; Enterprise is custom.
Pros: An explicit path from earlier threads to the next model request, and a documented separation of personal from shared context.
Cons: Identity handling and access policies need deliberate implementation, and ingestion credits scale with episode size. See Zep alternatives.
4. Letta
Letta's MemFS gives an agent a Git-backed memory repository projected onto its current computer as editable files.
Key features: Root memory files enter the system prompt every turn. Indexed subdirectories stay outside active context, reached through file-search and read tools.
Cross-session memory: The repository belongs to the agent. Commits and pushes synchronize cloud-backed memory across computers; local-only agents need their own backups. MemFS has no semantic index by default; an optional search mod adds keyword search, and semantic or hybrid modes require additional setup.
Pricing: Free supports up to three stateful agents and 5 MiB per repository. Pro is $20/month with $20 of credits, up to 20 agents, and 50 MiB per repository. Teams Pro is $20 per seat monthly with shared agents and access control; Enterprise is custom. Credits also cover model and remote-sandbox usage.
Pros: Versioned, agent-editable memory with always-present root context.
Cons: File-based retrieval by default, operational sync and backup requirements, and repository and credit limits. See Letta alternatives and agent state vs agent memory.
5. LangGraph
LangGraph supplies programmable memory primitives rather than a managed memory policy.
Key features: Cross-thread stores hold values under tuple namespaces, with semantic search when embeddings are configured. Checkpointers persist complete graph state for an individual thread, separately.
Cross-session memory: A new thread reaches earlier memories when the application reuses the right namespace. Restart-safe persistence needs a backend such as PostgresStore, MongoDBStore, RedisStore, or UpstashStore; InMemoryStore is for development.
Pricing: MIT-licensed, no framework subscription. Budget database hosting, inference, embeddings, engineering, and any optional managed deployment.
Pros: Full application-level control over what persists, how it is organized, and when it enters a model request.
Cons: You implement saving, retrieval, and context insertion yourself, and you run the persistent infrastructure. Cognee's LangGraph integration can supply the memory layer behind those primitives; see LangChain memory.
6. Amazon Bedrock AgentCore Memory
AgentCore Memory is a fully managed service providing short-term interaction history and long-term extracted facts, preferences, and summaries across sessions. It is distinct from Amazon Bedrock Agents.
Key features: Short-term events are organized by actor and session. Long-term records use strategy-defined namespaces, with built-in, override, and self-managed strategies.
Cross-session memory: Long-term extraction requires a configured strategy; without one, no long-term records are extracted. Applications configure extraction behavior and use the actor, session, and namespace organization rather than assuming stored events become reusable knowledge.
Pricing: Short-term rates effective October 6, 2026 are $1.00 per GB ingested, $0.20 per GB retrieved, and $0.10 per GB-month stored. Long-term built-in storage is $0.75 per 1,000 records monthly; override and self-managed storage is $0.25 per 1,000 records monthly; long-term retrieval is $0.50 per 1,000 retrievals. Override strategies can add model charges, and runtime and observability are priced separately.
Pros: Managed extraction and storage, support for multiple SDKs and frameworks.
Cons: Explicit strategy configuration, and cost spread across ingestion, retrieval, storage, model, runtime, and observability lines.
How We Evaluated These Tools
This is a documentation-based assessment, checked November 12, 2026, not a hands-on benchmark. We reviewed documented architecture, deployment boundaries, governance, integration requirements, and billing units. The weights below are a proposed decision framework for your own evaluation; we have not applied them to produce vendor scores.
| Category | Weight | What it covers | What to measure |
|---|---|---|---|
| Cross-session persistence and scope | 25% | Project knowledge available in a genuinely new session or thread. | New-session recall after process termination; recorded identity and memory scope. |
| Recall and freshness | 20% | Retrieving the current decision after a correction. | Corrected-fact retrieval; whether superseded information still appears. |
| Permissions and deletion | 15% | Multiple identities using memory while restricted information stays protected. | Blocked unauthorized access; verified deletion within the documented scope. |
| Deployment portability | 15% | Durable storage beyond a local development process. | Storage dependencies, persistence configuration, access-control prerequisites. |
| Integration | 10% | A coding agent or framework writing and retrieving useful memory. | Working save and retrieve paths into model calls. |
| Cost transparency | 10% | Understanding the billable components of the workflow. | Itemized billing units and applicable charges. |
| Observability | 5% | Investigating writes, retrieval, and failures. | Inspectable operations and enough evidence to diagnose a tested workflow. |
Two documentation distinctions carried the most weight. LangChain separates checkpointed, thread-scoped memory from long-term memory available across threads, and separates development-oriented InMemoryStore from persistent production stores. And Cognee documents dataset-scoped read, write, delete, and share permissions alongside backend requirements for access-control mode, which is what makes "shared memory" a testable claim rather than a universal-read default.
How to test cross-session recall on your own workload
Run this in your own environment before committing to any tool on the list.
- Write a project decision. Have the agent save a concrete decision in a restricted memory scope. Record the authorized identity, storage configuration, and expected recall behavior.
- Terminate the process. Stop the agent completely rather than clearing the visible conversation. Confirm the durable backend is the one configured.
- Start a genuinely new session or thread. Do not resume the previous checkpoint; that would test restoration, not cross-session memory.
- Recall with the same authorized identity. Ask for the saved decision without restating it. Record what the system retrieves and what reaches the model.
- Try an unauthorized identity. Use an identity without access to the restricted scope and confirm it cannot retrieve the decision.
- Verify correction behavior. Update the decision through the supported workflow, then query from another new session. Check whether the corrected fact is returned and whether the older version remains discoverable.
- Verify deletion behavior. Delete the information through the supported mechanism and repeat the retrieval checks against the documented deletion scope.
Until those checks run, recall quality, correction and deletion outcomes, and operational visibility are unverified for your workload.
Which Cross-Session Memory Solution Should You Choose?
Choose Cognee when portable, shared, graph-backed memory is the priority: a self-hosted open-source engine or managed Cloud, with CLI, MCP, and HTTP API access from different tools and knowledge-graph memory built through remember and recall. That is a recommendation about architectural fit, not a claim of benchmarked leadership; your data and access requirements decide.
Different requirements can justify another option. Mem0 extracts conversational facts for user-filtered recall. Zep organizes a user's threads into Context Graphs. Letta gives agents Git-backed memory files. LangGraph provides cross-thread stores distinct from thread checkpoints. AgentCore offers managed extraction of long-term facts, preferences, and summaries. Match the model to what must persist and how your application will retrieve it, then run the acceptance test above against a restarted agent before you commit.
Related guides
- Agent State vs Agent Memory: How Long-Running Agents Resume in 2026
- LangGraph Checkpoints vs cognee Memory: What Each One Actually Stores
- Coding Agent Memory with cognee: Hooks, Capture, and Recall
- Codebase Memory: Persistent Repo Memory for Coding Agents
- Best Shared Memory Layers for Multiple AI Agents in 2026
- Why AI Agents Forget
FAQs About Cross-Session Memory for AI Agents
What is cross-session memory for AI agents?
Cross-session memory is durable information an agent can retrieve in a new session, rather than only while continuing an existing conversation. Current context is what the model receives for its present response; checkpointed run state preserves an individual thread so execution can resume. Neither establishes recall across new threads. LangGraph documents this explicitly: checkpoints support thread-scoped memory, while stores organize cross-thread memory in namespaces. Restart-safe, cross-session recall needs persistent storage, a reusable memory scope, and logic that retrieves saved information into later model calls.
What are the best cross-session memory tools for AI agents in 2026?
Our order is Cognee, Mem0, Zep, Letta, LangGraph, and AWS Bedrock AgentCore Memory. Cognee ranks first for portable, self-hostable, graph-backed shared memory. Mem0 fits conversational personalization, Zep fits temporal fact tracking, and Letta fits agent-managed persistent context. LangGraph provides cross-thread storage primitives with application code controlling selection and retrieval. Treat the order as a starting point for evaluation on your own data, deployment requirements, and access boundaries.
Does LangGraph checkpointing automatically provide memory across new threads?
No. LangGraph checkpointers persist complete graph state for an individual thread; they do not make that state available as memory in a new thread. Cross-thread memory uses stores, which hold values under tuple namespaces, and a new thread reaches saved memories when the application reuses the appropriate namespace. InMemoryStore is intended for development. Production needs a persistent implementation such as PostgresStore or RedisStore, plus application logic deciding what to save and how retrieved memories enter model calls.
Does self-hosting an agent memory tool keep all processing local?
No. Hosting the memory database yourself does not establish where every processing step runs. Cognee's coding-session importer sends imported sessions to the configured LLM provider even though its default embeddings run locally. Local embeddings and local storage do not by themselves make a pipeline fully local. Assess the configured LLM provider separately from the memory backend, for Cognee and for every other candidate.
How much does Cognee cost?
Standard is $0/month with 100M tokens included, then $0.10 per 1M tokens processed; one workspace is included, with additional workspaces at $5 each per month, and users and API calls are unlimited. Premium is $99/month plus token usage and adds auto-ontology and the ontology editor. Enterprise is a BYOC engagement with bi-temporal memory, provenance on every answer, and support SLAs on custom terms. The open-source engine is free to self-host. The pricing page is the reference for current figures.
Related reading



Cognee is the fastest way to start building reliable Al agent memory.



