> ## 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 memory export

> Export all of an agent's memories to a Markdown file.

# memanto memory export

Export all agent memories to file.

```bash theme={null}
memanto memory export [OPTIONS]
```

**Options:**

* `--agent TEXT` - Specific agent (default: active)
* `--output PATH` - Output file path (a directory when `--okf` is used)
* `--limit INTEGER` - Maximum memories per type, `1`–`100` (default: `25`)
* `--okf` - Export an [OKF](/integrations/okf) bundle (a directory of markdown files) instead of a single `memory.md`
* `--split TEXT` - OKF layout: `auto` (default), `file`, or `type` (only used with `--okf`)

**Examples:**

Export to markdown:

```bash theme={null}
memanto memory export
```

Custom output:

```bash theme={null}
memanto memory export --output backup.md
```

Specific agent:

```bash theme={null}
memanto memory export --agent customer-support --output customer-support.md
```

Limit export size:

```bash theme={null}
memanto memory export --limit 100
```

Export an OKF bundle (see the [OKF integration](/integrations/okf)):

```bash theme={null}
memanto memory export --okf
```

Force one file per memory in the OKF bundle:

```bash theme={null}
memanto memory export --okf --split file
```

**Output:**
Creates file with all memories:

```markdown theme={null}
# Agent: customer-support
Date: 2025-03-30
Total Memories: 42
```

**Notes:**

* If the backend is unreachable, export now fails loudly (`ConnectionError`) instead of silently writing an empty cache — a genuine "no memories of this type" still exports fine, but a full outage no longer overwrites a good cache with an empty one.
* With `--okf`, the bundle is written to `~/.memanto/exports/<agent>_okf/` (or the `--output` directory) and nests memories under `memories/` alongside `daily-summaries/`, `sessions/`, and `metrics/` sections when that data exists locally. To place a bundle inside a project directory, use [`memanto memory sync --okf`](/cli/data/sync). See the [OKF integration](/integrations/okf) for the full bundle layout.
