Design an orchestrator-worker research system

L3 · SeniorDesign~15 minPlanning & multi-agent

Design a system that answers research questions like "Compare the EU and US rules on AI in hiring, with sources", using an orchestrator that spawns worker agents. Cover task decomposition, what workers return, how results are combined, and how you'd control cost and quality.

Answer it out loud or on paper first. Then open the short answer.

Short answer

The orchestrator plans: it breaks the question into independent sub-questions with clear scope ("EU AI Act provisions on hiring", "US federal guidance", "notable state laws"), assigns each to a worker with a budget, and waits. Workers run their own search loops in isolated contexts and return structured findings: claims, each with a source URL and quote, plus confidence and gaps. The orchestrator merges, deduplicates, checks for conflicts and missing coverage, optionally sends follow-up tasks, and writes the final answer with citations. Control cost with per-worker budgets, a cap on workers and rounds, and cheaper models for workers.

Full answer

Components

ComponentResponsibility
OrchestratorDecompose, assign, track, merge, decide when done
WorkersSearch and read within one sub-question; return findings
Findings storeStructured results: claim, source, quote, date, confidence
SynthesiserFinal answer from findings only, with citations
CheckerEvery claim in the answer maps to a finding with a source

Task contract

Each worker gets: the sub-question, scope boundaries (what not to cover), output schema, a step and token budget, and a deadline. Vague tasks produce overlapping work.

Fan-out, fan-in

  • Run workers in parallel; collect with a timeout; proceed with partial results if one fails, and note the gap.
  • Merge by claim; resolve conflicts by source quality and date; flag unresolved conflicts in the answer.
  • One optional follow-up round for gaps, then stop.

Cost and quality controls

  • Caps: workers per question, rounds, tokens per worker, total budget.
  • Workers on a cheaper model; orchestrator and synthesiser on a stronger one.
  • Evaluate decomposition (coverage, overlap) and final answers (citation accuracy, completeness) separately.
  • Trace every worker with a parent span so you can see where time and money go.

Follow-ups

  1. L3. Workers return overlapping findings. Why, and how do you fix it?

    Expected answer

    Poorly scoped sub-tasks; tighten scope boundaries in the task contract and dedupe by claim and source in the merge.

  2. L3. A worker reads a page with a prompt injection. What limits the damage?

    Expected answer

    Workers have read-only tools and no egress; findings are data passed in a schema; the orchestrator doesn't follow instructions inside findings.

  3. L4. How do you decide the number of workers?

    Expected answer

    From the question's breadth and measured marginal value: track how often extra workers add unique cited findings versus cost.

Wrong answers interviewers hear
  • "Workers return their full transcripts to the orchestrator." That floods the orchestrator's context; return structured findings.
  • "Spawn as many workers as possible for coverage." Costs grow linearly while unique findings saturate.
  • "Let workers talk to each other freely." Unstructured chatter multiplies tokens and loops; coordinate through the orchestrator and shared findings.

Taught in

Improve this answer