session_id, and the agent
never asks a clarification question back. An agent answer still reports its own
run’s thread in output.answer.session_id; for follow-ups, use
QA. Before searching, the service selects fact search for
focused lookups, or an agent that opens on the pages and tables a navigator over the workspace located for the query (for a
workspace in a bring-your-own bucket or customer storage, on what a search of it
found), then reads documents, queries tables, and selects documents from the
metadata catalog.
mode picks the route. auto (the default) lets the service choose; fact or
agent runs that route with no router model and no routing charge. Then
routing.router.kind is requested, routing.router_model is none, and
routing.selected and routing.final name the requested route. top_k caps
output.evidences (the citation list) only when fact search answers; the agent
ignores it.
In auto mode, when the router chooses fact search and fact search cannot settle
the question (it finds no answer while a table it was given was not read whole,
such as a Parquet table or one too large to read, or it cites nothing, grades its
answer low or speculative, or fails), the agent answers instead.
routing.selected stays fact, routing.final reads agent, and output and
output_job_id are the agent’s. The fact attempt is billed with the agent’s run.
When fact search finds no answer in material it read whole, that is the answer,
with no hand-over. mode fact never hands over: it returns fact search’s own
answer.
A workspace with no ingested files is answered without a search in any mode,
including agent: output is a fact answer saying there is nothing to search,
and routing.selected and routing.final read fact.
A query that asks for nothing, such as a keyboard mash, is answered without a
search in any mode when no document contains any of its words: output is a
fact answer saying so, with no citations and no charge, and routing.selected
and routing.final read fact. A word the workspace holds, such as a code, is
always searched.
While the job runs, progress.routing shows the route from the moment it is
chosen, and final switches to agent when fact search hands over.
output_schema (a JSON Schema, object root) asks for the answer as JSON on
whichever route runs; it never changes the route chosen. The answering route’s
structured_answer holds the parsed value (output.structured_answer for a
fact answer, output.answer.structured_answer for the agent), or null if the
answer still missed the schema after its corrections. The job succeeds either
way. A field the source does not state comes back null, whatever type the schema gives it.
The result wraps the chosen route’s output, plus routing (how it was chosen)
and output_job_id — the job that owns the output’s receipts and cursors. An
agent output carries its answer and, when it answered from the catalog, a
catalog table whose next_cursor pages through POST .../filtered-search
without another routing decision.
A fact answer lists the Ground jobs planned for its evidences in
output.grounding_job_ids. An agent answer comes back without Ground jobs:
output.answer.grounding_job_ids is null. To locate its quotes,
POST /v1/ground once per cited file, with a workspace_file source
(source_file_id) and the evidences’ quotes as targets. See
Agent and QA answers.
Scope a run with path_prefix (a folder), paths (exact uploaded files, no
limit on how many), or both. The two add up: the run covers every file under the
folder plus every named file. The scope resolves to one set of files that fact
search and the agent, its catalog commands included, all filter by. Unknown or inaccessible paths are refused with 404 before a job
exists.
See Search.