> ## 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 policy purge

> Permanently delete memories that have been expired longer than the purge window.

# memanto policy purge

Permanently delete memories that have **already been expired** for longer than the
policy's `purge_expired_after` window.

<Warning>
  This is the only destructive step in the memory lifecycle and it cannot be undone.
  Purged memories are gone from the backend — `memanto memory restore` will not
  bring them back.
</Warning>

```bash theme={null}
memanto policy purge [OPTIONS]
```

**Options:**

* `-a, --agent TEXT` - Agent identifier (defaults to active agent)
* `--dry-run` - Show what would be deleted without deleting
* `-y, --yes` - Skip the confirmation prompt

**Examples:**

```bash theme={null}
memanto policy purge --dry-run
memanto policy purge
```

**Output:**

Disabled (the default):

```
Purging is disabled for this agent.
Set 'purge_expired_after' in the policy to enable it.
```

With a window set:

```
1 memory/memories expired more than 365d ago.
  d6d622be-49d5-4f4d-921a-64140f24dc98 — Deploys go through the release bot

This permanently deletes 1 memory/memories. They cannot be restored.
Purge them? [y/N]: y

Purged 1 memories.
```

<Note>
  `purge_expired_after` is **not** a retention setting. `retention` decides what
  becomes `expired`; this decides when an already-expired memory is destroyed. A
  policy where [`policy apply`](/cli/policy/apply) reports 0 matches can still have
  memories eligible for purge.
</Note>

**Notes:**

* Disabled unless the policy sets `purge_expired_after`. Every preset except `aggressive` leaves it off.
* Only memories carrying an `expired_at` stamp are eligible — an expired record with no stamp has no defensible purge date and is left alone.
* The window is measured from `expired_at`, not from when the memory was created.
* Always previews before prompting, even without `--dry-run`.
* Backed by the [Purge Expired Memories](/api-reference/policy/purge-expired) API endpoint.
