Course contents 19 / 27

19 / 27 · Agents at Work

Research agents

How an agent answers questions that need many searches: the iterative search, read and synthesize loop of deep research, citations and how to check them, agents that analyse data by running code, automated science and its critiques, and the GAIA and BrowseComp evaluations.

On this page 8

The agents of the two previous notes change something: a repository or a page on a screen. A research agent produces an answer instead, and its work is to find what the answer rests on. Some questions cannot be answered from one document: the fact needed is two or three links away from the question, the sources disagree, or the answer is a number that has to be computed from data. A research agent searches, reads, keeps what it learns with the place it learned it, searches again with what it now knows, and finally writes an answer in which every claim points to a source. This note describes that loop, the citations that make its answer checkable, how citations go wrong and how to check them, agents that analyse data, the attempts to automate science itself, and how such agents are evaluated.

Notation. A question qq is asked of a collection of documents D\mathcal D: the web, or a corpus. A search tool takes a query and returns a ranked list of document ids. The agent’s notes are pairs (fact, source). The answer is a list of claims c1,…,cmc_1, \dots, c_m, each with a set of cited sources Si⊆DS_i \subseteq \mathcal D. supp⁡(S,c)∈{0,1}\operatorname{supp}(S, c) \in \{0, 1\} says whether the documents in SS together support the claim cc. In the analysis of citations, ff is the probability that one citation is bad and kk the number of citations in an answer.

Baseline: one retrieval, one answer#

Retrieval-augmented generation retrieves the documents most similar to the question and answers from them. It works when one passage contains the answer. It fails when the answer is several hops away, because the query that would find the last document contains a name that only the first document reveals.

Worked example. The toy corpus of the Code section contains eight short documents about fictional comets, astronomers and observatories. The question is When was the observatory founded where the discoverer of comet Veyra-7 trained? The answer takes three hops: the comet was discovered by Ilse Marten (document d1), Marten trained at the Korvik Observatory (d3), and the Korvik Observatory was founded in 1894 (d5). One retrieval with the whole question returns d1, d6 and d4. Document d6 is about a different observatory, the Selm Observatory, founded in 1861; it ranks high because it shares the words observatory and founded with the question. A reader that takes the first founding year it sees answers 1861, confidently and wrongly, with a citation that looks fine. The word that would find d5, Korvik, appears only after d3 has been read.

The deep-research loop#

A research agent replaces the single retrieval by a loop in which every query depends on what the agent has read so far. Products built this way appeared from late 2024 under the name deep research: Google’s in December 2024, OpenAI’s in February 2025, and others since. Their internals are not public, but they share the shape below, which is also the shape of the open implementations and of the ReAct loop with a search tool, extended over many more steps.

Figure

The loop of a research agent

The loop of a research agentAt the top left, the question. In a row, five steps: plan, search, read, notes, and a draft with citations. Search and read reach the web or a corpus below them. A loop above the row goes from the notes back to the plan while a link is missing. Below the draft, the citation check: if the claims are supported, the answer with citations goes out; if not, a loop along the bottom goes back to the plan.questionseveral hops awaythe web or a corpuspages, papers, dataplanwhat is missing?1searchquery → hits2readopen, extract3notesfact + sourcea link is missing: plan again4writeclaims + citations5checkexists? supports?answerwith citationsunsupported claim: research it again, or drop it6The loop of a research agentAt the top left, the question. In a row, five steps: plan, search, read, notes, and a draft with citations. Search and read reach the web or a corpus below them. A loop above the row goes from the notes back to the plan while a link is missing. Below the draft, the citation check: if the claims are supported, the answer with citations goes out; if not, a loop along the bottom goes back to the plan.questionseveral hops awaywebor corpusplanwhat is missing?1searchquery → hits2readopen, extract3notesfact + sourcemissing:plan again4writeclaims + citations5checkexists? supports?answerwith citationsunsupported:search again6
A question that takes several hops cannot be closed with one search: each query depends on what the previous reading found. The agent keeps notes in which every fact is tied to its source, and writes the answer from them only. Before the answer goes out, every citation is checked: does the source exist, and does it support the claim? An unsupported claim sends the agent back to research, or is struck out.
  1. Plan. Decide what is missing: which link of the chain of facts is unknown, or which part of a broad question has not been covered.
  2. Search. Write a query for the missing piece and run it. Good queries use what the notes already contain: the name found in the last document, not the words of the original question.
  3. Read. Open the most promising results, which may mean fetching whole pages or PDFs, and extract what bears on the question.
  4. Note. Keep each fact together with its source. If a link is still missing, go back to step 1. The notes, not the raw pages, are what the agent carries forward: a research task reads far more text than fits in a context window, and compacting the reading into sourced notes is what keeps the loop going.
  5. Write. Compose the answer from the notes only, as claims that each cite the sources they rest on.
  6. Check. Verify every citation before the answer goes out: the source exists and supports the claim. An unsupported claim either sends the agent back to research or is removed.

