Letta to Hindsight Migration: Export Archival Passages, Load, What Changes

5 min read

Move Letta archival passages to Hindsight (Dec 2026): export with Letta's list passages API, load with batch retain, the field map, what does not carry over, and the LLM cost.

There is no official migration tool from Letta to Hindsight. You list the archival passages of each Letta agent with Letta’s API, then load them into Hindsight with batch retain. Hindsight re-reads each passage with an LLM and stores the facts it extracts. It does not copy Letta’s passage embeddings, its tags as search filters, or its agent state. 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. One bank per Letta agent keeps the same separation Letta gives each agent its own archive. 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 passages from Letta

Letta’s archival memory is a vector store per agent. Its REST API lists an agent’s passages with GET /v1/agents/{agent_id}/archival-memory. Each passage has id, text, created_at, tags and metadata. The request takes limit (maximum 200), and the cursors after and before, which take a passage id. Results are oldest first by default; set ascending=false for newest first. Source: Letta’s archival memory page (https://docs.letta.com/v1-sdk/memory/archival-memory/) and its List Passages reference (https://docs.letta.com/api/resources/agents/subresources/passages/methods/list), both read 5 December 2026. These are the V1 SDK docs, which Letta marks as legacy. Check the path on your own server version first.

 1import requests
 2
 3LETTA_URL = "http://localhost:8283"  # your Letta server
 4LETTA_KEY = "YOUR_LETTA_API_KEY"     # leave empty for a local server without auth
 5
 6def export_agent(agent_id):
 7    after = None
 8    while True:
 9        params = {"limit": 200, "ascending": "true"}
10        if after:
11            params["after"] = after
12        resp = requests.get(
13            f"{LETTA_URL}/v1/agents/{agent_id}/archival-memory",
14            headers={"Authorization": f"Bearer {LETTA_KEY}"} if LETTA_KEY else {},
15            params=params,
16            timeout=60,
17        )
18        resp.raise_for_status()
19        passages = resp.json()
20        if not passages:
21            break
22        for passage in passages:
23            yield passage
24        after = passages[-1]["id"]

The script reads one agent at a time. Keep the list of agent ids you want to move in your own app and pass each one in. Core memory blocks are not archival passages, so this script does not return them.

Step 2: Map the fields

Letta fieldHindsight fieldNote
textcontentOnly required field in Hindsight.
created_attimestampISO 8601. Use the time the memory was written, not the import time.
iddocument_idRe-sending the same id replaces that document, so re-runs do not duplicate.
agentbank (bank_id)One bank per agent.
tagstagsHindsight accepts tags on each item. Check the field name in your client version.
metadatametadataHindsight stores metadata values as strings, so convert them.
file_namecontextShort label that says where the text came from.

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_agent(agent_id):
 6    batch = []
 7    for p in export_agent(agent_id):
 8        batch.append({
 9            "content": p["text"],
10            "timestamp": p["created_at"],
11            "document_id": p["id"],
12            "context": p.get("file_name") or "letta import",
13            "metadata": {k: str(v) for k, v in (p.get("metadata") or {}).items()},
14        })
15        if len(batch) == 50:
16            hs.retain_batch(bank_id=agent_id, items=batch)
17            batch = []
18    if batch:
19        hs.retain_batch(bank_id=agent_id, items=batch)

We did not run this against a live Letta server or Hindsight server. Check the field names against one real Letta response first, then test one agent before a full run.

What does not carry over

  • Core memory blocks. Letta keeps pinned blocks in the context window. They are not passages, so this script does not move them. Hindsight has no pinned blocks. Put the text where your agent reads it each turn.
  • Embeddings and search scores. Letta searches its passages with its own embedding model. Hindsight ranks results with its own recall (four strategies in parallel, then a rerank). Scores do not match.
  • Tag filters. Letta’s search can filter by tag. This import keeps the tags on each item, but check in a test that your tag queries return the same results.
  • Agent state and the conversation. Messages, tool history and the agent’s own edits are not in the archive. Only the passages move.
  • Facts are re-extracted. In its default concise mode, Hindsight builds its own facts from each passage, so the imported wording is not kept 1:1. verbatim mode keeps the original chunk text (Hindsight’s retain docs, read 5 December 2026). Check important facts with recall.

What it costs

Retain calls an LLM for each item, so the import costs model calls. Self-hosted Hindsight is free under MIT, and you pay your LLM provider. Add up the total passage text before you start.

When Hindsight fits

Hindsight’s open-source server includes its graph, temporal recall, consolidation and mental models, under MIT. We have no Letta benchmark in our sources, so this page does not claim a score for Letta. For the head-to-head, read Letta vs Hindsight and Letta AI guide.

Hindsight returns more context per retrieval by default, so check your token budget. Set max_tokens lower if your prompt is small.