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

# Memory models, profile, rules, webhooks, routing

> Create and manage a space's memory models, profile, rules, webhooks, routing settings and members from the anona CLI.

pip 0.26.0; npm 0.20.0

What shapes how a space behaves, one command per API call. Every command here
addresses one space: `--space`, or `ANONA_SPACE_ID`. Each takes `--api-key` and
`--json`. A flag you do not give is left out of the request. Rules and webhooks
also work from a temporary profile ([`anona start`](https://docs.anonalabs.com/cli/sign-in)).

A command that deletes or empties something (`delete`, `clear`, `reset`)
refuses without `--yes`: it exits `2`, prints `Nothing was sent.`, and
sends nothing.

## Memory models

A memory model is a question a space keeps answered. See
[Memory models](https://docs.anonalabs.com/api-reference/models.md) for the concept; `anona model ID` is the
older spelling of `models get`.

```bash theme={null}
anona models list --space notes
anona models create "Build habits" --query "How does this team build?" --space notes
anona models get MODEL_ID --space notes
anona models edit MODEL_ID --query "How does the team ship?" --space notes
anona models refresh MODEL_ID --space notes
anona models history MODEL_ID --space notes
anona models clear MODEL_ID --yes --space notes
anona models delete MODEL_ID --yes --space notes
```

| Flag | On | |
| - | - | - |
| `--limit N`, `--offset N`, `--tags T` | `list` | Page size 1-200 (default 50); skip; only models scoped to these comma-separated tags |
| `--query Q` | `create`, `edit` | The question the model answers (required on `create`) |
| `--name NAME` | `edit` | The new name (`create` takes it as its argument) |
| `--tags T` | `create`, `edit` | Comma-separated tags that scope the model to matching memories |
| `--mode full\|delta` | `create`, `edit` | `full` regenerates on refresh, `delta` edits in place |
| `--refresh-on-new-memories`, `--no-refresh-on-new-memories` | `create`, `edit` | Refresh when new memories are consolidated |
| `--memory-type TYPE` | `create`, `edit` | Build from this memory type only; repeatable |
| `--max-tokens N` | `create`, `edit` | Ceiling on the content length, 256-8192 |
| `--model-id ID` | `create` | A stable id: lowercase letters, digits and hyphens |

`create` and `refresh` run in the background: they print
`Creating memory model <id> (job <job_id>).` and `Refreshing <id> (job <job_id>).`,
and the job is pollable with [`anona jobs get`](https://docs.anonalabs.com/cli/jobs). They are billed at
submit time. `edit` merges what you pass into the stored trigger rather than
replacing it, and does not refresh. `clear` empties the content and keeps the
definition; `delete` removes the model.

## Profile

```bash theme={null}
anona profile --space notes
anona profile set --mission "Support notes for the billing team" --skepticism 4 --space notes
anona profile reset --yes --space notes
```

`profile` alone is unchanged. `set` changes the fields you name **and keeps the
rest** (the API replaces the whole profile, so the CLI reads, merges and writes
back); `reset` returns it to the defaults.

| Flag | |
| - | - |
| `--mission TEXT` | What the space is for; `@FILE` reads it from a file |
| `--skepticism 1-5` | 1 takes statements at face value, 5 the opposite |
| `--literalism 1-5` | 1 reads intent loosely, 5 the opposite |
| `--empathy 1-5` | 1 ignores emotional context, 5 the opposite |
| `--yes` | With `reset`: confirm |

## Rules

Standing instructions `reason` applies in this space. See
[Rules](https://docs.anonalabs.com/api-reference/spaces.md#rules).

```bash theme={null}
anona rules list --space notes
anona rules add "Never state revenue as committed without a signed document." --space notes
anona rules edit RULE_ID --no-active --space notes
anona rules delete RULE_ID --yes --space notes
```

| Flag | On | |
| - | - | - |
| `--name NAME` | `add`, `edit` | A short label (`add` default: the first 60 characters of the text) |
| `--text TEXT` | `edit` | The new rule text; `@FILE` reads it |
| `--priority N` | `add`, `edit` | 0-1000; higher comes first in the prompt |
| `--active`, `--no-active` | `add`, `edit` | Switch the rule on or off |
| `--tags T` | `add`, `edit` | Comma-separated tags (`edit` replaces them) |

Output is `<id>  <text>`, then `Added rule <id>.`, `Updated rule <id>.` and
`Deleted rule <id>.`.

## Webhooks

```bash theme={null}
anona webhooks list --space notes
anona webhooks create https://example.com/hooks/anona --events memory.created,memory.consolidated --space notes
anona webhooks edit WEBHOOK_ID --no-enabled --space notes
anona webhooks deliveries WEBHOOK_ID --limit 20 --space notes
anona webhooks delete WEBHOOK_ID --yes --space notes
```

| Flag | On | |
| - | - | - |
| `--events E,E` | `create`, `edit` | `memory.created`, `memory.consolidated`, `security.policy_triggered` (`create` default: `memory.created`) |
| `--url URL` | `edit` | The new HTTPS endpoint |
| `--enabled`, `--no-enabled` | `create`, `edit` | Deliver events, or pause |
| `--limit N`, `--cursor C` | `deliveries` | Up to 200 (default 50); continue from a previous page |

`create` shows the signing secret **once** and says
`Save this secret now; it is not shown again.`. No other command prints it.
See [Webhooks](https://docs.anonalabs.com/api-reference/webhooks.md) for the payloads and signature.

## Routing settings

Where a write with no space lands. Same `get` / `set` / `reset` shape as the
[other settings](https://docs.anonalabs.com/cli/settings.md#how-set-works): `set` keeps the fields you do not
name, `--clear FIELD` unsets one (repeatable; one of `charter`, `topics`,
`rules`), and `reset --yes` clears them all.

```bash theme={null}
anona routing-settings get --space notes
anona routing-settings set --charter "Billing questions" --topics billing,invoices --space notes
anona routing-settings reset --yes --space notes
```

| Flag | |
| - | - |
| `--charter TEXT` | What belongs in this space; `@FILE` reads it |
| `--topics A,B` | Comma-separated topics the space covers |
| `--rules-file PATH` | A JSON array of routing rules, e.g. `[{"field":"agent_id","op":"equals","value":"billing-bot","space_id":"billing"}]` |
| `--auto-route`, `--no-auto-route` | Let writes with no space land by topic |
| `--shared-auto-route`, `--no-shared-auto-route` | Let writes route into spaces shared with you |

## Space members

```bash theme={null}
anona spaces members list notes
```

`list` prints `<member_id>  <email>  <role>` for everyone a space is shared
with. It reads the space's member directory, which needs the command-line login
from [`anona login --cli`](https://docs.anonalabs.com/cli/sign-in#with-anona-login) and an owner or admin
role; an API key or a temporary profile gets exit `4` with `session_required`.

Inviting or removing someone is done in the dashboard. `anona spaces members
remove SPACE MEMBER_ID` sends nothing, exits `4`, and prints:

```text theme={null}
anona: removing a space member is done in the dashboard: https://memory.anonalabs.com/dashboard/spaces/SPACE
```

`SPACE` is the space you named, escaped as one URL path segment.


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