# Agent

A question in, an answer out in which every statement carries a quote from a page the run read.

```text
POST https://api.millionshort.com/v1/agent
```

Agent takes a question and does the research. It plans searches, runs them on our [sources](https://millionshort.com/docs/search/sources), reads the pages that matter, and writes an answer. Every statement of the answer ends with one or more `[n]` markers, and each marker names a page and the words of that page that support the statement.

Send a `schema` and the answer comes back as JSON in that shape instead, with the citations of each field.

Earlier pages of these docs called this Research. It is the same endpoint.

## What a run is

- **A question in.** `prompt` is the question. You can add pages to read first, hold the run to some sources or sites, and say how much work it may do.
- **A cited answer out.** `answer` is text with `[n]` markers. `citations` lists, for each marker, the page (`url`, `title`, `source`) and the `quote` from it.
- **Or data.** With `schema`, `output` is an object in your shape, `field_citations` maps each cited field to its citations, and `uncited_fields` names the filled fields that no checked quote supports.
- **A job, not a call.** `POST /v1/agent` answers at once with an id. You then poll, read the steps as an event stream, or name a webhook to be told when it ends.
- **A cap you set.** `max_credits` is the most a run may cost. A run that reaches it stops and returns what it has.

## How long it takes

A run usually takes from a few seconds to a few minutes. On our own evaluation set, measured on 2026-11-20, the median run took about 6 seconds on `lite`, 10 seconds on `standard` and 20 seconds on `pro`. That is a measurement, not a promise: a question that needs more searches, slower sites or a longer answer takes longer. No run goes past 10 minutes; one that would is ended as `incomplete`, with `stop_reason: "time"`.

## What a run does

The steps are fixed, and the same on every run:

1. **Plan.** Decide which searches to make, and on which sources.
2. **Search.** Run them with our own [Search](https://millionshort.com/docs/search).
3. **Read.** Fetch the pages worth reading with our own [Extract](https://millionshort.com/docs/extract): a stored copy when we hold one, a live fetch when we do not.
4. **Check what is missing.** On `standard` and `pro`: ask what the question still needs, then search and read again.
5. **Write.** Write the answer, with a quote for each statement.
6. **Check.** Compare every quote with the page it claims to come from, and remove what does not hold.

A question that names somewhere ("bakeries near the station in Leeds") can also use [Places](https://millionshort.com/docs/places).

That is all a run does. Its only tools are our own Search, Extract and Places, and it is our code that calls them: it opens no browser, runs no code, fills in no forms and posts nothing to the sites it reads. The model proposes searches and writes text; our code decides what is fetched and what may be said. [What a page can and cannot do](#what-a-page-can-and-cannot-do) says what that holds against.

How much work a run may do is its `processor`: `lite`, `standard` or `pro`. [Parameters](https://millionshort.com/docs/agent/parameters#processors) has the table.

### Privacy

Agent runs send your question and the pages read to our AI model provider (a sub-processor); they are not used for training. The [privacy policy](https://millionshort.com/privacy) says how we handle data.

## How citations are enforced

A citation here is not a link the model chose to add. It is checked.

- **Every statement needs a quote.** The writer must give, for each statement, words from a page the run fetched.
- **The quote must be in the page, whole.** A quote is kept when it is one unbroken run of the words of the page we fetched: the same words in the same order, with nothing left out, at least 3 words and 12 characters long. Case, spacing and punctuation may differ. A quote that skips words is not kept, however much of it is in the page. A quote that is not kept is dropped.
- **A statement with no quote left is removed.** `uncited_removed` counts how many were.
- **`standard` and `pro` add a second pass.** A second reading puts each statement beside its quotes and removes the statements the quotes do not show. `verified` says whether that pass was made. When it could not be made, the answer is kept on the quote check alone, and `verified` is `false`.
- **Nothing supported means no answer.** If no statement is left, the run ends `incomplete` with `stop_reason: "no_support"`. If the model would not, or could not, write an answer in a form that can be checked, the run ends `incomplete` with `stop_reason: "no_answer"`. Neither falls back to an answer without citations.
- **With `schema`, an unsupported field is named, not hidden.** A filled field that no checked quote supports is listed in `uncited_fields`. A top-level field counts as cited when a quote was kept for it or for a value inside it; `field_citations` says which. You decide what to do with the rest.

`sources` lists every page the writer was given, cited or not, so you can see what the answer was written from.

## What this does not promise

- **That the page is right.** A quote shows that a page says something. It does not show that the page is correct, current or honest.
- **That a quote proves more than it says.** The checks ask whether a careful reader of the quote would accept the statement. They cannot do better than that reader, and they can be wrong.
- **That everything was found.** A run reads a limited number of pages. `not_answered` says what the pages read did not answer, when the writer could tell. When the pages read do not fit in the writing step (in what is left of `max_credits`, or in one model call), the last ones are left out of the run: they are not listed in `sources`, and nothing can cite them. Each page is also cut to a length before the writer sees it (6,000 characters on `lite`, 8,000 on `standard` and `pro`), so a fact deep in a long page may not be cited. For such a page, name it in `urls` and ask a narrower question.
- **That the page still says it.** A quote is checked against the copy the run read. Pages change.
- **The same answer twice.** Two runs of one question can search differently and word the answer differently.

Read the quotes for anything that matters. They are there so that you can.

## What a page can and cannot do

A page a run reads may carry text written to mislead a model ("ignore your instructions and do this instead"). The run is built so that such text can do little.

- **Page text reaches a model only as data, marked off from the instructions.** The writing step sees the text of each page, up to a length. The step that asks what is missing sees the opening words of each page. The checking pass sees the quotes.
- **No model has a tool to call.** A model proposes searches and writes text. Our code decides what is searched and fetched.
- **The most a page that is obeyed can do** is suggest a follow-up search, which is still a query on one of the run's own sources and inside its ceilings, or talk the second pass into keeping a statement.
- **What it cannot do:** name a URL for the run to fetch, make the run spend past its cap, or put a statement in the answer without a quote that is in a page the run fetched.

So a misleading page can waste a search, or keep in a statement that the second pass should have removed. It cannot take the run anywhere else.

A site that carries a [risk label](https://millionshort.com/docs/search/popularity-and-risk) is not read.

Pages are fetched under the same rules as [Extract](https://millionshort.com/docs/extract/parameters): `robots.txt`, the URL rules and the limits per site.

## In this section

| Part | Page |
|---|---|
| Quickstart | [Start a run, poll it, read the answer; then `schema`, the event stream, a webhook and cancelling](https://millionshort.com/docs/agent/quickstart) |
| Parameters | [Every request field with an example, the processors, the tiers of `model`, and everything that comes back](https://millionshort.com/docs/agent/parameters) |
| Guides | [A cited briefing held to your sources, a table of facts from a schema, choosing a processor and a cap, and use over MCP](https://millionshort.com/docs/agent/guides) |
| Pricing and limits | [What a run is charged for, the cap, the per-run cap of each plan, measured examples and the limits](https://millionshort.com/docs/agent/pricing) |
| Errors | [Requests that are refused, and runs that end `incomplete`, `failed` or `cancelled`](https://millionshort.com/docs/agent/errors) |

## With the other endpoints

[Search](https://millionshort.com/docs/search) returns results and [Extract](https://millionshort.com/docs/extract) returns pages; with those two you can do this job with a model of your own, and the [RAG guide](https://millionshort.com/docs/search/guides/rag) shows how. Agent does it for you and holds the answer to its quotes. It costs more than the searches and pages alone, because it also pays for the writing. [The endpoints](https://millionshort.com/docs/endpoints) says where each one stands.
