Skip to main content
The deep research layer conducts automated multi-wave web research before the agent responds. It decomposes queries into sub-questions, searches the web, reads pages, compresses them into Compressed Knowledge Units (CKUs), accumulates knowledge with deduplication and contradiction detection, and synthesizes the results into context for the agent’s system prompt.

Quick Start

With deep_research=True, the agent automatically:
  1. Breaks the question into sub-questions
  2. Searches the web for each sub-question
  3. Reads and compresses relevant pages
  4. Accumulates facts and detects contradictions
  5. Injects the research context into the system prompt
  6. Generates a response grounded in the research

How It Works

Configuration

Simple Enable

Custom Configuration

Via DeepResearch Engine

You can also pass a pre-built DeepResearch engine instance directly:

Depth Presets

Search Providers

DuckDuckGo (Default)

Free, no API key required. Works out of the box.

Google Custom Search Engine

Requires a Google API key and Custom Search Engine ID.

SerpAPI

Requires a SerpAPI key.

Custom Search Function

Provide any async callable that returns search results:

Trigger Modes

Control when research runs:

Standalone Usage

Use DeepResearch directly without an agent:

Events

When streaming, the research pipeline emits progress events:

Output Types

ResearchResult

Configuration Reference

str
default:"standard"
Research depth preset: "quick", "standard", or "deep".
str
default:"duckduckgo"
Search backend: "duckduckgo", "google", or "serpapi".
Dict[str, Any]
Backend-specific config (API keys, CSE ID, etc.).
Callable
Custom async search callable. Overrides search_provider.
Model
Model for CKU extraction. Defaults to the agent’s model.
int
default:"15"
Maximum unique sources across all waves.
int
default:"3"
Maximum number of research waves.
int
default:"5"
Concurrent search queries per wave.
int
default:"10"
Concurrent page reads.
float
default:"0.3"
Minimum relevance score for CKU inclusion.
bool
default:"true"
Include source citations in research context.
bool
default:"true"
Surface contradictions between sources.
str
default:"xml"
Format for injected context: "xml" or "markdown".
int
default:"4000"
Approximate token budget for the context block.
float
default:"0.2"
Stop when novelty ratio drops below this between waves.
str
default:"always"
When to run: "always", "auto", or "tool".
str
Description shown in the layer guide injected into the system prompt. If None, uses the default description.

Installation

Deep research requires the research extra:
This installs duckduckgo-search and curl-cffi for TLS-impersonated web reading.