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.

BeginnerIntermediateExpert · 12 min read · Last updated:

In short

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.

Beginner What research agents do

Search, answer engine, research agent

SystemBehaviorTypical output
Search engineReturns links for one queryA ranked list
Retrieval answerSearches once or twice, writes an answerA short cited reply
Research agentPlans, searches repeatedly, reads, compares and revisesA 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.

Framequestion, scope, done
Plansub-questions
Searchshort queries
Readopen and extract
Assessgaps and conflicts
Reportclaims with citations
↺ Return to search while gaps matter and budget remains
The evidence record carries the work from one step to the next.
Intermediate Tools, evidence and verification

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

ToolReturnsGuardrail
searchTitles, addresses, snippets, datesQuery and result limits
open pageReadable text in partsNetwork rules, size limits, no sign-in
read fileText and tables from documentsSandboxed parsing
calculateComputed resultsIsolated code execution
record evidenceClaim, quotation, source, dateRequired 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

QuestionPrefer
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.

Expert Deep research, safety and evaluation

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 stateMeaningNext move
OpenNo evidence yetSearch with a different angle
Single sourceOne publisher supports itSeek independent or primary support
CorroboratedIndependent support agreesStop unless new conflict appears
DisputedCredible sources differCompare methods and dates
UnanswerableSearched reasonably, found nothingReport 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.

Single loopOne agent searches in sequence. Simple and cheaper. Good for focused questions.
Orchestrator and workersParallel branches. Faster breadth, much higher cost.
Staged workflowFixed plan, gather, verify, write. Predictable and auditable.

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 rulePurpose
Effort level by question typeA fact check should not launch a team
Maximum searches, pages, workers, tokens and timeBound cost
Duplicate query and page detectionAvoid loops
Stop when sub-questions are supportedAvoid endless browsing
Stop on diminishing returnsNew searches add no new evidence
Report partial results at the limitNever 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

MeasureHow
Factual accuracyReviewers check sampled claims
Citation accuracyCited page supports the claim
CoverageExpected points found
Source qualityShare of primary and independent sources
CalibrationUncertainty stated where evidence is weak
EfficiencySearches, tokens and time per acceptable report
SafetyHostile 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

  1. Run the example and add a question whose publishers agree only through copying. Confirm it is not marked corroborated.
  2. Replace the fake web with a search service you are permitted to use and a safe page reader.
  3. Add model steps for planning and claim extraction with a fixed output format.
  4. Store excerpts with each claim and verify that every excerpt occurs in the fetched page.
  5. Add budgets, duplicate detection and partial reporting.
  6. Write the report from the evidence record only, then check citations.
  7. Test with a hostile page and with an unanswerable question.
Illustrative example: supplier comparison

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

Next steps