There is no official migration tool from Zep to Hindsight. You list the episodes of each Zep graph with Zep’s API, then load them into Hindsight with batch retain. Hindsight re-reads each episode with an LLM and stores the facts it extracts. It does not copy Zep’s graph, its entities or its fact validity dates. This page gives the steps, the field map, and what does not carry over.
What is Hindsight?
Hindsight is an open-source agent memory server from Vectorize, released under the MIT license. Its operations are retain (store), recall (search) and reflect (reason over memories). Memories sit in banks. For Zep’s user graphs, a bank per user keeps the same separation. The Hindsight facts here come from its retain docs, read 3 December 2026, and the hindsight-client 1.3.1 package on PyPI.
Step 1: Export the episodes from Zep
In Zep v4, each user has a graph, and the user’s uuid works as the graph uuid. The list episodes endpoint is POST https://api.getzep.com/api/v4/graphs/{graph_uuid}/episodes/list. It returns items, each with content, created_at, reference_time, metadata, and for chat messages role and role_name. It pages with next_cursor, and the request takes page_size as a query parameter. Source: Zep’s v4 API reference, https://help.getzep.com/v4/sdk-reference/graph/episode/list (checked 4 December 2026): the path, page_size as a query parameter, items and next_cursor all match.
1import requests
2
3ZEP_KEY = "YOUR_ZEP_API_KEY"
4ZEP_URL = "https://api.getzep.com/api/v4/graphs/{graph}/episodes/list"
5
6def export_graph(graph_uuid):
7 cursor = None
8 while True:
9 params = {"page_size": 50}
10 if cursor:
11 params["cursor"] = cursor
12 resp = requests.post(
13 ZEP_URL.format(graph=graph_uuid),
14 headers={"Authorization": f"Api-Key {ZEP_KEY}", "Content-Type": "application/json"},
15 params=params,
16 json={"filters": {}},
17 timeout=60,
18 )
19 resp.raise_for_status()
20 body = resp.json()
21 for episode in body.get("items", []):
22 yield episode
23 cursor = body.get("next_cursor")
24 if not cursor:
25 break
The script reads one graph at a time. Keep the list of user uuids you want to move in your own app and pass each one in. Episodes that Zep dropped after waiting more than 7 days carry an expired_at field and are not in the graph. Add those again yourself if you still need them.
Step 2: Map the fields
| Zep field | Hindsight field | Note |
|---|---|---|
content | content | Only required field in Hindsight. For chat messages, put the speaker in the text, for example role_name: content. |
reference_time | timestamp | ISO 8601. Use the time the memory happened, not the import time. |
uuid | document_id | Re-sending the same id replaces that document, so re-runs do not duplicate. |
| graph (user) | bank (bank_id) | One bank per user. |
metadata | metadata | Hindsight stores metadata values as strings, so convert them. |
role, role_name | context or text | Zep keeps the sender as fields. Hindsight takes free text, so put the speaker in the content or in context. |
Step 3: Load into Hindsight with batch retain
Hindsight’s docs call batch ingestion “the recommended approach”. Use retain_batch, which in hindsight-client 1.3.1 accepts bank_id, items, document_id, document_tags, retain_async and operation_id. The 50-item chunk size is ours. Hindsight’s docs set no maximum item count.
1from hindsight_client import Hindsight
2
3hs = Hindsight(base_url="http://localhost:8888") # your Hindsight server
4
5def load_user(graph_uuid):
6 batch = []
7 for ep in export_graph(graph_uuid):
8 speaker = f"{ep['role_name']}: " if ep.get("role_name") else ""
9 batch.append({
10 "content": speaker + ep["content"],
11 "timestamp": ep["reference_time"],
12 "document_id": ep["uuid"],
13 "context": "zep import",
14 "metadata": {k: str(v) for k, v in (ep.get("metadata") or {}).items()},
15 })
16 if len(batch) == 50:
17 hs.retain_batch(bank_id=graph_uuid, items=batch)
18 batch = []
19 if batch:
20 hs.retain_batch(bank_id=graph_uuid, items=batch)
We did not run this against a live Zep project or Hindsight server. Check the field names against one real Zep response first, then test one user before a full run.
What does not carry over
- Zep’s graph. Zep builds entities and temporal facts from your episodes. Hindsight builds its own facts, entities, observations and mental models from the same text, so the graph will not match.
- Fact validity dates. Zep tracks when a fact became true or stopped being true. Hindsight stores times from the text and the
timestampyou send. Check any fact that changed over time withrecall. - Zep’s search scores. Hindsight ranks results with its own recall (four strategies in parallel, then a rerank). Scores do not match.
- Expired episodes. Zep drops episodes that wait more than 7 days and marks them with
expired_at. Those are not in the graph and are not exported. - Content policy state. Zep’s
content_policyfield has no Hindsight equivalent. Reapply your own policy before you load.
What it costs
Retain calls an LLM for each item, so the import costs model calls. 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. Add up the total episode text before you start.
When Hindsight fits
Hindsight’s open-source server includes its graph, temporal recall, consolidation and mental models, under MIT. Its strongest lead in our sources is on long histories: 64.1 on BEAM at 10M tokens, against Mem0’s 48.6 (figures from Mem0’s comparison page). Hindsight’s figures are Vectorize-run, so treat them as vendor-reported, not independent.
Hindsight returns more context per retrieval by default, so check your token budget. Set max_tokens lower if your prompt is small. For the full comparison, read Hindsight AI memory and Zep vs Hindsight.