In the worked example, the loop searches for comet Veyra-7 discovered and notes Ilse Marten from d1; then Ilse Marten trained, noting Korvik Observatory from d3; then Korvik Observatory founded, noting 1894 from d5. Three short queries, each built from the previous note, reach the document that the question alone could not.

Two decisions shape the loop. When to stop: a chain of facts stops when it is complete; a broad question (“what is known about X”) has no natural end, and agents stop on a budget of searches or tokens, or when new searches stop adding notes. What to trust: sources disagree, as d5 and d7 do in the corpus, where a travel blog dates the observatory’s opening to 1902. A careful agent records the disagreement and prefers the primary source (the observatory’s own history over a blog), rather than picking whichever it read last.

Citations, and how to measure them#

A citation is a promise: this source supports this claim. Two measures, introduced with the ALCE benchmark (Gao et al., 2023), check the promise from both sides. A claim is supported if its cited sources together entail it. A citation is relevant if it supports the claim on its own, or if the claim is supported with it and not without it. Then

citation recall=1m∑i=1msupp⁡(Si,ci),citation precision=1∑i∣Si∣∑i=1m∑s∈Si1[supp⁡({s},ci)  or  (supp⁡(Si,ci) and not supp⁡(Si∖{s},ci))].\begin{aligned} \text{citation recall} &= \frac{1}{m} \sum_{i=1}^{m} \operatorname{supp}(S_i, c_i), \\ \text{citation precision} &= \frac{1}{\sum_i |S_i|} \sum_{i=1}^{m} \sum_{s \in S_i} \mathbb 1\Big[\operatorname{supp}(\{s\}, c_i) \;\text{or}\; \big(\operatorname{supp}(S_i, c_i) \text{ and not } \operatorname{supp}(S_i \setminus \{s\}, c_i)\big)\Big]. \end{aligned}

Recall asks whether every claim is backed; precision asks whether every citation does work. ALCE judged support with a natural-language-inference model, which decides whether one text entails another; today a language model is often the judge. In 2023, on the long-form questions of ELI5, even the best systems lacked complete citation support for about half of their statements.

Worked example. Suppose the agent writes five claims:

claimcitedsupported?bad citations
Comet Veyra-7 was discovered in 1931 by Ilse Martend1yes
Marten trained at the Korvik Observatoryd3yes
The Korvik Observatory was founded in 1894d5, d7yes, by d5d7 says 1902 and “opened”, not “founded”
It is the oldest observatory in the countryd9nod9 does not exist
Marten later directed the observatoryd3nod3 does not say so

Three of five claims are supported, so citation recall is 3/5=0.603/5 = 0.60. Of the six citations, d1, d3 (for the second claim) and d5 are relevant, so precision is 3/6=0.503/6 = 0.50. The checker in the Code section computes these numbers; removing the unsupported claims and the irrelevant citation leaves an answer with recall and precision 1, and nothing of what the agent added on its own.

Hallucinated citations and how to check them#

Language models produce text that looks like citations because they have read millions of them: an author list, a plausible title, a year, a journal, a DOI or a URL with the right shape. Nothing in generation requires the source to exist. Measurements across three years show the problem shrinking and not disappearing:

  • In 2023, ChatGPT based on GPT-3.5 and GPT-4 wrote short literature reviews on 42 topics; of 636 references checked by hand, 55% of GPT-3.5’s and 18% of GPT-4’s were fabricated, and among the real ones, 43% and 24% had substantive errors such as a wrong year, journal or author (Walters and Wilder, 2023).
  • In 2026, a study of ten models and deep-research agents on 53,090 citation URLs, plus three models on 168,021 URLs across 32 academic fields, found that 3–13% of URLs had never existed (no record in a web archive), and 5–18% did not resolve at all. Deep-research agents cited more sources per query than search-augmented chat models and hallucinated URLs at higher rates (Rao, Wong and Callison-Burch, 2026).

