> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memanto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# memanto migrate

> Migrate memories from other providers (Mem0, Letta, Supermemory) or an OKF bundle into Memanto.

# memanto migrate

Import your memories from another provider into a Memanto agent. Each
subcommand pulls (or loads) the provider's export, maps the source records
onto Memanto memory types, and bulk-writes them into the target agent.

```bash theme={null}
memanto migrate PROVIDER [OPTIONS]
```

**Providers:**

* `mem0` - Migrate a Mem0 account
* `letta` - Migrate Letta archival passages
* `supermemory` - Migrate a Supermemory account
* `okf` - Import an [Open Knowledge Format](/integrations/okf) bundle from disk (see [OKF import](#okf-import) below)

**Options:**

* `--api-key TEXT` - Provider API key (saved to `~/.memanto/.env`). Can also be supplied via the provider's environment variable.
* `-f, --file PATH` - Use an existing provider export JSON instead of pulling a live export.
* `-a, --agent TEXT` - Target Memanto agent ID (defaults to the active agent).
* `--dry-run` - Preview the mapping and savings report without writing anything.
* `--report` - Also write the token/latency/storage savings report on a real run.

The API key for each provider is read from these environment variables when
`--api-key` is not passed:

| Provider      | Environment variable  |
| ------------- | --------------------- |
| `mem0`        | `MEM0_API_KEY`        |
| `letta`       | `LETTA_API_KEY`       |
| `supermemory` | `SUPERMEMORY_API_KEY` |

If no key is found, you are prompted for one and it is saved to `~/.memanto/.env`.

## How it works

1. **Load** the provider export — either from disk (`--file`) or by pulling a live export with your API key.
2. **Map** the source records onto Memanto memory types.
3. **Import** the mapped memories into the target agent in batches of up to 100.
4. **Report** (optional) — render a token/storage/latency savings report.

Empty source records are skipped. On a real run the target agent must be
resolvable (pass `--agent` or activate one first); a dry run does not need a
target agent.

## Examples

Preview a Mem0 migration without writing anything (also renders the savings report):

```bash theme={null}
memanto migrate mem0 --dry-run
```

Migrate a previously exported file into the active agent:

```bash theme={null}
memanto migrate mem0 --file ./mem0_export.json
```

Migrate Letta into a specific agent and write the savings report:

```bash theme={null}
memanto migrate letta --agent my-agent --report
```

Migrate Supermemory, providing the API key inline:

```bash theme={null}
memanto migrate supermemory --api-key sk-...
```

## OKF import

The `okf` subcommand imports an [Open Knowledge Format](/integrations/okf)
bundle — a local directory of markdown files (or a single `.md` file) — rather
than a hosted provider account. It takes a path instead of an API key, and does
not produce a savings report.

```bash theme={null}
memanto migrate okf PATH [OPTIONS]
```

**Options:**

* `-a, --agent TEXT` - Target Memanto agent ID (defaults to the active agent).
* `--dry-run` - Preview the mapping without writing anything.

**Behavior:**

* Fields that don't map onto a Memanto column are preserved in a bounded
  `[Supporting data]` footer, so nothing is lost.
* OKF's free-form `type` is auto-classified when it isn't one of Memanto's 13
  types (the original value is kept in the footer).
* When the bundle has a `memories/` folder, import is scoped to it — the
  `daily-summaries/`, `sessions/`, and `metrics/` context sections are ignored,
  so they are never re-ingested as memories.

Examples:

```bash theme={null}
# Preview the mapping without writing
memanto migrate okf ./okf-bundle --dry-run

# Import a bundle into a specific agent
memanto migrate okf ./okf-bundle --agent my-agent
```

See the [OKF integration guide](/integrations/okf) for the bundle layout, the
field-mapping table, and round-trip behavior.

## Output

Results are written to a timestamped run directory under
`~/.memanto/migrate/<provider>/<timestamp>/`, containing:

* `mapped_preview.json` - the mapped Memanto payloads (always written, so a dry run is fully inspectable).
* `migrate-report.md` - the savings report (written on a dry run, or on a real run with `--report`).

The command also prints a summary panel with the source record count, the
number of mapped memories, a per-type breakdown, and — on a real run — the
imported / failed / batch counts and the target agent.

**Notes:**

* The savings report includes a short LLM-written narrative generated through the active agent. If no agent is active, the narrative is skipped (the rest of the report is still produced).
* Migrating into Memanto uses the same batch import as [`memanto remember --batch`](/cli/data/remember).
