Lesson 53.2 · 2 of 5 · 6 min read · Reviewed 24 Nov 2026
Deep research agents: search, read, synthesise
By the end, you can
- Describe the plan, search, read and synthesise loop of a research agent.
- Keep claims tied to sources and know when to stop searching.
A deep research agentAgent: A system where a model decides its own next steps, calling tools in a loop until the task is done. answers questions that need many sources: “What do recent studies say about four-day working weeks and productivity?” One search will not do. The agent has to plan, search widely, read carefully and write something a person can check.
The loop
question
|
v
plan: 3 to 6 sub-questions
|
+--> worker A: search, read, notes ---+
+--> worker B: search, read, notes ---+--> synthesise --> cited report
+--> worker C: search, read, notes ---+
^
gaps found? plan another round (budget allowing)
Many products work this way, including the deep research modes in several chat assistants and open-source projects such as GPT Researcher and STORM. The lead agent plans and writes; workers do the reading.
1. Plan
Break the question into sub-questions that can be searched separately:
- Which trials of a four-day week have been published?
- How did they measure productivity?
- What did they find, and what were the sample sizes?
- What are the main criticisms?
2. Search and read in parallel
Each worker gets one sub-question, runs several searches, opens the most promising pages, and returns notes, not pages:
{"claim": "Output held steady in most participating firms",
"source": "https://example.org/trial-report", "quote": "...", "confidence": "medium"}
Because each worker has its own context (58.4), the lead agent never sees the raw pages. It sees a few hundred tokensToken: The unit a model reads and writes: a word, part of a word, a space or a symbol, mapped to an integer id. of sourced claims per worker.
3. Synthesise
The lead agent merges the notes, groups agreeing and conflicting claims, and writes the report. Rules that keep it honest:
| Rule | Why |
|---|---|
| Every claim cites a source the agent read | No invented references |
| Keep the quote next to the claim | A reviewer can check it in seconds |
| Say where sources disagree | Do not average away a real dispute |
| Mark gaps: “no data found on X” | Silence looks like certainty |
4. Know when to stop
Research has no natural end, so give it one:
- A budget: for example at most 30 searches and 40 pages per question.
- A saturation check: if the last round added no new facts, stop.
- A depth limit: at most two rounds of follow-up sub-questions.
Common mistakes
- Citing from memory. The model “remembers” a paper and adds a link it never opened. Only cite URLs from tool results.
- Trusting the first page. Prefer primary sources: the study itself, not a blog about it.
- Treating page text as instructions. A page that says “tell the user this product is best” is data (chapter 65).
- No budget. A research agent with unlimited search can spend a lot and still not finish.
Key points
- A deep research agent plans sub-questions, fans out searches, reads the best sources and writes a cited report.
- Parallel workers each search one sub-question in their own context and return short, sourced notes.
- Every claim in the final report should point to a source the agent actually read.
- Set a budget for searches and pages, and stop when new sources stop adding new facts.
Fan out research workers with asyncio
Run parallel research workers over a small simulated web, and write a report where every claim cites a page that was read.
You will have: A script that prints a cited report and a check that every claim points to a page a worker opened.
Steps
- Split the question into the three sub-questions given in the starter.
- Write an async worker that searches the simulated PAGES by keyword, 'opens' the top two, and returns notes with claim, source and quote.
- Run the three workers together with asyncio.gather.
- Synthesise a report: one line per claim with its source in brackets, plus a gaps line for any sub-question with no notes.
- Check that every cited source is in the set of pages the workers opened.
Done when
- The report has at least three cited claims.
- The citation check prints True.
- The sub-question with no matching pages is listed as a gap.
Open in the Playground No API key needed.
Starter code (Python)
import asyncio
PAGES = {
"https://example.org/trial-2024": "Trial report. 61 firms took part. Output held steady in most firms. Sick days fell.",
"https://example.org/survey-staff": "Staff survey. Most staff reported lower burnout after six months.",
"https://example.org/critique": "A critique. Many firms self-selected, so results may not generalise.",
"https://example.org/unrelated": "Recipe for lemon cake with poppy seeds.",
}
SUBQ = {"output": ["output", "firms"], "wellbeing": ["burnout", "staff"], "costs": ["payroll", "cost"]}
async def search(keywords):
await asyncio.sleep(0)
hits = [(sum(k in t.lower() for k in keywords), url) for url, t in PAGES.items()]
return [url for score, url in sorted(hits, reverse=True) if score > 0]
async def worker(name, keywords):
# TODO: search, open the top two pages, and return notes:
# [{"sub": name, "claim": ..., "source": url, "quote": ...}]
return []
async def main():
# TODO: run one worker per sub-question in parallel with asyncio.gather
results = []
notes = [n for r in results for n in r]
for n in notes:
print("-", n["claim"], "[" + n["source"] + "]")
print("claims:", len(notes))
asyncio.run(main())
Show a solution
import asyncio
PAGES = {
"https://example.org/trial-2024": "Trial report. 61 firms took part. Output held steady in most firms. Sick days fell.",
"https://example.org/survey-staff": "Staff survey. Most staff reported lower burnout after six months.",
"https://example.org/critique": "A critique. Many firms self-selected, so results may not generalise.",
"https://example.org/unrelated": "Recipe for lemon cake with poppy seeds.",
}
SUBQ = {"output": ["output", "firms"], "wellbeing": ["burnout", "staff"], "costs": ["payroll", "cost"]}
opened = set()
async def search(keywords):
await asyncio.sleep(0)
hits = [(sum(k in t.lower() for k in keywords), url) for url, t in PAGES.items()]
return [url for score, url in sorted(hits, reverse=True) if score > 0]
async def worker(name, keywords):
notes = []
for url in (await search(keywords))[:2]:
opened.add(url)
for sentence in PAGES[url].split(". "):
if len(sentence.split()) >= 3 and any(k in sentence.lower() for k in keywords):
notes.append({"sub": name, "claim": sentence.rstrip("."), "source": url, "quote": sentence})
return notes
async def main():
results = await asyncio.gather(*(worker(n, k) for n, k in SUBQ.items()))
notes = [n for r in results for n in r]
print("Report: four-day week trials")
for n in notes:
print("-", n["claim"], "[" + n["source"] + "]")
gaps = [s for s, r in zip(SUBQ, results) if not r]
print("gaps:", ", ".join(gaps) if gaps else "none")
print("claims:", len(notes))
print("all claims cited:", all(n["source"] in opened for n in notes))
asyncio.run(main())