Per-citation rates of a few percent sound small. An answer has many citations, though, and one bad citation in a report undermines all the others, because the reader cannot tell which ones to trust:

Figure

Probability that an answer contains at least one bad citation

Probability that an answer contains at least one bad citationThree curves 1 − (1 − f)^k for k from 0 to 60 citations and per-citation rates f = 0.01, 0.03 and 0.13. With 20 citations the probability of at least one bad one is 0.182, 0.456 and 0.938.0.00.20.40.60.81.00102030405060number of citations in the answer kprobability0.1820.4560.938f = 0.01 per citationf = 0.03 per citationf = 0.13 per citationProbability that an answer contains at least one bad citationThree curves 1 − (1 − f)^k for k from 0 to 60 citations and per-citation rates f = 0.01, 0.03 and 0.13. With 20 citations the probability of at least one bad one is 0.182, 0.456 and 0.938.0.00.20.40.60.81.00102030405060number of citations in the answer kprobability0.1820.4560.938f = 0.01 per citationf = 0.03 per citationf = 0.13 per citation
If each of k citations is bad (fabricated, or not supporting its claim) independently with probability f, the answer contains at least one bad citation with probability 1 − (1 − f)^k. The rates 0.03 and 0.13 bound the range of hallucinated URLs across models and agents measured in 2026, and 0.01 is the level reached after automated checking in the same study. A report with 20 citations at f = 0.13 almost surely contains a bad one: 0.938. Independence is a simplification; the point is that long answers need every citation checked, not a sample.

With independent errors, an answer with kk citations contains at least one bad citation with probability 1−(1−f)k1 - (1 - f)^k. At f=0.13f = 0.13, a report with 20 citations almost surely does (0.9380.938); even at f=0.03f = 0.03 it is close to a coin flip (0.4560.456). Long, heavily cited answers are exactly what deep research produces, so spot checks are not enough: every citation needs an automated check. The checks form a ladder, from cheap to expensive:

  1. Existence. Resolve the identifier: does the URL load, does the DOI or arXiv number resolve, does the paper with this title and these authors exist in a bibliographic database? This catches fabrication. In the 2026 study, giving models a tool that checks URLs and classifies failures as dead links or never-existing pages cut non-resolving citations by factors of 6 to 79, to under 1%.
  2. Metadata. Do the authors, year and venue in the citation match the record? This catches the corrupted real references.
  3. Support. Does the cited passage entail the claim? This needs the text of the source and an entailment judge, and catches the most insidious case: a real, correctly described source that does not say what it is cited for.
  4. Quotation. For a quoted sentence, does it appear verbatim in the source?

The cheapest defence is structural, the one the loop above already builds in: the agent writes only from notes that came from documents it actually retrieved, so every citation points to a document the system has a copy of, and existence is guaranteed by construction. Support still has to be checked.

Agents that analyse data#

Many research questions end in a number: a growth rate, an average effect, the best model on a dataset. An agent that estimates such a number in its head produces a plausible guess. A data-analysis agent writes code instead, runs it in a sandbox on the data, reads the output and continues: it loads a table, inspects its columns, cleans it, computes, plots, and reports. The loop is the coding agent’s, aimed at an answer rather than a patch.

The rule that makes such answers checkable is provenance: every number in the report comes from an executed cell whose code and output are kept, so that a reader can rerun it. The failure modes are those of analysts in a hurry, made faster: silently dropping rows that fail to parse, choosing the test that gives a significant result, reporting a number from an earlier version of the code. MLE-bench measures the engineering side on 75 Kaggle competitions: in October 2024, the best setup, OpenAI’s o1-preview with the AIDE scaffold, reached at least a bronze medal in 16.9% of them (Chan et al., 2024).

Scientific agents#

