> For the complete documentation index, see [llms.txt](https://docs.tryflox.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tryflox.xyz/concepts/analyst-layer.md).

# The analyst layer

Flox uses a language model, but never to decide. The model explains verdicts and makes forecasts that are later graded against reality.

## The boundary

When an assessment runs, `score.js` computes the verdict **before** the model is ever contacted. The model receives the finished decision and the underlying numbers, and produces:

* a plain-English narrative explaining the verdict
* one falsifiable forecast — direction, magnitude, time horizon, and a confidence

The output is stored under `analysis` with the field `authoritative: false`. It is structurally incapable of changing the verdict, because the verdict already exists when the model runs.

If the model is unreachable, rate-limited, or returns malformed output, the assessment is unaffected — the verdict, the signature, and the log entry all still happen.

## Why not let the model decide

Because then the record would mean nothing. The entire value of the log is that any verdict can be reproduced from its inputs. A model's output cannot be reproduced — run it twice and you may get two answers. Keeping the model out of the decision path is what makes "deterministic and auditable" true rather than aspirational.

The model is also, occasionally, wrong about *why* — it may misattribute a verdict to the wrong reason. That is exactly why it is walled off from the decision. It can be wrong about the explanation and the verdict still stands.

## Grading

Every forecast is scored once its time horizon elapses. The scorecard reports:

* **direction hit rate** — how often the predicted direction was right
* **Brier score** — whether the model's confidence was justified
* **calibration gap** — whether it was systematically over- or under-confident

The grades are committed to the same hash chain as the verdicts. An agent that publishes its prediction accuracy, and lets you check it, is making a far stronger claim than one that only shows its best days.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tryflox.xyz/concepts/analyst-layer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
