There is no official migration tool from Mem0 to Hindsight. You export your memories from Mem0 with its get_all call, then load them into Hindsight with batch retain. Each old memory is read again by an LLM, so the import costs model calls, and the facts Hindsight stores are extracted from your old text, not copied as-is. This page shows the steps, the field mapping, and what does not carry over.
What is Hindsight?
Hindsight is an open-source agent memory server from Vectorize, released under the MIT license. It has three operations: retain (store), recall (search) and reflect (reason over memories). Each bank holds its own memories, so you can keep one bank per user, as Mem0’s user_id scopes memories per user. Facts and API details here come from Hindsight’s retain docs, read 3 December 2026, and the hindsight-client package 1.3.1 on PyPI.
Step 1: Export your memories from Mem0
Mem0’s Platform client returns memories with get_all. The page is paginated, so loop until there is no next. The cookbook examples call it once per user, so run the loop for every user_id you have.
1from mem0 import MemoryClient
2
3mem0 = MemoryClient(api_key="YOUR_MEM0_API_KEY")
4
5def export_user(user_id):
6 page = 1
7 while True:
8 resp = mem0.get_all(filters={"user_id": user_id}, page=page, page_size=50)
9 for memory in resp["results"]:
10 yield memory
11 if not resp.get("next"):
12 break
13 page += 1
Mem0’s response sample has id, memory, created_at and updated_at for each memory. The export cookbook filters on metadata that you set when you added the memory, but the response sample does not show metadata. Print one record and check before you rely on it.
Mem0’s Platform UI also has a “Memory Exports” screen. Mem0’s memory export docs, checked 4 December 2026, do not say how long an export file stays available, so save the file as soon as it is ready if you use that route.
Step 2: Map the fields
| Mem0 field | Hindsight field | Note |
|---|---|---|
memory (text) | content | Only required field in Hindsight. |
created_at | timestamp | ISO 8601 in both. Set it, or the import time is used. |
id | document_id | Re-sending the same id replaces that document, so re-runs do not duplicate. |
user_id | bank (bank_id) | One bank per user keeps the same isolation Mem0 gives per user. |
| metadata | metadata | Hindsight stores metadata values as strings, so convert them. |
| (none) | context | Optional short label, for example "mem0 import". |
Step 3: Load into Hindsight with batch retain
Hindsight’s docs call batch ingestion “the recommended approach”. The method is retain_batch, and hindsight-client 1.3.1 accepts bank_id, items, document_id, document_tags, retain_async and operation_id. The 50-item chunk size below is our choice. The docs do not set a maximum item count.
1from hindsight_client import Hindsight
2
3hs = Hindsight(base_url="http://localhost:8888") # your Hindsight server
4
5def load_user(user_id):
6 batch = []
7 for memory in export_user(user_id):
8 batch.append({
9 "content": memory["memory"],
10 "timestamp": memory["created_at"],
11 "document_id": memory["id"],
12 "context": "mem0 import",
13 "metadata": {k: str(v) for k, v in (memory.get("metadata") or {}).items()},
14 })
15 if len(batch) == 50:
16 hs.retain_batch(bank_id=user_id, items=batch)
17 batch = []
18 if batch:
19 hs.retain_batch(bank_id=user_id, items=batch)
20
21load_user("alice")
Check the result with recall on a few known facts before you switch your agent over. We did not run this script against a live Mem0 account or Hindsight server, so run it on one test user first.
What does not carry over
- The stored text. Retain extracts facts, dates and entities with an LLM. Your memory “Alex prefers vegetarian restaurants” may become a different fact, a linked entity, or part of an observation. Check a sample.
- Mem0’s search scores and ranking. Hindsight ranks results with its own recall, which runs four strategies in parallel and reranks them. The scores do not match.
- Mem0’s filters. Mem0 filters by
user_id,agent_id,run_idand metadata. In this layout, the bank is the scope. Filter on metadata in recall, or rebuild the filter. - Expiry dates. Mem0 returns
expiration_dateon each memory. The retain item fields in Hindsight’s docs have no expiry field, so keep the date in your own code or in metadata.
What it costs
Retain calls an LLM for every item, so the import is paid work. On Hindsight Cloud, retain is priced at $10.00 per 1M tokens (vectorize.io/pricing, checked 3 December 2026). Self-hosted Hindsight is free under MIT, and you pay your LLM provider for the calls. Estimate the cost from your total memory text before you start.
When Hindsight is the better home for migrated memory
Hindsight’s best-supported lead over Mem0 is long histories. Its BEAM 10M score is 64.1, against 48.6 for Mem0. Both figures are from Mem0’s comparison page, and Hindsight’s numbers are Vectorize-run results, so treat them as vendor-reported. Hindsight also ships its graph, temporal recall, consolidation and mental models in the open-source server. Mem0 keeps graph memory on its paid plans.
Hindsight returns more context per retrieval by default than Mem0 does. Set max_tokens lower if your agent has a small context budget. For a side-by-side view, read Mem0 vs Hindsight. For the Hindsight side in full, read Hindsight AI memory.