Query Graph

Plan and run a query graph that returns cited, source-backed answers. Every claim carries the source ids it rests on.

POST /v1/graph/search

Runs a query graph and returns the run plus its evidence packet.

Most search APIs return a list of links and stop. A graph run plans the research shape, executes the nodes, and returns an evidence packet — packet.claims[], where each claim carries the source_ids it rests on, resolving against packet.sources[]. An answer can be checked back to the pages that produced it rather than taken on trust.

The response also carries gaps[]: a branch that timed out or ran dry records the node, the query and the reason, so a thin result is visible instead of silently thin.

The endpoint takes query, not q. Credits are refunded in full if the engine is unreachable or errors, so a failed run costs nothing.

Request Body

NameTypeDescription
queryrequired
stringResearch query. 1-500 characters.
engine
stringEngine id, or auto to let the planner choose. Defaults to auto.
num
integerResults per search node, 1-10. Defaults to 5.
max_tokens
integerToken ceiling for the evidence packet, 64-32000.
deadline_ms
integerWall-clock ceiling for the run, 100-60000.
max_nodes
integerMaximum nodes the graph may contain, 1-32. Defaults to 12.
fetch_top
integerHow many top results to fetch in full, 0-10.
intent
stringForce an intent instead of detecting it.
include_plan
booleanAlso return the graph that was executed.
curl
python
javascript

POST /v1/graph/plan

A dry run. Validates the graph and returns the graph, a cost estimate, the rationale for the shape chosen, and alternatives — without touching the network. Use it to size a run before paying for it.

Same request body as /v1/graph/search, minus include_plan. Costs 1 credit.

python

Reading the evidence packet

The packet is the point of a graph run. Its fields:

  • claims[] — each with id, text, and source_ids naming the sources it rests on.
  • sources[] — the id/url pairs those ids resolve against.
  • contradictions[] — sources that disagree.
  • gaps[] — branches that did not complete.
  • budget_tokens / used_tokens — what the packet was allowed and what it used.

A claim whose source_ids cannot be resolved is a claim you cannot check. The session_handoff MCP tool reports exactly those as unresolvable_claim_ids, so a receiving agent knows what to re-verify rather than assuming every claim is sourced.

Response

NameTypeDescription
graph_idrequired
stringIdentifier for this run.
statusrequired
stringok, partial, or error.
intentrequired
stringIntent the planner detected or was given.
duration_msrequired
numberWall-clock time for the run.
engine_attributionrequired
objectHow many search nodes each engine served.
budgetrequired
objectMeasured resource use: requests, bytes, nodes, tokens.
packetrequired
objectThe evidence packet: claims, sources, contradictions, gaps.
gapsrequired
arrayBranches that did not complete, with node, query and reason.

Need help?

Check our error codes or reach out to the team.