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

> 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.

Source: https://aiagentmemory.org/articles/migrate-letta-to-hindsight/ · Updated 2026-12-05 · aiagentmemory.org


**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.

```python
import requests

LETTA_URL = "http://localhost:8283"  # your Letta server
LETTA_KEY = "YOUR_LETTA_API_KEY"     # leave empty for a local server without auth

def export_agent(agent_id):
    after = None
    while True:
        params = {"limit": 200, "ascending": "true"}
        if after:
            params["after"] = after
        resp = requests.get(
            f"{LETTA_URL}/v1/agents/{agent_id}/archival-memory",
            headers={"Authorization": f"Bearer {LETTA_KEY}"} if LETTA_KEY else {},
            params=params,
            timeout=60,
        )
        resp.raise_for_status()
        passages = resp.json()
        if not passages:
            break
        for passage in passages:
            yield passage
        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 field | Hindsight field | Note |
|---|---|---|
| `text` | `content` | Only required field in Hindsight. |
| `created_at` | `timestamp` | ISO 8601. Use the time the memory was written, not the import time. |
| `id` | `document_id` | Re-sending the same id replaces that document, so re-runs do not duplicate. |
| agent | bank (`bank_id`) | One bank per agent. |
| `tags` | `tags` | Hindsight accepts tags on each item. Check the field name in your client version. |
| `metadata` | `metadata` | Hindsight stores metadata values as strings, so convert them. |
| `file_name` | `context` | Short 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.

```python
from hindsight_client import Hindsight

hs = Hindsight(base_url="http://localhost:8888")  # your Hindsight server

def load_agent(agent_id):
    batch = []
    for p in export_agent(agent_id):
        batch.append({
            "content": p["text"],
            "timestamp": p["created_at"],
            "document_id": p["id"],
            "context": p.get("file_name") or "letta import",
            "metadata": {k: str(v) for k, v in (p.get("metadata") or {}).items()},
        })
        if len(batch) == 50:
            hs.retain_batch(bank_id=agent_id, items=batch)
            batch = []
    if batch:
        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](https://hindsight.ai/oss/developer/retain), 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](/articles/letta-vs-hindsight/) and [Letta AI guide](/articles/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.


## FAQ

### Is there an official tool to migrate from Letta to Hindsight?

No. Neither Letta nor Hindsight has an official import tool or migration guide between them, as of 5 December 2026. You list the archival passages of each Letta agent with Letta's passages API, then load them into Hindsight with batch retain.

### Does Hindsight keep Letta's memory blocks?

Not as blocks. This guide moves archival passages only. Core memory blocks are small pinned text that the agent sees every turn, so copy them by hand into the prompt or into a retained document, and check the result with recall.

### Can I re-run a Letta to Hindsight import without duplicates?

Yes, if you pass the Letta passage id as document_id. Sending the same document_id again replaces that document, so a second run does not add copies.

