Multi-agent · Free preview

The Shared Blackboard

Coordinate via shared state

A blackboard is one shared state object every agent reads from and writes to, so each agent's work can build on the facts the previous agents left behind.

Coordinate via shared state

The orchestrator gathered independent results and the vote aggregated parallel opinions — but those workers never needed to see each other's output. Many real jobs aren't like that. A planner can't decide until the analyst has crunched the numbers; a reporter can't write the summary until the planner has decided. The work is a chain of dependencies. Wire that with direct calls — analyst calls planner calls reporter, each passing its piece as an argument — and the plumbing explodes: every new agent means new arguments threaded through every caller.

The cleaner pattern is a blackboard: one shared state object every agent reads from and writes to. Agent A posts a fact; agent B reads it and posts another derived from it; agent C reads both and writes the conclusion. No agent calls another directly — they leave notes on the same board, in order, and coordination emerges from the shared surface.

Trace the build. The board starts as { revenue: 1200, cost: 800 }. The analyst writes profit = 400. The planner reads board.profit, sees it's positive, and writes decision = "invest". The reporter reads both prior facts and writes summary = "invest because profit 400". Each agent stands on the work of the last — but only because they share the same object reference. The starter's bug is exactly this: it hands each agent its own {}, so the planner reads board.profit as undefined and the chain silently collapses.

Shared state is the wiring of any agent team, and where the subtle bugs live: copy the board instead of sharing the reference and writes vanish; let two agents write the same key and order decides the winner. Get the threading right and the system composes — add a fourth agent later and it just reads the board.

Below, an analyst computes profit, a planner reads that profit to make a decision, and a reporter reads both to write a summary. Thread the same board through all three. Done looks like each agent printing what it wrote and a final board carrying every fact: profit, decision, and summary.

Shared state is the wiring of a multi-agent system: the value of one agent's work is only realized when the next agent can read it.

In the full academy, you write and run this — live, graded:

// Three agents run in sequence. Each should READ the shared blackboard and
// WRITE a new fact derived from what earlier agents left there.
//
// 🐞 Right now every agent is handed its OWN private object, so the planner
//    can't see the analyst's profit, and the reporter sees nothing at all.
//    Thread ONE shared board through all three.

function analyst(board) {
  board.profit = board.revenue - board.cost; // 1200 - 800
  console.log("analyst wrote profit=" + board.profit);
}

function planner(board) {
  // reads the analyst's profit to decide
  board.decision = board.profit > 0 ? "invest" : "hold";
  console.log("planner wrote decision=" + board.decision);
}

function reporter(board) {
  // reads BOTH prior facts to write a summary
  board.summary = board.decision + " because profit " + board.profit;
  console.log("reporter wrote summary=" + board.summary);
}

const board = { re

🔒 Live code execution, real agent runs, mastery tracking and verifiable credentials unlock with the full academy.

This is 1 of 50 lessons.

The full academy: write real code, watch real agents run, and earn verifiable credentials — across 8 tracks, in a 3D campus.

Unlock the full academy — $100 →

14-day refund · 🔒 Stripe-secured checkout · lifetime access

More free lessons: An LLM Is a Function  ·  The Agent Loop  ·  Define a Tool  ·  Give an Agent a Tool  ·  Durable State

← The Agent Marketplace