> For the complete documentation index, see [llms.txt](https://nfa.gitbook.io/nfa-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nfa.gitbook.io/nfa-docs/the-forecasting-engine/the-forecast-pipeline.md).

# The forecast pipeline

## The forecast pipeline

A run starts from a market reference and ends with a calibrated probability distribution, a full reasoning trace, and a record of exactly what happened. This page walks the whole path in order.

### The debate at a glance

```mermaid
sequenceDiagram
    participant C as Caster
    participant A as Advocates
    participant D as Debate
    participant J as Judge
    C->>A: Assign each advocate an outcome and a research brief
    A->>A: Each advocate researches its own case
    A->>D: Opening statements
    D->>D: Rebuttal rounds aimed at the crux
    D->>J: Full transcript plus evidence
    J-->>C: Calibrated distribution
```

### Stage by stage

{% stepper %}
{% step %}

#### Bind the market

The market is parsed, its metadata is fetched, and its outcomes are read in order. Markets that resolve on a single sports game or are already decided are stopped here, before any model spend.
{% endstep %}

{% step %}

#### Classify and research

A classifier assigns the market a category, and a researcher builds an evidence corpus for the question, which every advocate and the judge share as common ground.
{% endstep %}

{% step %}

#### Frame the outcomes

Long outcome fields are reduced to the serious contenders plus a single aggregate Other, so the debate spends its effort where the probability actually is. Ordinal ladders keep their order. Binary markets stay two-sided.
{% endstep %}

{% step %}

#### Cast the advocates

One advocate is cast per outcome. Each is a generic authority archetype with a name, a role, and a thesis, and never a real identifiable person. Each advocate then runs its own targeted research, so it argues from information the others do not have.
{% endstep %}

{% step %}

#### Debate

Advocates give opening statements, then exchange rebuttals directed at the decisive question the judge has flagged.
{% endstep %}

{% step %}

#### Judge and verify

The judge identifies the crux mid-debate and researches it. Before ruling, it checks the one decisive claim that nothing in the evidence yet supports. Then it rules the debate into a calibrated distribution.
{% endstep %}

{% step %}

#### Finalize

The engine writes the final distribution, runs its self-verification, records what it did, prices the run, and persists everything.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
If the language model provider is unavailable and no verdict can be produced, the run fails without charge and no forecast is served. A run never emits a fabricated number as a fallback.
{% endhint %}

### What a run produces

* A **distribution** over the outcomes, with the first-outcome probability as the headline number for binaries.
* A **reasoning trace**: the advocates and their theses, the crux question and the evidence that settled it, and the judge's credited and discounted arguments.
* A **corpus-only control**: a parallel number the judge would have given from the shared corpus alone, which shows how much the debate moved the estimate.
* A record of the models, options, anchors, and verification result behind the run.


---

# 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://nfa.gitbook.io/nfa-docs/the-forecasting-engine/the-forecast-pipeline.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.
