WHAT IS DEEP RESEARCH AND WHY REGULAR CHAT CAN'T HANDLE IT
A regular LLM query is a single pass: the model answers from weights plus, if lucky, from one or two search results. The problem is obvious: hallucinations, stale data, no verification. Deep research flips the approach. Instead of "answer now" — "plan, gather, verify, synthesize". This is an agentic loop where the model itself decides what to search next until it has accumulated enough evidence.
The key difference between a research agent and simple RAG: the agent controls its own search in a loop. It doesn't receive ready-made context — it extracts it. By community observation, quality deep research makes 15 to 60 search queries per task and opens dozens of pages before writing the first sentence of the report.
ANATOMY OF A RESEARCH AGENT: FOUR STAGES
Any working deep research pipeline breaks down into four stages. Understanding this structure matters more than picking a specific library — frameworks change, architecture stays.
- Planning (decomposition). The model breaks the original question into 4-8 subqueries. "How did the vector DB market change in 2025?" → "top vector DBs by adoption", "pgvector vs Qdrant benchmarks", "vector startup funding rounds", etc.
- Fan-out search. Each subquery goes to a search API in parallel. Fan-out parallelization is the main speedup: 8 queries sequentially is 40 seconds, in parallel — 5.
- Verification. Extracted claims are checked against sources. This is where the fight against hallucinations lives: the agent in a separate pass asks "is this thesis confirmed by the source text?".
- Synthesis. The final model assembles the report with inline citations. Every fact is tied to a URL.
STACK COMPARISON FOR BUILDING IN 2026
Build from scratch or take a framework — depends on how much control you need. Here's an honest breakdown of current options. Fresh releases of agent libraries are tracked in the REDDYX catalog.
| Stack | Entry barrier | Control | When to choose |
|---|---|---|---|
| Raw API + custom loop | Medium | Full | Need custom verification logic |
| LangGraph | High | High | Complex graphs with branching and memory |
| LlamaIndex | Low | Medium | Research over own documents (RAG) |
| smolagents / code-agents | Low | Medium | Quick prototype, agent writes code |
| Ready-made (Perplexity API and analogues) | Minimal | Low | Don't want to maintain infra |
My practical advice: for learning and full control, start with your own loop on raw API. You'll understand where exactly quality is lost, and then any framework will come easily. A framework taken before understanding the mechanics turns into a black box that's impossible to debug.
CHOOSING THE SEARCH LAYER
Search is the fuel. A model without fresh sources hallucinates, no matter how smart the prompt. In 2026, agents use not "human" search engines, but APIs tuned for LLMs: they return clean text instead of HTML garbage.
- Tavily — a popular choice specifically for research agents, returns ready snippets and an optional "answer".
- Brave Search API — independent index, adequate limits, good for privacy.
- SearXNG — self-hosted metasearch engine, if you need full control and zero external costs.
- Exa — semantic search by meaning, not keywords, strong on niche content.
A separate layer is page content extraction. A search snippet isn't enough for serious verification, so the agent pulls the full text of found URLs (readability parsers like trafilatura clean articles well from navigation and ads).
WORKING EXAMPLE: MINI-AGENT IN PYTHON
Below is the skeleton of a research agent without frameworks. It shows all four stages explicitly. Replace the calls with your LLM provider and search API — the logic remains the same.
import asyncio, os, json
from anthropic import Anthropic
import httpx
client = Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
TAVILY = os.environ["TAVILY_API_KEY"]
async def web_search(query: str) -> list[dict]:
async with httpx.AsyncClient(timeout=30) as s:
r = await s.post("https://api.tavily.com/search", json={
"api_key": TAVILY, "query": query,
"max_results": 5, "search_depth": "advanced",
})
return r.json().get("results", [])
def plan(question: str) -> list[str]:
msg = client.messages.create(
model="claude-sonnet-4-6", max_tokens=512,
messages=[{"role": "user", "content":
f"Разбей исследовательский вопрос на 5 поисковых "
f"подзапросов. Верни JSON-массив строк.\n\n{question}"}],
)
return json.loads(msg.content[0].text)
def synthesize(question: str, evidence: str) -> str:
msg = client.messages.create(
model="claude-sonnet-4-6", max_tokens=4096,
messages=[{"role": "user", "content":
f"Вопрос: {question}\n\nИсточники:\n{evidence}\n\n"
f"Напиши отчёт. КАЖДЫЙ факт снабди инлайн-ссылкой [URL]. "
f"Если источники противоречат — укажи это явно."}],
)
return msg.content[0].text
async def deep_research(question: str) -> str:
subqueries = plan(question)
results = await asyncio.gather(*[web_search(q) for q in subqueries])
evidence = "\n".join(
f"[{r['url']}] {r['content'][:800]}"
for batch in results for r in batch
)
return synthesize(question, evidence)
print(asyncio.run(deep_research(
"Как менялся рынок векторных БД в 2025 году?")))
Это работающий каркас на ~50 строк. Он уже делает fan-out поиск и синтез с цитатами. Чего здесь не хватает для продакшена — верификации и рекурсии, о которых ниже.
ВЕРИФИКАЦИЯ: ГЛАВНЫЙ РАЗДЕЛИТЕЛЬ ИГРУШКИ И ИНСТРУМЕНТА
Синтез с цитатами не гарантирует правды: модель может процитировать URL и всё равно исказить его содержание. Поэтому серьёзный deep research добавляет адверсариальный проход — отдельный вызов, который проверяет каждое утверждение против текста источника.
Как это выглядит на практике
- Из черновика отчёта извлекаются атомарные утверждения (по одному факту на строку).
- Для каждого утверждения агент проверяет: подтверждается ли оно текстом процитированного источника — да / нет / частично.
- Неподтверждённые утверждения либо помечаются флагом, либо запускают новый поисковый цикл для добора доказательств.
Именно верификация даёт скачок доверия. Один проход синтеза даёт красивый текст; второй, адверсариальный, отсекает уверенно звучащую чушь. По опыту практиков, отдельный verify-проход снижает долю ошибочных утверждений в разы — это самая дешёвая инвестиция в качество из всех.
РЕКУРСИЯ И БЮДЖЕТ: КОГДА ОСТАНОВИТЬСЯ
Настоящий агент не делает фиксированное число шагов — он решает сам. После первого раунда он оценивает: «покрыт ли вопрос?». Если в подтеме дыра — генерирует новые подзапросы и уходит на второй круг. Здесь появляется главный риск автоматизации ресёрча: бесконтрольный расход токенов и времени.
Практические предохранители, без которых агент разорит вас на API:
- Лимит глубины. Максимум 2-3 рекурсивных раунда. Дальше отдача падает, а счёт растёт.
- Бюджет запросов. Жёсткий потолок на число поисков и вызовов LLM за сессию.
- Дедупликация URL. Агенты обожают ходить по одному и тем же страницам — кэшируйте.
- Таймаут. Общий дедлайн на всю задачу, иначе один зависший fetch тормозит весь пайплайн.
ГДЕ ЭТО ЛОМАЕТСЯ: ЧЕСТНЫЕ ОГРАНИЧЕНИЯ
Чтобы не продавать иллюзий — вот реальные грабли, на которые наступают все.
- Пейволлы и антибот. Половину качественных источников агент физически не откроет. Cloudflare-челленджи и платный контент — постоянная головная боль.
- SEO-помойка. Поисковая выдача в 2026 забита ИИ-генерённым контентом. Агент рискует «подтвердить» факт по трём статьям, которые сами написаны одной моделью.
- Дата отсечки против свежести. Модель может незаметно подмешивать знания из весов вместо источников. Явно инструктируйте опираться только на переданный контекст.
- Стоимость. Полноценный deep research по одной задаче — это десятки тысяч токенов. На потоке это ощутимые деньги, считайте юнит-экономику заранее.
Частые вопросы
How does deep research differ from regular RAG?
RAG extracts context once from a pre-prepared database and answers. Deep research is an agentic loop: the model itself plans the search, fetches sources from the open web, verifies claims, and if data is lacking, goes for another round. RAG answers, the agent researches.
How much does it cost to build an AI agent for research yourself?
Code — an evening's work and ~200 lines. The main operational cost: search API (most have a free tier to start) plus LLM tokens. One serious deep research task with verification is tens of thousands of tokens, so for a stream, budget in advance.
Which search API to choose for the agent?
For a quick start — Tavily, it's tuned specifically for LLM and returns clean snippets. Need independence and privacy — Brave Search API. Full control without external costs — self-hosted SearXNG. Semantic search by meaning — Exa.
Can you trust the report generated by the agent?
Only with verification. Without an adversarial pass, the agent outputs confident-sounding text that can distort even cited sources. Always add a separate step to check claims against the source text and keep links for manual control of key facts.
Build your research pipeline in an evening, and we will send you the tools to build it from. Telegram channel REDDYX AI — new repositories every 30-60 minutes.