Practice: Orchestration and shared state
For education only. This practice is about agent architecture; it is not investment, financial, or trading advice, and nothing here is a recommendation to buy or sell anything.
Self-check
Section titled “Self-check”Six short questions. Answer each in your head before opening the collapsible. Active retrieval is where the learning sticks.
1. The lesson splits coordination into two questions. What are they, and why keep them separate?
Show answer
Control flow (whose turn is it next?) and data flow (how does one agent’s work reach the next?). They are separate because they are solved by two different mechanisms: control flow by the graph’s arrows, data flow by the shared state. A step can be next in line and still be missing the information it needs, which is exactly the bug you miss if you treat the two as one.
2. What does it mean that the team has a single source of truth?
Show answer
There is one structured workspace that every agent reads from and writes to. Each piece of the work lives in its own labelled space (the analyst reports, the judge’s plan, the trader’s plan, the final decision). No agent passes a private summary to the next; everything goes on the one shared board, so the next agent always works from what was actually written.
3. How does the shared state explain the handoffs from earlier lessons?
Show answer
Each handoff is just a write followed by a read of a named space. The judge writes its plan into the plan space; the trader reads that same space. The trader writes its proposal; the risk seats read it. The gate writes the final decision. The handoffs were never private exchanges; they were always reads and writes of the one board.
4. What is the difference between a fixed arrow and a conditional arrow in the graph?
Show answer
A fixed arrow always leads to the same next agent (after the judge, always the trader; after the gate, the run ends). A conditional arrow runs a small function that reads the current state and chooses the next step from a set of options. Fixed is for handoffs that never change; conditional is for forks where the work has to adapt.
5. The lesson calls the earlier “should we continue” checks the conditional arrows of one graph. Name them.
Show answer
The check on whether an analyst needs another tool call (the data-fetching lesson), the check on whether the debate runs another round (the bull and the bear), and the check that rotates the three risk seats and then routes to the gate (the risk gate). Each is a function attached to a conditional arrow, deciding one fork.
6. A multi-agent system gives a poor result. Where does the lesson tell you to look first?
Show answer
At the wiring, not at a single agent. Usually the fault is a step that could not see what an earlier step produced (a data-flow gap) or a fork that routed the wrong way (a control-flow gap). Knowing to inspect control flow and data flow tells you where to look.
Try it yourself: wire your own workflow
Section titled “Try it yourself: wire your own workflow”No tooling, no cost; this is design judgment. Pick a multi-step task you might hand to AI (for example: turn a messy meeting transcript into a polished summary, a list of decisions, and a set of follow-up emails). Then design the wiring, not just the steps:
1. Define the SHARED STATE. What are the named spaces the work lives in? (e.g., transcript, draft summary, decisions, email drafts.) Each step reads and writes these, rather than passing private summaries.2. Mark the FIXED handoffs. Where does the order never change? (e.g., always summarize before extracting decisions.)3. Mark the CONDITIONAL handoffs. Where must the system adapt? (e.g., if the summary is too long, loop back and tighten it before moving on.)Show answer (worked example: meeting transcript to outputs)
- Shared state: one workspace with named spaces: the raw transcript, the draft summary, the list of decisions, and the email drafts. Every step reads and writes these spaces, so the email step can see the decisions the extraction step wrote.
- Fixed handoffs: transcript to summary to decisions is a fixed order; you cannot extract decisions before you have understood the meeting.
- Conditional handoff: after the summary, a check: if it is over a length limit, loop back to a tightening step; otherwise continue. After the emails are drafted, a check: if any decision has no owner, route to a step that flags it rather than sending.
Notice the shape matches the lesson: one source of truth that every step shares, fixed handoffs where the order is settled, and conditional handoffs where the work must adapt. The domain changed; the wiring pattern did not.
Flashcards
Section titled “Flashcards”Eight cards. Click any card to reveal the answer. Use the Print flashcards button to lay out the full set as one card per page for offline review.
Q. What two things turn a team of agents into one system?
Orchestration (control flow: who runs next) and shared state (data flow: what they pass along). Different problems, different mechanisms, both required.
Q. What is a single source of truth in a multi-agent system?
One structured workspace that every agent reads from and writes to. Each piece of the work lives in its own labelled space, so no agent relies on a private summary from the one before it.
Q. How do the earlier lessons' handoffs work, mechanically?
As reads and writes of named spaces on the shared state. The judge writes the plan space, the trader reads it; the trader writes its proposal, the risk seats read it; the gate writes the final decision.
Q. Fixed arrow versus conditional arrow?
A fixed arrow always leads to the same next agent. A conditional arrow runs a small function that reads the current state and chooses the next step from a set of options.
Q. When do you use a fixed handoff? A conditional one?
Fixed when the order genuinely never changes. Conditional when the work must adapt: loop again, escalate, or finish, decided by reading the current state.
Q. What is the lesson's reveal about the 'should we continue' checks?
They are the conditional arrows of one graph: the tool-call check (data fetching), the debate-continuation check (bull and bear), and the risk-rotation check (risk gate) each decide one fork on the same map.
Q. Control flow and data flow: how are they different?
Control flow is whose turn it is next. Data flow is how one agent’s output reaches the next. A step can be next in line and still lack the information it needs.
Q. A multi-agent workflow misbehaves. Where do you look first?
At the wiring, not a single agent: a step that could not see an earlier step’s output (data-flow gap), or a fork that routed the wrong way (control-flow gap).