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

# memories

> Page through, correct, delete and trace stored memories from the anona CLI.

Every command here addresses one space: pass `--space`, or set
`ANONA_SPACE_ID` (a temporary profile uses `default`). To *search* memories use
[`retrieve`](https://docs.anonalabs.com/cli/memory#retrieve); these commands browse and change them.

| Command | pip | npm |
| - | - | - |
| `memories list`, `edit`, `delete`, `history` | yes | 0.19.0 |
| `memories list --member-id`, `--tag-groups` | 0.25.0 | 0.19.0 |

## memories list

```bash theme={null}
anona memories list --space notes
anona memories list --space notes --q pnpm --limit 20
anona memories list --space notes --member-id me --json
```

One memory per line: full id, type, content; then `Showing 1-50 of N`.
`GET /v1/spaces/{id}/memories`.

| Flag | |
| - | - |
| `--limit N` | At most this many, 1-200 (default 50) |
| `--offset N` | Skip this many first (default 0) |
| `--q TEXT` | Only memories whose text or context contains this (a case-insensitive substring match) |
| `--type TYPE` | Only memories of this type: `fact`, `experience`, `note` or `summary`. Only facts and experiences can be edited; a note is rebuilt from them. |
| `--no-prefer-observations` | List the raw facts beside the synthesized notes built from them. The default lists only the note |
| `--member-id ID` | Only memories this member wrote; `me` for your own. Shared spaces only. *pip 0.25.0* |
| `--tag-groups JSON` | A [compound tag filter](https://docs.anonalabs.com/api-reference/retrieve.md#compound-tag-filters); `@FILE` reads it. *pip 0.25.0* |
| `--user-id`, `--agent-id`, `--session-id` | Only memories recorded under that scope |

An empty list is a document with an empty list, and exit `0`.

**`--json`:** `{"items": [{"id", "content", "type", "state", "tags", "source_ids", ...}], "total", "limit", "offset"}`.

## memories edit

```bash theme={null}
anona memories edit MEMORY_ID --text "The team ships on Wednesdays." --reason "moved in March" --space notes
```

Corrects one memory's text in place. `--text` is required; `--reason` is kept
on the memory's history. `PATCH /v1/spaces/{id}/memories/{memory_id}`. Owner
only on a shared space (`space_owner_only`).

**`--json`:** the edited memory, `{"id", "content", "type", "state", ...}`.

## memories delete

```bash theme={null}
anona memories delete MEMORY_ID --yes --space notes
```

Deletes one memory. `DELETE /v1/spaces/{id}/memories/{memory_id}`. Without
`--yes` it exits `2`, sends nothing, and says what would have been deleted:

```text theme={null}
anona: this would delete memory 0f3c9a2e-… in space 'notes'. Pass --yes to do it. Nothing was sent.
```

It never prompts. Owner only on a shared space.

**`--json`:** `{"deleted": true, "memory_id", "space_id"}`, written by the CLI
(the API answers with no body).

## memories history

```bash theme={null}
anona memories history MEMORY_ID --space notes
```

Each earlier version of one memory, when it changed and why.
`GET /v1/spaces/{id}/memories/{memory_id}/history`.

**`--json`:** `{"memory_id", "history": [{"previous_content", "changed_at", "reason"}]}`.

There is no command to read one memory by id, because the API has no such
call; `memories list --q` or `retrieve` finds it.

## Related

* API: [Memories](https://docs.anonalabs.com/api-reference/memories.md#list-memories-in-a-space).
* [Correct a memory](https://docs.anonalabs.com/use-cases/correct-a-memory.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.