Deep Research
Context Builder
Builds a rich markdown context from a deep web search, using TavilyDeepResearch as the search engine.
On this page
#Context Builder - /deep-research/context-builder
POST/deep-research/context-builder
Builds a rich markdown context from a deep web search, using TavilyDeepResearch as the search engine. Ideal for feeding RAG pipelines, report generation or prompt enrichment.
#Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
query | string | Question or central topic of the search. Defines what will be searched. | "Principais tendências de IA em 2026?" |
search_depth | "basic" | "advanced" | Search depth. basic for a quick overview, advanced for a broader and more detailed search. | "advanced" |
max_results | integer (1–100) | Maximum number of results to retrieve and include in the context. | 35 |
topic | string | Category or domain of the search. Guides the type of source prioritized. Common values: general, news, finance. | "news" |
include_answer | boolean | If true, includes in the context an automatically generated answer based on the results found. | true |
min_score | float (0.0–1.0) | Minimum relevance score. Results below this threshold are discarded. Higher values = more precise but smaller context. | 0.5 |
#Request
curl --location 'http://localhost:8000/deep-research/context-builder' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: ******' \
--data '{
"query": "Principais tendências de IA em 2026?",
"search_depth": "advanced",
"max_results": 35,
"topic": "general",
"include_answer": true,
"min_score": 0.5
}'#Response
{
"job_id": "job_1779392104064657200TsJh",
"status": "success",
"status_code": 200,
"result": {
"markdown": "...",
"urls": [
"https://example.com"
]
},
"time": {
"start": "2026-05-21 16:35:04",
"end": "2026-05-21 16:35:11",
"duration_seconds": 7.0
}
}Source: src/web_services_network/routes/deep_research.py