Ask (streaming)
Streaming variant of Ask: the same request and behavior, delivered as Server-Sent Events while the research runs.
Each SSE data: line is one JSON object with a type field. There
are no named SSE event: frames — parse the JSON rather than using
addEventListener.
Events arrive in order:
stage— a phase begins:retrieval, thensynthesis(whenansweris true).sub_query— the agent issued one search against the corpus;sub_query_resultfollows with its hit count, matched byseq.retrieval_done— evidence gathering finished.sources— the full ranked evidence set, the same objects the blocking endpoint returns. Sent before synthesis, so you can render evidence immediately.answer_delta— incremental answer text; only whenansweris true.done— terminal: the finalanswer(treat it as the canonical text;answer_deltaevents are for display), plusnote_type,note, andtook_ms. Sources are NOT repeated here — keep the earliersourcesevent.ping— keep-alive during quiet stretches; ignore.error— terminal; replacesdoneon failure.
Consuming the stream (Python):
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Request
The research question, in natural language (8–1000 characters) — phrase it as a question or claim, not keywords. Scope by naming shows, audiences, or time windows directly in the wording.
Default (false) returns the agent-curated evidence (sources) with answer: null in ~10-30s. Set true for a written, cited answer — every [n] maps to a source object; adds ~15-25s.
Attach the verbatim transcript passage to each source as quote.
Response headers
Response
Server-Sent Events: stage, sub_query, sub_query_result, retrieval_done, sources, answer_delta, done, ping, error.