The most ambitious research agents try to do science end to end: generate an idea, implement it, run experiments, and write the paper. The record so far is mixed, and worth reading in detail because claims in this area run ahead of evidence.

  • The AI Scientist (Lu et al., 2024, August 2024) chained these stages for three areas of machine learning (diffusion models, transformer language models and learning dynamics), with an automated reviewer at the end, at under 15 US dollars per paper. An independent evaluation (Beel, Kan and Baumgart, 2025) found that 42% of its experiments failed because of coding errors, that its novelty checks labelled established ideas, such as micro-batching for stochastic gradient descent, as new, and that its papers had few and outdated citations.
  • The AI Scientist-v2 (Yamada et al., 2025, April 2025) replaced the fixed chain of experiments with an agentic tree search over experiments. With the organizers’ agreement, three of its fully generated papers were submitted to a workshop at ICLR 2025; one received reviewer scores of 6, 7 and 6, above the workshop’s average acceptance threshold, and was withdrawn as agreed before publication. The authors stated that none of the three met their own bar for the main conference.
  • Ideas against outcomes. In a blinded study with over 100 NLP researchers, ideas generated by a language model were judged more novel than ideas written by experts, and slightly less feasible (Si, Yang and Hashimoto, 2025). A follow-up had 43 experts spend over 100 hours each executing randomly assigned ideas of both kinds: after execution, the scores of the model’s ideas dropped significantly more, and the advantage at the idea stage disappeared (Si, Hashimoto and Yang, 2025).

The pattern is consistent: generating plausible research artifacts is easier than producing results that survive scrutiny, and automated reviewers share the blind spots of the systems they review. Scientific agents are useful today as tireless assistants for well-specified parts of research (searching literature, running sweeps, reproducing a result), with people judging what matters.

Evaluations: GAIA and BrowseComp#

Two benchmarks measure research agents on questions with short answers that can be checked exactly, which avoids having to grade long reports.

GAIA (Mialon et al., 2023) has 466 questions that are simple for people and need several tools: web search, reading files of various formats, sometimes code or multimodal input. They come in three levels by the number of steps and tools needed, and each has one short, unambiguous answer. In November 2023, human respondents answered 92% correctly; GPT-4 with plugins, 15%. The answers to 300 questions are kept private for a leaderboard.

BrowseComp (Wei et al., 2025) targets persistence in browsing. Its 1,266 questions were written backwards, from a fact to a question with several constraints that make the fact hard to find and easy to verify once found, and each was checked to resist the models of the day and a few simple web searches. People trained for the task, without AI help, solved 29.2% of the questions and gave up on the rest after about two hours each; 86.4% of their answers matched the reference. The model results of April 2025:

system (April 2025)BrowseComp accuracy
GPT-4o0.6%
GPT-4o with browsing1.9%
GPT-4.50.9%
OpenAI o19.9%
Deep Research51.5%

Browsing alone barely helped a model that did not know how to persist; a model trained to search, read and reformulate over many steps solved half. Accuracy grew smoothly with the browsing effort allowed, and sampling 64 attempts and choosing among them by voting, confidence or best-of-N improved accuracy by about 15–25% over a single attempt. Both benchmarks share a limit: a single short answer can be checked, but most research questions have long answers, and evaluating those still depends on judges, human or model, whose own reliability has to be measured, as Evaluating agents discusses.

What changed#

one-shot retrievalresearch agent
queriesone, from the questionmany, each built from what was read
reachfacts one hop from the questionchains of facts, and broad coverage
memorythe retrieved passagesnotes of facts with their sources
numbersquoted from textcomputed by code that can be rerun
trustwhatever was retrievedcitations checked for existence and support
costone searchtens to hundreds of searches and readings

Limitations#

  • Support is judged by a model. Entailment judges make mistakes, especially with numbers, negation and paraphrase; a checked citation is likely, not certain, to support its claim.
  • The web is an adversarial corpus. Pages are written to rank, not to be true; search results contain spam, copies and pages that address the agent (Agent security and prompt injection).
  • Long answers are hard to evaluate. Benchmarks with short answers measure finding, not synthesis; reports are judged by rubrics and judges with their own errors.
  • Cost and time. Deep research runs take minutes and many model calls; most of what is read is discarded.
  • Automated science overstates itself. Plausible papers and favourable automated reviews are not results; execution and independent review remain the test.

