Yashotantra Academy logo
level 1
Curious · 0 XP
streak
0d
perfect
0
badges
0

100 XP to Apprentice

Orchestration · medium

8. Multi-agent orchestration: supervisor and handoffs

Split work across specialised agents only when a single agent measurably fails.

1 min read2 questionsup to 50 XPtopic 8/14

Read in another language

AI translates the explanation and quiz text while preserving code and answer scoring.

Two dominant topologies:

- Supervisor: a coordinator owns the goal and delegates to workers, each with a narrow tool set. Deterministic and easy to trace. - Handoff / swarm: agents transfer control to each other by calling a `transfer_to_x` tool. Flexible but harder to bound.

ts
const workers = {
  researcher: makeAgent({ tools: [search, fetchPage], system: "Gather sources. Cite URLs." }),
  analyst:    makeAgent({ tools: [runSql],            system: "Answer with numbers from SQL only." }),
  writer:     makeAgent({ tools: [],                  system: "Write the final brief." }),
};

async function supervisor(goal: string) {
  const notes: string[] = [];
  for (const name of await chooseRoute(goal)) {          // e.g. ["researcher","analyst","writer"]
    notes.push(await workers[name].run(goal, notes.join("\n---\n")));
  }
  return notes.at(-1)!;
}

Multi-agent systems fail mainly through context loss at the boundary. Pass a structured handoff object (goal, findings, open questions, constraints) rather than a free-text blob, and give the whole run a single trace id.

Exercise: run a research task as one agent with all tools, then as the supervisor above. Compare token cost, latency, and answer quality — single agent wins more often than teams expect.

How to study this topic

  1. 1. Read the explanation once end to end, skipping the code.
  2. 2. Re-read the code snippets and say out loud what each line does.
  3. 3. Answer the quiz without scrolling back — that is the real check.
  4. 4. Read every explanation, even for the answers you got right.

Scoring

  • · Up to 30 XP from quiz accuracy.
  • · +15 XP for a perfect first attempt.
  • · +5 XP while a 3-day streak is running.
  • · 75% or higher marks the topic complete.

Check your understanding

  1. 1. Most common failure mode of multi-agent systems?

  2. 2. Why prefer a supervisor over free-form handoffs initially?

Badges

First light
Pass your first topic
Sharp shooter
3 perfect first-try quizzes
On a roll
Study 3 days in a row
Week warrior
Study 7 days in a row
Grinder
Earn 500 XP
Deep diver
Earn 1500 XP