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

# Ingest an adaptive observation

> Update a domain's adaptive policy with one structured observation and return the current prediction.

```text theme={null}
POST /api/v1/domains/{domain_id}/adapt/events
```

Use this route to update online adaptive policy state and read `prediction.<output_key>` in the same response.

<Warning>
  This is not the normal domain-event route. `POST /api/v1/domains/{domain_id}/events` records a domain event; `POST /api/v1/domains/{domain_id}/adapt/events` updates an adaptive policy and returns its current structured prediction.
</Warning>

## Request body

```json theme={null}
{
  "session_id": "ignored",
  "values": {
    "observation_index": 1,
    "range_lo": 0.0,
    "range_hi": 180.0,
    "baseline": -50.0,
    "peaks": [
      {
        "position": 104.0,
        "extent": 4.0,
        "strength": -30.0
      }
    ]
  },
  "metadata": {
    "run_id": "adaptive-demo-1",
    "event_id": "adaptive-demo-1-observation-1"
  }
}
```

The keys inside `values` must match the domain's `query_templates.adaptive_interval_policy` field mapping.

## Response shape

```json theme={null}
{
  "status": "success",
  "domain_id": "adaptive-demo-domain",
  "session_id": "agent-id",
  "relation": "persistent_structure",
  "policy": "stable_interval_retention",
  "memory_id": null,
  "observation_index": 1,
  "item_count": 1,
  "prediction": {
    "active_intervals": [],
    "model": {}
  }
}
```

The key under `prediction` comes from the template's exact `output_key`. Policy thresholds determine when rows appear; an empty array can be a valid current prediction.

## Operational notes

* Send observations in their real order.
* Use one writer per domain/session unless interleaving is intended.
* Keep a stable `event_id` for auditable retries.
* Use `POST /api/v1/domains/{domain_id}/adapt/predict` to read current state without adding an observation.
* Generated language is not required to use the structured prediction.