What you should remember#

  • Questions several hops away need a loop: plan what is missing, search with what is known, read, note facts with sources, repeat, then write.
  • Write the answer from sourced notes only, and check every citation: existence, metadata, support, quotations. Citation recall asks whether every claim is backed; citation precision asks whether every citation does work.
  • Models fabricate citations at rates that fell from 55% (GPT-3.5, 2023) to a few percent of URLs (2026), and with kk citations at rate ff the chance of at least one bad citation is 1−(1−f)k1 - (1 - f)^k.
  • Data-analysis agents compute numbers by running code in a sandbox; every reported number should come from an executed, rerunnable cell.
  • Fully automated science produces plausible papers and few robust results so far (AI Scientist critiques, the ideation–execution gap).
  • GAIA and BrowseComp measure research agents on short, checkable answers; BrowseComp went from 1.9% for a model with browsing to 51.5% for a trained research agent in April 2025.

Code#

A toy corpus with a TF-IDF search tool, the one-shot baseline that answers wrongly, a scripted researcher that follows the chain of facts with three queries, a careless answer with five cited claims, a citation checker that computes citation recall and precision in the sense of ALCE and flags missing and unsupported sources, and a repair step. NumPy and the standard library only; there is no randomness. The script runs in under a second.

The stand-in model extracts facts with regular expressions and judges support by checking that every content word of a claim appears in the cited text, a crude stand-in for an entailment model. A real research agent would plan its queries from its notes, read real pages, and use a language model or an inference model as the support judge; the loop, the notes with sources and the arithmetic of recall and precision stay the same.

import re
import numpy as np

# 1. a toy corpus (fictional facts) and a search tool: TF-IDF with cosine similarity
CORPUS = {
    'd1': 'Comet Veyra-7 was discovered in 1931 by Ilse Marten, who spotted it from a mountain station.',
    'd2': 'Comet Veyra-2 was discovered in 1928 by Otto Brann during a survey of faint comets.',
    'd3': 'Ilse Marten trained at the Korvik Observatory from 1925 to 1929 before moving abroad.',
    'd4': 'Otto Brann trained at the Selm Observatory and later taught navigation.',
    'd5': 'The Korvik Observatory was founded in 1894 on the hills above Tallholm.',
    'd6': 'The Selm Observatory was founded in 1861 and is the oldest observatory in the region.',
    'd7': 'A travel blog says the Korvik Observatory opened to visitors in 1902.',
    'd8': 'Tallholm is a port city known for its shipyards and its winter festival.',
}
STOP = set('a an the in of to and by at from was is it its for who on before during later what which when where were did'.split())
tok = lambda s: [w for w in re.findall(r"[a-z0-9-]+", s.lower()) if w not in STOP]
ids = list(CORPUS)
vocab = sorted({w for d in CORPUS.values() for w in tok(d)})
tf = np.array([[tok(CORPUS[i]).count(w) for w in vocab] for i in ids], float)
idf = np.log(len(ids) / (tf > 0).sum(0))
X = tf * idf
X /= np.linalg.norm(X, axis=1, keepdims=True)
def search(query, k=3):
    q = np.array([tok(query).count(w) for w in vocab], float) * idf
    s = X @ (q / (np.linalg.norm(q) or 1))
    return [ids[j] for j in np.argsort(-s)[:k] if s[j] > 0]

QUESTION = 'When was the observatory founded where the discoverer of comet Veyra-7 trained?'

# 2. the baseline: one retrieval with the whole question, then take the first founding year it sees
hits = search(QUESTION)
year = next(m.group(1) for i in hits if (m := re.search(r'founded in (\d{4})', CORPUS[i])))
print('one-shot:', hits, '->', year)
# one-shot: ['d1', 'd6', 'd4'] -> 1861

# 3. a scripted researcher: each round asks for the missing link, reads the hits, keeps facts with their source
PATTERNS = [                                       # (what is known) -> (query, pattern that extracts the next link)
    ('comet', lambda c: f'comet {c} discovered', lambda c: rf'Comet {c} was discovered in \d+ by ([A-Z]\w+ [A-Z]\w+)'),
    ('person', lambda p: f'{p} trained', lambda p: rf'{p} trained at the ([A-Z]\w+ Observatory)'),
    ('place', lambda o: f'{o} founded', lambda o: rf'The {o} was founded in (\d{{4}})'),
]
def research(question):
    known, notes = re.search(r'comet (\S+?)\s', question).group(1), []
    for slot, make_query, make_pattern in PATTERNS:
        query = make_query(known)
        hits = search(query)
        found = next(((m.group(1), i) for i in hits if (m := re.search(make_pattern(known), CORPUS[i]))), None)
        print(f'search({query!r}) -> {hits}; note:', found)
        if found is None: break                    # the chain is broken: report what is known, do not guess
        notes.append((slot, known, *found)); known = found[0]
    return notes
