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

# tag & memory

> Group learning environments into reusable suites, and store durable Markdown guidance RELAI considers during generation and optimization.

Most projects never need to manage tags or memory by hand. RELAI attaches
tags automatically when it creates learning environments and benchmarks — one
recording the environment's scope, one grouping related environments — and
the optimizer maintains its own memory between runs, tied to those tags. The
commands below are for inspecting that state, selecting suites by tag, and
adding durable guidance of your own.

## `relai tag`

Use `relai tag` to group learning environments into reusable suites.

### `list`

List tags. Use `--verbose` to include the learning environment file locations for each tag.

```sh theme={"system"}
relai tag list
relai tag list --verbose
```

## `relai memory`

Store Markdown guidance RELAI should consider during future generation and optimization. Most memory commands operate on one scope:

| Scope                      | Meaning                                                            |
| -------------------------- | ------------------------------------------------------------------ |
| `agent`                    | Whole-agent memory.                                                |
| `tag {TAG}`                | Memory for an existing RELAI tag.                                  |
| `component {COMPONENT_ID}` | Memory for a component id from `.relai/learning-env-context.json`. |
| `evaluator {EVALUATOR_ID}` | Memory for a global evaluator id from `.relai/evaluators`.         |

### Read

```sh theme={"system"}
relai memory read agent
relai memory read tag {tag}
relai memory read component {component-id}
relai memory read evaluator {evaluator-id}
```

Prints Markdown memory content, or empty output if no memory exists.

### Write or append

Use one content source: `--text`, `--file`, or `--stdin`. `write` replaces memory; `append` adds to existing memory.

```sh theme={"system"}
relai memory write agent --text "{durable guidance for RELAI}"
relai memory append evaluator {evaluator-id} --file {path/to/note.md}
printf '%s\n' "{durable guidance for RELAI}" | relai memory write component {component-id} --stdin
```

### Paths and scopes

```sh theme={"system"}
relai memory path agent
relai memory path tag {tag}
relai memory list
```

`path` prints the filesystem path for one memory file. `list` prints known memory scopes and paths.

Common failures: unknown scope, invalid file path, missing content option, or content over the memory size limit.
