AlgoMaster Logo

Exercise: Deep Research Agents

3 min readUpdated June 22, 2026
Listen to this chapter
Unlock Audio

Exercise 1: Fan Out and Synthesize

Build the core of a deep research agent: break a broad question into focused sub-questions, answer each one independently, then synthesize the answers into a single coherent response.

A deep research agent does not answer a big question in one shot. It decomposes the question into parts, gathers an answer for each part, and combines them. This fan-out-then-synthesize shape is what lets an agent cover more ground than a single prompt, because each sub-question gets the model's full attention before the results are merged.

Requirements

  • Ask the model to break a broad question into three focused sub-questions.
  • Answer each sub-question with its own model call.
  • Synthesize the sub-answers into one final response that addresses the original question.
  • Print the sub-questions, the sub-answers, and the final synthesis.
main.py
Loading...

Expected Output

The broad question becomes three focused parts, each answered, then combined.

Solution

main.py
Loading...

Decomposition is what makes the research deep: each sub-question is small enough for the model to answer well, and together they cover more of the question than a single prompt would. Answering them independently is also where real agents parallelize and attach retrieval. The synthesis step is not optional glue; it is where separate findings become one answer, and giving the synthesizer both the original question and all the findings is what keeps the result on target rather than a list of disconnected facts.

Exercise 2: Close the Gap with a Follow-up

Good research notices what it missed. After a first answer, have the model critique its own draft to find an important missing aspect, research that gap with a follow-up question, and fold the result into a stronger final answer. This self-critique loop is what makes iterative research deeper than a single pass.

Requirements

  • Produce an initial answer to the question.
  • Ask the model what important aspect the draft missed (one follow-up question).
  • Answer that follow-up, then synthesize the draft and the follow-up into a final answer.
main.py
Loading...

Expected Output

The critique surfaces a missing aspect (such as cost or operations), and the final answer incorporates it.

Solution

main.py
Loading...

Letting the model critique its own draft turns a one-shot answer into an iterative one: the gap question targets exactly what the first pass underweighted, and researching it adds genuine coverage rather than rephrasing. Synthesizing the draft with the follow-up keeps the final answer coherent instead of bolted-on. Repeating this critique-and-fill step is how deep-research agents converge on thorough answers; a budget or a round limit decides when to stop.