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

# Drift detection

> Catch quality, latency, and cost drifting from baseline before users feel it.

Drift monitors watch a metric or output feature over time and alert when it
diverges from a baseline distribution.

## How it works

* You pick a **target** — an output feature (e.g. `total_tokens`, a score, a
  latency) — and a **window** (e.g. hourly).
* RunAgain computes a drift statistic per window against the baseline. The
  default method is **PSI** (Population Stability Index).
* When the statistic crosses your **threshold**, the window is flagged
  `warning` or `drift`.

## Creating a monitor

In a project, open **Drift → New monitor** and set:

* **Target** — the feature/metric to watch (e.g. `total_tokens`).
* **Method** — `psi` (default).
* **Window** — granularity and size (e.g. 1 hour).
* **Threshold** — the value + operator that trips an alert (e.g. `>= 0.25`).

## Reading the series

Each monitor shows a time series of the drift statistic with `ok` / `warning` /
`drift` status per window, plus sample sizes so you can tell signal from noise.

<Card title="See it in the app" icon="git-compare-arrows" href="/app/traces">
  Drift monitors live under each project's Drift tab.
</Card>
