# Memory Rules CLI Commands

> The soat CLI commands for the Memory Rules module, with usage and every option, generated from the OpenAPI spec.

# Memory Rules Commands

See [Memory Rules module docs](../../modules/memories) for permissions and data model.

### `soat list-memory-rules`

List memory rules

- Method: `GET`
- Path: `/api/v1/memory-rules`

#### Usage

```bash
soat list-memory-rules
```

#### Options

##### `--memory-store-id`

Only the rules of this memory store

- Source: `query`
- Required: no
- Type: `string`
- Example: `mstore_V1StGXR8Z5jdHi6B`

##### `--project-id`

Project ID (required if not using project key auth)

- Source: `query`
- Required: no
- Type: `string`
- Example: `proj_V1StGXR8Z5jdHi6B`

### `soat create-memory-rule`

Create a memory rule

- Method: `POST`
- Path: `/api/v1/memory-rules`

#### Usage

```bash
soat create-memory-rule --memory-store-id <string> --on <enum("generations.completed", "conversation_messages.generated")>
```

#### Options

##### `--memory-store-id`

The destination store, and the rule's owning scope

- Source: `body`
- Required: yes
- Type: `string`
- Example: `mstore_V1StGXR8Z5jdHi6B`

##### `--on`

The event a firing reads. `generations.completed` fires once per completed turn whatever the transport, and is the only event the built-in extractor may bind to. `conversation_messages.generated` fires per persisted assistant reply and is conversation-backed, so it is for custom handlers.

- Source: `body`
- Required: yes
- Type: `enum("generations.completed", "conversation_messages.generated")`
- Example: `generations.completed`

##### `--source-agent-ids`

Agents whose turns this rule reads. Omit or send `null` for every agent in the store's project.

- Source: `body`
- Required: no
- Type: `array<string>`
- Example: `["agent_V1StGXR8Z5jdHi6B"]`

##### `--agent-id`

Handler agent (mutually exclusive with tool_id)

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--tool-id`

Handler tool (mutually exclusive with agent_id)

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--action`

Operation id, for a tool handler

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--preset-parameters`

Merged into a tool handler's input before invocation. The turn's own fields are reserved and win.

- Source: `body`
- Required: no
- Type: `object`

##### `--prompt`

Replaces the built-in extractor's task instructions. The JSON response contract and the transcript are always appended. Not valid with a handler.

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--ai-provider-id`

Provider override for the built-in extractor's completion. Not valid with a handler.

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--model`

Model override for the built-in extractor's completion. Not valid with a handler.

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--enabled`

A disabled rule is kept and never fires

- Source: `body`
- Required: no
- Type: `boolean`
- Default: `true`

### `soat get-memory-rule`

Get a memory rule

- Method: `GET`
- Path: `/api/v1/memory-rules/{memory_rule_id}`

#### Usage

```bash
soat get-memory-rule --memory-rule-id <string>
```

#### Options

##### `--memory-rule-id`

Memory rule ID

- Source: `path`
- Required: yes
- Type: `string`
- Example: `mrule_V1StGXR8Z5jdHi6B`

### `soat update-memory-rule`

Update a memory rule

- Method: `PATCH`
- Path: `/api/v1/memory-rules/{memory_rule_id}`

#### Usage

```bash
soat update-memory-rule --memory-rule-id <string>
```

#### Options

##### `--memory-rule-id`

Memory rule ID

- Source: `path`
- Required: yes
- Type: `string`

##### `--on`

The event a firing reads. `generations.completed` fires once per completed turn whatever the transport, and is the only event the built-in extractor may bind to. `conversation_messages.generated` fires per persisted assistant reply and is conversation-backed, so it is for custom handlers.

- Source: `body`
- Required: no
- Type: `enum("generations.completed", "conversation_messages.generated")`
- Example: `generations.completed`

##### `--source-agent-ids`

Send `null` to widen the rule to every agent in the project

- Source: `body`
- Required: no
- Type: `array<string>`

##### `--agent-id`

—

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--tool-id`

—

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--action`

—

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--preset-parameters`

—

- Source: `body`
- Required: no
- Type: `object`

##### `--prompt`

—

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--ai-provider-id`

—

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--model`

—

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--enabled`

—

- Source: `body`
- Required: no
- Type: `boolean`

### `soat delete-memory-rule`

Delete a memory rule

- Method: `DELETE`
- Path: `/api/v1/memory-rules/{memory_rule_id}`

#### Usage

```bash
soat delete-memory-rule --memory-rule-id <string>
```

#### Options

##### `--memory-rule-id`

Memory rule ID

- Source: `path`
- Required: yes
- Type: `string`
