Deep Research
Deep Research provides AI-powered research workflows with both blocking and streaming APIs. It supports pro and pro_plus modes and can incorporate internal tools.
Non-Streaming Research
result = client.deep_research.research(
"Compare RAG architectures for enterprise knowledge bases",
mode="pro",
max_iterations=15,
)
print(result.content)
print(result.mode)
print(len(result.citations))
print(result.tool_calls_count)Streaming Research
for event in client.deep_research.research_stream(
"Latest developments in AI agents 2026",
mode="pro_plus",
max_iterations=20,
):
match event.type:
case "status":
print(event.data.get("message"))
case "planning":
print(event.data.get("plan"))
case "searching":
print(event.data.get("query"))
case "reading":
print(event.data.get("url"))
case "synthesizing":
print("Synthesizing...")
case "complete":
print(event.data.get("content", "")[:500])
case "error":
print(event.data)Research with Internal Tools
result = client.deep_research.research(
"Analyze our Q1 2026 sales trends and compare with industry benchmarks",
mode="pro",
available_tools=[
{
"tool_id": "conn_sales_db",
"name": "Sales Database",
"description": "Production sales database with order and revenue data",
}
],
)Models and Tools
models = client.deep_research.models()
all_tools = client.deep_research.tools()
pro_tools = client.deep_research.tools(mode="pro")| Method | Return Type | Description |
|---|---|---|
research(query, ...) | ResearchResult | Non-streaming research |
research_stream(query, ...) | Iterator[ResearchEvent] | Streaming SSE research |
tools(mode=...) | dict | Available tools |
models() | dict | Available models |
Use the non-streaming API when you need a single completed report. Use the streaming API when you want progress events for UI or agent orchestration.