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.Documentation Index
Fetch the complete documentation index at: https://docs.definable.ai/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start
deep_research=True, the agent automatically:
- Breaks the question into sub-questions
- Searches the web for each sub-question
- Reads and compresses relevant pages
- Accumulates facts and detects contradictions
- Injects the research context into the system prompt
- Generates a response grounded in the research
How It Works
Configuration
Simple Enable
Custom Configuration
Via DeepResearch Engine
You can also pass a pre-builtDeepResearch engine instance directly:
Depth Presets
| Preset | Waves | Max Sources | Parallel Searches | Best For |
|---|---|---|---|---|
"quick" | 1 | 8 | 3 | Fast lookups, simple questions |
"standard" | 3 | 15 | 5 | Balanced research (default) |
"deep" | 5 | 30 | 8 | Thorough investigation, complex topics |
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:| Mode | Description |
|---|---|
"always" | Run research on every arun() call (default) |
"auto" | Model decides whether the query needs research |
"tool" | Research only runs when explicitly invoked as a tool |
Standalone Usage
UseDeepResearch directly without an agent:
Events
When streaming, the research pipeline emits progress events:| Event | event.event value | Key Fields |
|---|---|---|
DeepResearchStartedEvent | "DeepResearchStarted" | query, depth |
DeepResearchProgressEvent | "DeepResearchProgress" | wave, sources_read, facts_extracted, gaps_remaining, message |
DeepResearchCompletedEvent | "DeepResearchCompleted" | sources_used, facts_extracted, waves_executed, duration_ms, contradictions_found |
Output Types
ResearchResult
| Field | Type | Description |
|---|---|---|
context | str | Formatted context for system prompt |
report | str | Standalone research report |
sources | List[SourceInfo] | Sources consulted |
facts | List[Fact] | Extracted facts |
gaps | List[TopicGap] | Remaining knowledge gaps |
contradictions | List[Contradiction] | Contradictions between sources |
sub_questions | List[str] | Decomposed sub-questions |
metrics | ResearchMetrics | Performance metrics |
Configuration Reference
Research depth preset:
"quick", "standard", or "deep".Search backend:
"duckduckgo", "google", or "serpapi".Backend-specific config (API keys, CSE ID, etc.).
Custom async search callable. Overrides
search_provider.Model for CKU extraction. Defaults to the agent’s model.
Maximum unique sources across all waves.
Maximum number of research waves.
Concurrent search queries per wave.
Concurrent page reads.
Minimum relevance score for CKU inclusion.
Include source citations in research context.
Surface contradictions between sources.
Format for injected context:
"xml" or "markdown".Approximate token budget for the context block.
Stop when novelty ratio drops below this between waves.
When to run:
"always", "auto", or "tool".Description shown in the layer guide injected into the system prompt. If
None, uses the default description.Installation
Deep research requires theresearch extra:
duckduckgo-search and curl-cffi for TLS-impersonated web reading.