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

# Extraction settings

> Teach a space your domain: what a write should keep, in your vocabulary, before it ever becomes a memory.

Recording a memory is not storage. Your text goes through one pass that decides which
facts are worth keeping long-term and how they are phrased, and only what survives that
pass is ever stored. It is the highest-leverage step in the whole system: a detail the
extractor drops is not merely ranked low later, it is not there at all, and no amount of
query tuning brings it back.

By default every space runs the same general-purpose rules. **Extraction settings** point
those rules at your domain — the terms your team uses, the fields that always matter, the
noise worth skipping.

<Note>
  Settings apply to writes made **after** you save them. Memories already stored are never
  re-extracted, so changing these is safe and never rewrites history.
</Note>

<Tip>
  Everything on this page is also on the **Extraction** tab of a space in the
  [dashboard](https://memory.anonalabs.com).
</Tip>

## The two knobs

`guidance` is **added** to the standard rules and applies in every mode. Reach for it
first — it is the one most spaces ever need.

`custom_prompt` **replaces** those rules, and only applies while `mode` is `custom`. The
memory format is untouched either way: dates, entities and the fields of a memory are
read the same, so custom rules change what gets kept, never the shape of what comes back.

## Read the settings

```http theme={null}
GET /v1/spaces/{space_id}/extraction-settings
Authorization: Bearer anona_live_YOUR_KEY
```

**Response** `200 OK`

```json theme={null}
{
  "space_id": "engineering",
  "mode": "concise",
  "guidance": "Engineering log. Always capture service names, metric values with units, and the named owner.",
  "custom_prompt": null
}
```

Every field is nullable, and `null` means **unset** — that field follows the platform
default and keeps following it. That is a different thing from setting it to whatever the
default happens to be today.

## Update the settings

```http theme={null}
PUT /v1/spaces/{space_id}/extraction-settings
Authorization: Bearer anona_live_YOUR_KEY
Content-Type: application/json
```

```json theme={null}
{
  "mode": "concise",
  "guidance": "Engineering log. Always capture service names, metric values with units, and the named owner. Treat incidents as dated events. Skip standup small talk."
}
```

| Field           | Type                                             | Default   | Description                                                                              |
| --------------- | ------------------------------------------------ | --------- | ---------------------------------------------------------------------------------------- |
| `mode`          | `concise` \| `verbose` \| `verbatim` \| `custom` | `concise` | How much detail a memory keeps. See [modes](#modes).                                     |
| `guidance`      | string                                           | unset     | Added to the standard rules, in every mode. Max 4,000 characters.                        |
| `custom_prompt` | string                                           | unset     | Replaces the standard rules. Only applies when `mode` is `custom`. Max 8,000 characters. |

`PUT` replaces the whole record, so a field you leave out is **cleared**, not kept — the
body always describes the state you want, not a patch on top of what is there.

**Response** `200 OK` — the stored settings, in the same shape as the `GET`.

## Reset to the defaults

```http theme={null}
DELETE /v1/spaces/{space_id}/extraction-settings
Authorization: Bearer anona_live_YOUR_KEY
```

**Response** `204 No Content`

The space goes back to the standard rules. Stored memories are unaffected.

## Modes

| Mode       | What a write becomes                                                                                                                                         |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `concise`  | One tight fact per idea. The default, and the right choice for conversational memory.                                                                        |
| `verbose`  | Every specific the text contains. Larger memories and a higher cost per write; useful when detail matters more than volume.                                  |
| `verbatim` | Your text stored exactly as written, with only the surrounding metadata derived. For content whose wording is the point — policies, clauses, incident notes. |
| `custom`   | The rules in `custom_prompt` instead of the standard ones.                                                                                                   |

## Writing good guidance

Extraction responds to specifics, not adjectives. "Be thorough" changes little; naming a
field changes a lot.

<CodeGroup>
  ```text Support theme={null}
  Customer support transcripts. Always capture the product area, the plan the customer is
  on, and any promised follow-up with its date. "P1" means severity, not priority. Skip
  greetings and pleasantries.
  ```

  ```text Clinical theme={null}
  Clinical notes. Always capture medication names with dosage and frequency, and
  appointment dates. "PT" means physical therapy, never patient. Never infer a diagnosis
  that was not stated outright.
  ```

  ```text Sales theme={null}
  Sales calls. Always capture the accounts and people named, budget or timeline
  commitments, and objections raised. Record who said a thing, not only that it was said.
  ```
</CodeGroup>

Three habits that pay off:

* **Name your vocabulary.** Ambiguous abbreviations are the single most common source of
  wrong extractions, and one sentence fixes them.
* **List the fields that must never be dropped.** That is what turns a good guess into a
  reliable one.
* **Say what to skip.** Excluding noise is as valuable as including signal, and it keeps
  memories smaller and recall sharper.

Guidance rides along on every write, so keep it to the rules that genuinely matter rather
than a full manual.

## Verifying a change

There is no error when guidance is unhelpful — extraction simply keeps different things.
The quickest way to see the effect:

1. Save the settings.
2. Record a representative piece of text with [`POST /v1/record`](/api-reference/memories).
3. Read the memory back with [`GET /v1/spaces/{space_id}/memories`](/api-reference/memories)
   and check the facts are the ones you wanted.

Adjust and repeat. Because nothing is re-extracted, older memories keep whatever they
were stored with.

## Permissions

Extraction settings decide what every member's writes turn into, so reading and changing
them is limited to the space's **owner**. A member of a shared space gets
`403 space_owner_only`.

These routes are not metered — an org that has run out of credits can still change or
turn off its settings.

## Errors

| Code               | Status | Meaning                                                                  |
| ------------------ | ------ | ------------------------------------------------------------------------ |
| `space_not_found`  | 404    | No space with that id.                                                   |
| `space_owner_only` | 403    | Only the owning org can read or change extraction settings.              |
| `validation_error` | 422    | An unknown `mode`, an unknown field name, or text past the length limit. |
