Skip to main content

What You’ll Learn

  • Submitting a research request and polling for results
  • Streaming research progress in real time
  • Handling streaming events (progress updates, source discoveries, content generation)
  • Getting structured output with custom schemas

How Does It Work?

Tavily Research is a multi-agent deep research endpoint. You submit a query, and Tavily’s research agents autonomously search, extract, and synthesize information from multiple sources into a comprehensive report. Two consumption patterns are available:

Getting Started

Get your Tavily API key

Polling

client.research() returns immediately with a pending task. Use client.get_research() to poll until the status is "completed".

Streaming

Stream research progress in real time. The API sends Server-Sent Events (SSE) in an OpenAI-compatible chat.completion.chunk format as the research agents work. You can display tool activity, show discovered sources, and stream the final report as it generates.

Streaming Event Flow

A typical session progresses through these stages: For full event structure and field-level details, see the Streaming API reference.

Structured Output

Use output_schema to get research results in a custom JSON format. Define your schema as a dictionary of field names to descriptions.

Handling Research Streams in Production

For production applications, use the handle_research_stream utility from the Agent Toolkit to process streaming events cleanly:

Critical Knobs

  • "auto" (default) — Tavily picks based on query complexity
  • "pro" — comprehensive, multi-agent research for complex topics
  • "mini" — faster, targeted research for narrow questions
  • true — real-time SSE progress events
  • false (default) — single response, poll for completion
  • Pass a JSON Schema object to get structured data instead of a markdown report
  • Write clear field descriptions for best results
  • "numbered" (default), "mla", "apa", "chicago"
  • Controls how sources are cited in the report
For the complete parameter list, see the Research API reference.

Next Steps

Research API Reference

Full parameter list, response schema, and interactive playground.

Streaming API Reference

Complete SSE event structure, field details, and tool types.

Research Best Practices

Prompting tips, model selection, and structured output guidance.

Python SDK Reference

Python client methods, async support, and type details.