Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →

Q38HardSystem design

Design a "deep research" agent that produces a cited report on any topic.

30-second answerSay your answer out loud first, then reveal.
Deep research flow: the user question is clarified, a lead agent writes a plan and spawns three search sub-agents that write to a findings store, the lead checks for gaps and starts a new round if needed, then a writer drafts the report and a citation checker verifies it before the final report.

Design details

  1. Planning: break the question into 3–8 sub-questions; scale effort to the query (a simple fact needs 1 agent, a market analysis needs 5+). Without explicit effort scaling, agents over-research simple queries.
  2. Sub-agent briefs: objective, scope boundaries, preferred source types, output format (claims + URLs + quotes), and a tool-call budget.
  3. Search strategy: start broad, then narrow; prefer primary sources; record dates for freshness.
  4. Findings store: keep findings outside the lead's context (files or a DB). The lead reads summaries, which keeps its context manageable over long runs.
  5. Synthesis: resolve conflicting sources explicitly ("Source A says X; B says Y; B is more recent").
  6. Citations: every claim links to a source. The verification pass checks that the source actually supports the claim, which catches hallucinated citations.
  7. Durability: runs take minutes, so use checkpoints and resume. Return asynchronously with progress updates.

Costs and trade-offs: multi-agent research uses many more tokens than chat. It's worth it for high-value queries, not for "what's the capital of France". Add a router.

Evaluation: rubric-based judging (accuracy, completeness, source quality, citation correctness), checks against a set of known-answer questions, and human expert review for a sample.

Slow is fine. Stopping is the only problem.