Dayward AIWeChat Mini Program
From Frontend Engineer to Agent Engineer in 30 Days
Week 3 ยท D15๐Ÿ”’ LockedAbout 6 hours

A Tour of Multi-Agent Patterns (Router/Supervisor, Planner-Executor, Critic, Swarm, Blackboard) and When Not to Use Them; Getting Started With LangGraph

Get acquainted with the common patterns for multi-agent systems, get clear on when a single agent is enough and when you actually need multiple agents, and build your first three-node graph with LangGraph.

Today's goals 0/3

Sign in to tick these off and save your progress.

Today's Goals

  1. Describe what kind of collaboration structure each of Router/Supervisor, Planner-Executor, Critic, Swarm, and Blackboard is
  2. Judge whether a business scenario should use a single agent or multiple agents, and explain why
  3. Build a three-node graph with LangGraph.js and run it successfully once

Yesterday closed on a note: one agent's production form is complete, and support has to triage, check stock, draft a refund proposal, and have the proposal reviewed โ€” one agent cannot do it all. Week three begins by learning every shape of that division of labor, and then learning to refuse most of them.

Plain-Language Walkthrough

A one-person workshop, and an org chart

A company at the very start is one person: pitching clients, writing proposals, delivering, invoicing. That state is extremely efficient because there is no communication cost at all โ€” every piece of information is in one head. Only when the business outgrows one person does hiring start, and with it roles, processes, and an org chart.

But you have surely seen the other kind of company: eight roles created for work three people could finish, three sign-offs for every decision, and nobody accountable for the outcome in the end. Hiring sometimes solves a problem and sometimes only converts one person's confusion into three people's communication cost. That sentence is the ground color of everything today.

First, what "one person cannot keep up" looks like in practice. Up to W2 our e-commerce support agent looks like this: one system prompt demanding both that it "check refund rules strictly and not promise lightly" and that it "sound warm and try to retain the customer"; twelve tools attached, of which query_order and query_refund are easy to confuse from the names alone; and a user asking "can I return this order" requires the model to recognize intent, pick the right tool, obey the refund rules, and still sound human.

The result is predictable: the prompt grows longer and every rule added dilutes another's weight; the tool-misselection rate rises with tool count; and worst, you cannot localize a problem โ€” the answer is wrong and you do not know whether intent was misread, the wrong tool was chosen, or the rules were overridden by the "retain the customer" line. The whole prompt is a black box you can only rewrite and retest wholesale.

Multi-agent, at bottom, cuts that black box into pieces so each piece has its own responsibility, its own prompt, and its own failure mode. There are five classic shapes:

  • Router / Supervisor: one node decides who should take this case and hands it to the matching subagent, one at a time. Suits tasks that need one expert at a time and whose difficulty is deciding whom to ask. This is the most used one, and tomorrow (D16) is entirely about it.
  • Planner-Executor: one node splits a large task into several mutually independent smaller ones, several executors finish them in parallel, and somebody assembles the results into one deliverable. Suits tasks that must be split into several pieces with no ordering between them.
  • Critic: the executor's output goes to a reviewer, is bounced back if it fails and released if it passes. Suits tasks where the output's correctness has a definite criterion and redoing it is cheaper than shipping it wrong. Planner-Executor and Critic usually come together, and D17 assembles them into one chain.
  • Swarm: no central node, and whoever holds the baton decides who gets it next. Suits exploratory tasks where the global order cannot be stated in advance. The cost is that you do not know in advance how many steps it will take, so neither cost nor latency has a ceiling.
  • Blackboard: participants do not know each other exists and only see one shared state: whoever spots something on the board they can handle carries on writing. Suits situations where participants come and go often and you do not want to edit orchestration logic for each one.

Memorizing those five names is pointless. What transfers is this: the difference between patterns is not the name, it is the shape of the graph. Watch four things and the five separate themselves โ€” is there a branch (one of three at runtime), a fan-out (handed to several at once), a join (several outputs merged), and a back edge (can be bounced for a redo).

patterns.js
// Edges come in two kinds: always is unconditional (all taken), choice is conditional
// (only one taken at runtime). Counting them separately is what reveals the fundamental
// difference between "hand it to three people at once" and "pick one of three".
const critic = {
  name: 'Critic',
  edges: [
    { from: 'START', to: 'executor', kind: 'always' },
    { from: 'executor', to: 'critic', kind: 'always' },
    { from: 'critic', to: 'executor', kind: 'choice' }, // back edge: bounce for a redo
    { from: 'critic', to: 'END', kind: 'choice' },
  ],
}
 