notes = research(QUESTION)
# search('comet Veyra-7 discovered') -> ['d1', 'd2']; note: ('Ilse Marten', 'd1')
# search('Ilse Marten trained') -> ['d3', 'd1', 'd4']; note: ('Korvik Observatory', 'd3')
# search('Korvik Observatory founded') -> ['d5', 'd6', 'd3']; note: ('1894', 'd5')

# 4. the answer, written as claims with citations; a careless writer adds two claims of its own
(_, comet, person, s1), (_, _, obs, s2), (_, _, year, s3) = notes
answer = [
    (f'Comet {comet} was discovered in 1931 by {person}', [s1]),
    (f'{person.split()[1]} trained at the {obs}', [s2]),
    (f'The {obs} was founded in {year}', [s3, 'd7']),
    (f'It is the oldest observatory in the country', ['d9']),    # a citation to a source that does not exist
    (f'{person.split()[1]} later directed the observatory', [s2]),  # a claim its source does not make
]

# 5. the citation checker: existence, support (a crude entailment stand-in), recall and precision as in ALCE
def supports(doc_ids, claim):                     # every content word of the claim appears in the cited text
    text = set(tok(' '.join(CORPUS[i] for i in doc_ids if i in CORPUS)))
    return bool(doc_ids) and set(tok(claim)) <= text
def check(answer):
    supported, relevant, total = 0, 0, 0
    for claim, cites in answer:
        ok = supports(cites, claim)
        supported += ok
        flags = []
        for c in cites:
            total += 1
            if c not in CORPUS: flags.append(f'{c}: no such source'); continue
            rest = [d for d in cites if d != c]
            alone, needed = supports([c], claim), ok and not supports(rest, claim)
            relevant += alone or needed
            if not (alone or needed): flags.append(f'{c}: does not support it')
        print(f"{'OK  ' if ok else 'FLAG'} {claim} {cites}" + (f"  <- {'; '.join(flags)}" if flags else ''))
    print(f'citation recall {supported}/{len(answer)} = {supported / len(answer):.2f}, '
          f'precision {relevant}/{total} = {relevant / total:.2f}')
check(answer)
# OK   Comet Veyra-7 was discovered in 1931 by Ilse Marten ['d1']
# OK   Marten trained at the Korvik Observatory ['d3']
# OK   The Korvik Observatory was founded in 1894 ['d5', 'd7']  <- d7: does not support it
# FLAG It is the oldest observatory in the country ['d9']  <- d9: no such source
# FLAG Marten later directed the observatory ['d3']  <- d3: does not support it
# citation recall 3/5 = 0.60, precision 3/6 = 0.50

# 6. repair: drop citations that do not support their claim and claims left without support
repaired = [(c, [d for d in cites if d in CORPUS and supports([d], c)]) for c, cites in answer]
repaired = [(c, cites) for c, cites in repaired if cites]
check(repaired)
print('Answer:', ' '.join(f'{c} [{", ".join(cites)}].' for c, cites in repaired))
# OK   Comet Veyra-7 was discovered in 1931 by Ilse Marten ['d1']
# OK   Marten trained at the Korvik Observatory ['d3']
# OK   The Korvik Observatory was founded in 1894 ['d5']
# citation recall 3/3 = 1.00, precision 3/3 = 1.00
# Answer: Comet Veyra-7 was discovered in 1931 by Ilse Marten [d1]. Marten trained at the Korvik Observatory [d3]. The Korvik Observatory was founded in 1894 [d5].

Next#

Each agent of this section so far has been one model in one loop. A research task that branches into ten sub-questions, or a software project with several parts, invites a different design: several agents, each with its own context, working in parallel and combining their results. The next note asks when several agents do better than one, from the game theory of interacting agents to orchestrators, debate and voting, and why errors that several agents share limit what they gain.

References#