AI Agent Memory Migration: 4 Options by Memory Type
AI agent memory migration compares identity-scoped, temporal, graph-oriented, and shared knowledge options, with a first choice and test for each workload.
An engineer replacing six months of agent memory needs a destination that preserves the identity, time, source episodes, or relations the workload uses. Map each memory type to a documented extraction and import path before switching clients. This guide compares destinations by those preservation requirements and a representative migration test.
Key takeaways
Best first option by memory workload
- Evaluate Mem0 for user- and agent-scoped memories with records you can retrieve through its documented API.
- Evaluate Zep when source episodes and changing temporal relationships shape answers.
- Shortlist Cognee when you want a documented cross-system path using its COGX exchange format.
- Evaluate AKB for shared organizational knowledge that agents access through MCP, including documents with revision history, tables, files, and explicit relations.
What should you compare before moving six months of memory?
Compare both the shape of your existing records and the path into the target system. A search or read endpoint lets you inspect records; a migration path also needs enough identity, time, scope, and metadata to rebuild the meaning those records had in your agents.
| Comparison field | What to capture from the current layer | What to confirm in the destination |
|---|---|---|
| Memory job | Personal preference; conversation episode; derived fact or relation; shared reference knowledge | Whether the target retrieves that kind of record for the same use |
| Original material | Raw messages or source text; derived summaries, facts, and entities | Whether the original can be retained alongside derived knowledge |
| Identity and scope | User, agent, app, session, run, tenant, or other ownership fields | Which fields can be imported and applied to reads and writes |
| Time and provenance | Creation or update time; event time; source ID; version; source document | Whether the target preserves those fields and can distinguish changed facts |
| Transfer path | Export, list, or read operation and its output | A documented import adapter, write interface, or format mapping |
| Access and lifecycle | Read permissions; deletions; retention rules; agent connections | How the new system applies access, updates, and deletion behavior |
Treat a migration as a data conversion project, not a database swap. A team moving six months of records should first inventory which entries are original conversations and which are derived memories, then map source identities to destination scopes and preserve timestamps, source references, and metadata where available. A stable record ID makes deduplication and retry behavior easier to test, while a mapping table makes it possible to explain how one old record became one or more new records.
Treat copied user_id or agent_id labels as data, not authorization: map source principals and tenant permissions to destination access policies, and test that one user cannot retrieve another user's records. Scoped search filters alone do not prove access control.
Distinguish the source event time from the time it was imported, and preserve temporal validity (when a fact was true) separately from recorded time (when the system learned or stored it), where those fields are available.
Record pagination cursors or other extraction state and reconcile expected totals so a successful-looking export is not mistaken for a complete one; also map source deletions or tombstones to destination removals or equivalent suppression.
Keep extraction, import, and agent access as separate checks. The Model Context Protocol tools specification defines how an MCP client discovers and calls tools exposed by a server; that connection lets an agent interact with a service, while historical data still needs its own export and write path. Test both tasks: can the target agent call the knowledge service, and can the migration process represent the old records correctly inside it?
Score usefulness separately from portability. The independent LoCoMo long-term conversation-memory benchmark uses conversations averaging 600 turns and 16,000 tokens across as many as 32 sessions, with tasks including single-hop, multi-hop, temporal, and adversarial questions. Use these task categories as a starting point for a representative test set, with questions drawn from your own data and agent workflows.
A practical move starts with a bounded sample rather than a full cutover:
- Inventory the records: Group a representative sample by memory job, source format, identity, timestamp, metadata, and access scope.
- Extract a stable snapshot: Retain record IDs and original content, capture pagination state, and reconcile pages and record totals to check extraction completeness; log available fields and deletion or tombstone records.
- Map the fields: Decide how source IDs, user or agent ownership, event time, recorded time, temporal validity, relations, provenance, and deletion or tombstone signals become destination records; distinguish source event time from import time.
- Load a test set: Import the sample into an isolated destination and replay representative questions from the old workflow.
- Compare outcomes: Check retrieval usefulness, temporal interpretation, source traceability, duplicates, and access behavior before directing production agents to the new layer.
For quality tests, choose the retrieval settings with a tuning set and then check the selected setup against held-out questions.
When should you evaluate Mem0?
Evaluate Mem0 first when most of your stored state is tied to a user, agent, application, or run and your current system can map those identities cleanly. Mem0's entity-scoped memory API accepts identifiers in a filters object for client.search, client.get_all, and exports. On the default extraction path, Mem0 attributes each extracted fact to the user or agent that stated it, while app_id and run_id are stored on every memory produced by the call.
Those scopes give a migration engineer useful grouping keys for a user-personalization workload. Mem0's export API supports structured AND/OR filters over user_id, agent_id, app_id, and run_id. Map each target record to the intended identity scope, then verify scoped retrieval and metadata after transfer.
Mem0's memory update guide distinguishes OSS SDK behavior from Platform operations. Pin the edition and interface used for export and correction; map only the text, metadata, and time fields that that interface actually returns or accepts.
When does Zep fit time-aware conversational memory?
Evaluate Zep when a useful answer depends on what was said, when it was said, and how conversation facts changed over time. Zep's episode records store each episode verbatim alongside the entities, edges, and summaries derived from it. Zep's SDK can list recent episodes for a user, fetch one by UUID, list episodes for a document, and search a graph for episodes.
Preserve each available episode identifier and time or relationship field in your migration map, then test target answers to questions about event order and changed facts. A useful sample could include a preference that changed, a plan discussed and later revised, and two sessions that refer to the same person or project.
Graphiti's documentation identifies it as an open-source framework for temporal knowledge graphs that power Zep; it incrementally updates graphs as episodes arrive, allowing facts and relationships to evolve with source data. That makes Zep a good shortlist candidate when your application needs to reason over evolving conversation context rather than retrieve only a standalone preference.
Collect a representative set of episode records and map each one into the structure your destination accepts. Compare the imported episode text, available timestamps, entities, and changing relations with the source, then replay temporal questions through the target agent.
When does Cognee belong on the shortlist?
Put Cognee near the top when your objective is to move records from another memory provider and then build or preserve a knowledge graph. Cognee’s official COGX exchange format is described as a way to import agent memories from Mem0, LangMem, Letta, Zep, or Graphiti, and to export, back up, or move Cognee memory.
Cognee's memory migration guide uses source adapters to read provider exports and emit COGX records. When an adapter uses stable source IDs, Cognee matches records by (external_system, external_id) and avoids duplicates when the same export is imported again. Carry user_id, agent_id, session_id, or run_id scopes and created_at or updated_at values when the source export includes them; place other fields in record metadata.
The guide distinguishes preserving memory from rebuilding its graph. For Mem0's short memory records, Cognee's re-derive mode rebuilds graph knowledge when that is the goal; preserve stores raw records without LLM calls, and a later cognify() step builds the graph for recall. These are different migration goals, not a guarantee of lossless equivalence; use only documented adapters and import paths, and do not assume an undocumented importer exists.
Use Cognee when those documented adapters and COGX mapping match your source provider and graph-oriented destination. A sample import can then test record counts, repeated-run behavior, preserved metadata, and whether graph-derived answers remain faithful to the original source.
When is AKB a relevant destination?
Choose AKB when the new job is shared organizational knowledge for agents, rather than preserving only isolated user memories. AKB provides agents with shared organizational knowledge through MCP, with versioned knowledge, documents, tables, files, hybrid semantic and keyword retrieval, and explicit relations. Those records give developers and knowledge teams a destination for agent-readable company information that can also represent links between concepts.
The current AKB README describes a PostgreSQL-native revision store and recommends Native for new installations. Explicit Bare Git installations remain supported for existing deployments. Confirm history, recovery and export against the selected backend; a change in installation defaults does not migrate an existing vault.
AKB's agent tools let agents read and write with akb_put, akb_search, akb_browse, and akb_relations, with document revision history; table, file, and relation preservation need separate tests. As of October 14, 2026, the AKB repository lists the akb-sessions plugin as capturing a coding session as structured notes, which suits teams turning recurring work and decisions into shared knowledge for coding agents. Its core is a read/write knowledge store, so collection and ongoing curation should be planned as separate operating work.
For a migration from Mem0, Zep, or another memory store, treat source export and AKB knowledge authoring as distinct steps. Before promoting personal conversation into broader organizational knowledge, confirm that the destination audience is permitted to see it and require an appropriate review. Exclude secrets and personal data that is not needed for the shared knowledge purpose.
Convert only approved records into a document, table, file, or explicit relation, then use AKB's read/write tools to test agent retrieval. This approach suits teams that want the destination to serve multiple agents or knowledge workflows from maintained, versioned knowledge, while a user-profile memory service may remain the better fit when each record is personal and scoped to an individual. A platform lead can evaluate AKB as a memory-only knowledge service alongside the current execution environment, then separately decide whether to change the agent runtime.
Which option should you evaluate first?
Choose the first candidate based on the shape and ownership of the records you need to keep.
| Your six-month memory workload | First option to evaluate | Why it fits | First migration test |
|---|---|---|---|
| User or agent preferences grouped by identity | Mem0 | Documented scoped reads, exports, updates, and metadata fields | Compare identity-filtered retrieval and metadata after transfer |
| Conversation episodes where event order and change matter | Zep | Verbatim episodes sit alongside derived entities, edges, and summaries | Replay temporal questions and trace answers to the original episode |
| Moving provider memories into graph-oriented knowledge | Cognee | COGX migration guidance names Mem0, Zep, and Graphiti among supported sources | Re-import a stable-ID sample and compare preserve versus re-derive behavior |
| Shared company knowledge for MCP-connected agents | AKB | Versioned knowledge with Native or explicit legacy storage, multiple content types, hybrid retrieval, and explicit relations | Convert a representative set into shared knowledge and test agent retrieval |
A team can also split the destination by record purpose. Keep personal preferences in a user-scoped memory system when the data belongs to one user, while curating durable decisions or reference facts into shared organizational knowledge when many agents need them. That separation gives each record a clearer owner and retrieval context than copying every old memory into one undifferentiated store.
Test the destination mapping before cutover
Map original episodes, extracted facts, user/agent identifiers, time bounds, and relations to the fields the destination actually preserves. Rehearse a small export and import with documented interfaces; a Bare Git export path should not be described as a Native vault exporter. The README explicitly limits its Git-tree OKF exporter to Bare Git vaults. A portable document bundle, a full backup, and a migration into another product have different coverage.
Use this proposed cutover evidence record before switching agent traffic. Define a limited rollback window in advance; the fallback must reconcile deletions and revocations so rollback cannot reintroduce removed material, and permission checks must be tested on the fallback path:
| Check | Required observation | Evidence |
|---|---|---|
| Meaning and lineage | Original episodes, derived facts, time bounds and relations keep their intended meaning; losses remain explicit | Source/destination ID map, field-loss register, source versions and retained evidence |
| Safe replay | Reimporting the same sample does not silently create duplicate active records | Stable IDs, repeated-run counts, observed write results |
| Current access | Removed or denied identities stay denied after import and through search, citations and summaries | Current principal/policy, test requests, observed results |
| Cutover and fallback | Changes and deletions reconcile to the agreed cutoff; rollback is limited to a defined window, avoids reintroducing deleted or revoked material, and includes tested permission checks | Cutoff manifest, rollback-window end, deletion/revocation reconciliation, permission-test results, unresolved items, owner approval |
Counts and checksums detect some omissions; representative task and access tests establish the remaining acceptance evidence. Keep migration work, latency and rebuild costs separate from query quality. These are tests to perform, not vendor migration guarantees.
Related background: Planning an Exit from an Agent Knowledge Platform
FAQ
Does an MCP connection migrate old memories?
No. MCP lets compatible applications discover and call tools on a server; a migration still needs a way to extract historical records and write their mapped forms into the new knowledge store.
Should we move raw conversations or only extracted facts?
Keep both when your workload depends on provenance or changing context. Zep stores each episode verbatim alongside the entities, edges, and summaries derived from it, so a team can inspect the original episode alongside that derived information.
How do we know the new memory layer works before switching?
Run a representative sample against the new layer and compare retrieval, temporal answers, identity scopes, source traceability, and access behavior with the current workflow. Select settings on tuning questions, then validate the chosen configuration against held-out questions before routing production agents.
Read the AKB documentation
Review the documented knowledge and integration workflows for your AKB deployment.