function analyzeShape(pattern) {
  // START naturally has one outgoing edge and END naturally takes many incoming ones;
  // without excluding them all five patterns look identical
  const tally = (pick, kind, skip) => {
    const acc = new Map()
    for (const e of pattern.edges) {
      if (e.kind !== kind || pick(e) === skip) continue
      acc.set(pick(e), (acc.get(pick(e)) ?? 0) + 1)
    }
    return [...acc.values()].some((n) => n > 1)
  }
  return {
    branch: tally((e) => e.from, 'choice', 'START'),
    fanOut: tally((e) => e.from, 'always', 'START'),
    join: tally((e) => e.to, 'always', 'END'),
  }
}

Run it and you see: Router has only a branch, Planner-Executor is a fan-out plus a join, Critic is a branch plus a back edge. Interestingly Critic and Swarm produce the same four booleans โ€” not a failure of the criteria, but their difference lying in who decides the back edge: Critic has a fixed reviewer node deciding whether to bounce, and Swarm has whoever holds the baton deciding who gets it next. Where shape cannot separate them, the criterion needs a sentence of plain language.

You can now translate any multi-agent paper's architecture diagram into those four booleans. But the genuinely hard question is unanswered: should the requirement in front of you be split at all?

Sign in and link WeChat to read

Sign in, then link your WeChat mini program account on the account page. Linked accounts share one free article per day. Unlock additional articles with rewarded videos in the mini program.

Mini program QR code

Scan in WeChat to open Dayward AI. Open the same course and chapter, choose the rewarded video, then refresh this page after completion.

Interview questions

  • What are the common multi-agent collaboration patterns, and what shape of task suits each?ๅธธ่ง็š„ๅคš Agent ๅไฝœๆจกๅผๆœ‰ๅ“ชไบ›๏ผŸๅˆ†ๅˆซ้€‚ๅˆไป€ไนˆๅฝข็Šถ็š„ไปปๅŠก๏ผŸ
    Common in ChinaCommon overseasBasic#multi-agent#orchestration#architecture

    ๐Ÿ”’ Unlock this chapter to see the answer keys.

  • In LangGraph, what roles do nodes, edges and state play? If you had no framework, how would you implement it yourself?LangGraph ้‡Œ่Š‚็‚นใ€่พนใ€็Šถๆ€ๅˆ†ๅˆซๆ‰ฎๆผ”ไป€ไนˆ่ง’่‰ฒ๏ผŸๅฆ‚ๆžœไธ็”จๆก†ๆžถ๏ผŒไฝ ่‡ชๅทฑไผšๆ€Žไนˆๅฎž็Žฐ๏ผŸ
    Common in ChinaCommon overseasIntermediate#langgraph#orchestration#state-management

    ๐Ÿ”’ Unlock this chapter to see the answer keys.

  • What signals typically trigger the move from a single agent to a multi-agent system, and what does the upgrade cost you?ไปŽๅ• Agent ๅ‡็บงๅˆฐๅคš Agent๏ผŒ้€šๅธธๆ˜ฏ่ขซไป€ไนˆไฟกๅท่งฆๅ‘็š„๏ผŸๅ‡็บงไน‹ๅŽ็ณป็ปŸไผšๅคšไป˜ๅ‡บไป€ไนˆ๏ผŸ
    Common in ChinaCommon overseasIntermediate#multi-agent#cost#architecture

    ๐Ÿ”’ Unlock this chapter to see the answer keys.

  • When should you not introduce a multi-agent system? Give operational criteria, not it depends.ไป€ไนˆๆƒ…ๅ†ตไธ‹ไธๅบ”่ฏฅๅผ•ๅ…ฅๅคš Agent ็ณป็ปŸ๏ผŸ่ฏท็ป™ๅ‡บๅฏๆ“ไฝœ็š„ๅˆคๆฎ๏ผŒ่€Œไธๆ˜ฏใ€Œ่ง†ๆƒ…ๅ†ต่€Œๅฎšใ€ใ€‚
    Common in ChinaCommon overseasDeep dive#multi-agent#architecture#trade-offs

    ๐Ÿ”’ Unlock this chapter to see the answer keys.

Comments