Build Research and Deep-Search Agents
An agent that investigates a question over many sources is useful only if you can check its work. Design for evidence first.
A research agent plans questions, searches, reads sources, records evidence, notices gaps and conflicts, searches again and writes a cited report. Quality depends on source selection, independent corroboration, honest statements of uncertainty, firm budgets and a verification pass that checks every claim against the page it cites. Treat everything read from the web as untrusted.
What you will learn: the research loop, search and browse tools, evidence records, source quality, verification and citation, deep research designs, a runnable example and evaluation.
Prerequisites: The Agent Loop: Observe, Reason, Plan, Act, Reflect, Query Rewriting, Multi-Hop, SQL and Multimodal RAG and RAG Evaluation, Grounding and Debugging.
Search, answer engine, research agent
| System | Behavior | Typical output |
|---|---|---|
| Search engine | Returns links for one query | A ranked list |
| Retrieval answer | Searches once or twice, writes an answer | A short cited reply |
| Research agent | Plans, searches repeatedly, reads, compares and revises | A report with evidence and open questions |
Research suits agents because the path is not known in advance: what you read changes what you ask next. It is also where plausible mistakes hide well, since a long, fluent report looks authoritative.
The research agent pattern
Frame the question
Settle scope, time period, audience, preferred sources and what counts as done. Ask the user when two readings would lead to different research.
Give it clear tools
| Tool | Returns | Guardrail |
|---|---|---|
| search | Titles, addresses, snippets, dates | Query and result limits |
| open page | Readable text in parts | Network rules, size limits, no sign-in |
| read file | Text and tables from documents | Sandboxed parsing |
| calculate | Computed results | Isolated code execution |
| record evidence | Claim, quotation, source, date | Required fields |
Start with short, broad queries and narrow from there. A snippet is a lead, not evidence: open the page before relying on it.
Keep an evidence record
For every finding store the claim, a short supporting excerpt, the address, publisher, publication date, access date and whether the source is primary. The report is written from this record, which also lets long work continue across context windows, as described in Long-Horizon, Multi-Agent and Enterprise Context.
Judging sources
| Question | Prefer |
|---|---|
| Who knows first hand? | Original documents, official data, authors of the work |
| Who benefits? | Independent testing for claims a seller makes |
| How current? | Dated material that covers the period asked |
| Is it independent? | Sources that did not copy one another |
| Can it be checked? | Methods and data over assertions |
Anthropic reported that early versions of its research system favored content written for search ranking over authoritative sources, which people caught in testing. Encode source preferences and test for them.
Search, browse, verify and cite
Verification asks, for each important claim: does the cited page really say this, is there independent support, and does anything credible contradict it? Count publishers, not pages. Ten sites repeating one press release are one source.
"""A research loop over a fake web: search, read, cross-check, cite."""
WEB = { # url: (publisher, kind, claims)
"https://maker.example/spec": ("maker", "primary", {"battery_hours": "12", "weight_kg": "1.3"}),
"https://lab.example/test": ("lab", "primary", {"battery_hours": "9"}),
"https://shop.example/page": ("maker", "copy", {"battery_hours": "12"}),
"https://blog.example/roundup": ("blog", "secondary", {"battery_hours": "12", "price": "900"}),
"https://maker.example/store": ("maker", "primary", {"price": "950"}),
"https://review.example/review": ("review", "secondary", {"weight_kg": "1.3"}),
}
SEARCH = { # query -> result urls, as a search tool would return them
"battery_hours": ["https://shop.example/page", "https://maker.example/spec",
"https://lab.example/test"],
"weight_kg": ["https://maker.example/spec", "https://review.example/review"],
"price": ["https://blog.example/roundup", "https://maker.example/store"],
"warranty": [],
}
RANK = {"primary": 0, "secondary": 1, "copy": 2}
def research(questions, max_reads=8):
read, report = set(), []
for q in questions:
evidence = {} # publisher -> (value, url)
for url in sorted(SEARCH.get(q, []), key=lambda u: RANK[WEB[u][1]]):
if url not in read and len(read) >= max_reads:
break
read.add(url)
publisher, _, claims = WEB[url]
if q in claims: # one vote per publisher
evidence.setdefault(publisher, (claims[q], url))
values = {v for v, _ in evidence.values()}
if not evidence:
status = "not found"
elif len(values) > 1:
status = "sources disagree"
elif len(evidence) < 2:
status = "single source"
else:
status = "corroborated"
report.append((q, status, list(evidence.values())))
return report, len(read)
report, reads = research(["battery_hours", "weight_kg", "price", "warranty"])
for question, status, evidence in report:
print(f"{question}: {status}")
for value, url in evidence:
print(f" {value:4} {url}")
print("pages read:", reads)
Output:
battery_hours: sources disagree
12 https://maker.example/spec
9 https://lab.example/test
weight_kg: corroborated
1.3 https://maker.example/spec
1.3 https://review.example/review
price: sources disagree
950 https://maker.example/store
900 https://blog.example/roundup
warranty: not found
pages read: 6
The example reads primary sources first, counts one vote per publisher and refuses to paper over differences. Battery life is reported as disputed: the maker says twelve hours and an independent lab measured nine. The shop page that copies the maker adds nothing. Warranty is reported as not found, which is a valid and useful result. A real agent would extract claims with a model, so claim extraction itself needs checking, and "disagreement" may only reflect different test conditions that the report should explain.
Writing the report
- Lead with the answer and how confident you are, then the evidence.
- Cite next to each claim and link to the page actually read.
- Separate what sources state from what the agent infers.
- Show conflicts and likely reasons.
- List what could not be established and when the research was done.
- Quote sparingly and respect site terms and copyright.
Run a final pass that checks every citation against the stored page. Deterministic checks of the kind shown in RAG Evaluation, Grounding and Debugging catch invented references and mismatched numbers.
Planning and following leads
A good plan lists sub-questions, the kind of source likely to answer each and the order in which to attack them. It is a working document: the agent revises it when reading shows that the original framing was wrong, and records why.
| Sub-question state | Meaning | Next move |
|---|---|---|
| Open | No evidence yet | Search with a different angle |
| Single source | One publisher supports it | Seek independent or primary support |
| Corroborated | Independent support agrees | Stop unless new conflict appears |
| Disputed | Credible sources differ | Compare methods and dates |
| Unanswerable | Searched reasonably, found nothing | Report the gap and where you looked |
Common search mistakes
- Queries so long and specific that nothing matches.
- Repeating one query with small word changes.
- Searching only for confirmation of the first answer found.
- Ignoring dates, so an old announcement outranks its correction.
- Missing sources in the language where the facts originate.
Counter the third mistake deliberately: for each important claim, run at least one search designed to find disagreement or a later change. For long documents, read in parts and record where in the document each excerpt came from, since a summary of the first page may miss the qualification on the tenth.
Agentic search and deep research systems
"Deep research" usually means long-running research with many searches and a structured report. A common design uses a lead agent that plans and delegates sub-questions to parallel workers, each with its own context, then a step that attaches and checks citations. Anthropic's description of its system follows this shape, with a lead researcher, subagents and a citation agent. It reports a large improvement over a single agent on an internal evaluation, token use of about fifteen times a chat, and early problems such as spawning far too many workers for simple questions.
Hosted research features and models change quickly. OpenAI, for example, shut down its dedicated o3-deep-research models in the API on July 23, 2026, according to its documentation. Keep your evidence format, tests and citation checks independent of any one provider so that you can switch.
Budgets and stopping
| Budget or rule | Purpose |
|---|---|
| Effort level by question type | A fact check should not launch a team |
| Maximum searches, pages, workers, tokens and time | Bound cost |
| Duplicate query and page detection | Avoid loops |
| Stop when sub-questions are supported | Avoid endless browsing |
| Stop on diminishing returns | New searches add no new evidence |
| Report partial results at the limit | Never hide a shortfall |
Delegating to workers
Each worker needs a precise brief: the sub-question, the period, preferred and excluded sources, what other workers are covering, a search budget and the format for returning evidence. Vague delegation produces duplicated searches and gaps between branches. Workers should return evidence records with links, not essays, and say plainly when they found nothing. The lead then merges records, removes sources that two workers found separately so they are not counted twice, and decides whether another round is justified.
Time and cost expectations
A thorough run can take minutes and many model calls. Show progress as sub-questions are resolved, let the user stop early with the evidence gathered so far and save the state so that an interrupted job can resume. Estimate cost per report type from real runs before offering the feature widely, and set the default effort to the lowest level that meets your quality bar.
Safety on the open web
Pages can contain instructions aimed at your agent. A research agent that also holds private data and can send requests to arbitrary addresses is a route for theft: a hostile page asks it to open a link that carries the data. Break that combination.
- Keep research agents read-only, with no consequential tools.
- Separate private-data research from open browsing, or strictly limit where requests may go.
- Block access to internal network addresses from the fetch tool.
- Do not let page text change the task, budget or source rules.
- Respect robots rules, terms of service, rate limits and paywalls.
- Avoid compiling profiles of private individuals.
Evaluating research agents
| Measure | How |
|---|---|
| Factual accuracy | Reviewers check sampled claims |
| Citation accuracy | Cited page supports the claim |
| Coverage | Expected points found |
| Source quality | Share of primary and independent sources |
| Calibration | Uncertainty stated where evidence is weak |
| Efficiency | Searches, tokens and time per acceptable report |
| Safety | Hostile pages cause no rule breaking |
Include questions with known answers, questions with a false premise, questions where sources disagree and questions with no available answer. Benchmarks such as BrowseComp test persistence in finding hard facts, but they do not judge report quality. Start with a small set, read the traces and grow it from failures.
Reading the traces
When a report is wrong, the trace shows which kind of fault occurred. The search never surfaced the right source, which points at queries and source preferences. The source was found but not opened, which points at selection. It was read but misquoted, which points at extraction. Or the evidence record was right and the report overstated it, which points at the writing step and the citation check. Fix the step that failed, and add the case to your test set.
Build one that searches and cites
- Run the example and add a question whose publishers agree only through copying. Confirm it is not marked corroborated.
- Replace the fake web with a search service you are permitted to use and a safe page reader.
- Add model steps for planning and claim extraction with a fixed output format.
- Store excerpts with each claim and verify that every excerpt occurs in the fetched page.
- Add budgets, duplicate detection and partial reporting.
- Write the report from the evidence record only, then check citations.
- Test with a hostile page and with an unanswerable question.
A buyer asks which of three suppliers meets a delivery standard. The agent reads each supplier's statement and looks for independent certification records. One claim appears only on the supplier's own site, so the report labels it unconfirmed and suggests requesting the certificate. The buyer decides; the agent's job was to show what is and is not supported.
Before sharing a report, read it as a skeptical colleague would. Pick the three claims that would change a decision, open their citations and check the dates. If any of the three fails, treat the whole run as unverified and find out why.
Common mistakes
- Citing search snippets or pages never opened.
- Counting copies as corroboration.
- No dates, so old facts look current.
- Unlimited searching.
- Browsing the web with private data and open network access.
- Grading reports on length and polish.
Finally, decide in advance which questions the agent should decline, for example requests to gather personal details about private people, and test that refusal along with everything else.
Keep the stored pages and evidence records for as long as you may need to defend a conclusion, within your retention rules, because web pages change or disappear and a link alone may no longer show what the agent read.
Checklist
- Scope and definition of done are agreed.
- Evidence records hold excerpt, source and dates.
- Important claims have independent support or a label saying otherwise.
- Citations are checked against stored pages.
- Gaps and conflicts are reported.
- Budgets and duplicate detection are enforced.
- The agent cannot act on instructions from pages or reach private networks.
Frequently asked questions
Can I trust a research agent's report?
Treat it as a well-organized lead. Check the claims that matter by opening the cited sources, especially before decisions with money, health or legal effects.
Do I need several agents?
Only if the question splits into independent branches and the speed or breadth justifies much higher token use.
How is this different from RAG?
RAG usually searches a collection you prepared. A research agent searches repeatedly across sources it discovers, so source judgment and safety matter much more.
What if sources disagree?
Report the disagreement, compare dates, methods and independence, and avoid choosing silently.
References and further reading
- Anthropic: How we built our multi-agent research system
- Yao et al.: ReAct
- Gao et al.: Generating text with citations (ALCE)
- Wei et al.: BrowseComp benchmark
- Greshake et al.: Indirect prompt injection
- OpenAI documentation: Deprecations
Next steps
Browser and Computer-Use Agents
When reading a page needs real interaction.
Supervisor and Orchestrator-Worker Patterns
Organize a lead agent and its workers.
Science, Math and Engineering Agents
Where research agents meet experiments.