THE BUILDING BLOCKS OF AGENT SYSTEMS
Graph Shapes for
Agent Workflows.
Ten graph patterns for thinking about how agents work together.
Follow the arrows. Find the decisions. Design the flow.
Chain
One step after another
A predictable pipeline. Each step passes its output to the next, with no branching or parallel work.
A step may call a model, but the next destination is fixed.
Trace the flow, one step at a time.
Branch
Route to exactly one path
One input, several possible paths. A router selects a single specialist for this request.
The router can use a model to select one destination.
Trace the flow, one step at a time.
Fan-out
Launch independent workers
A single source starts several workers in parallel. Each continues independently; there is no join.
A model may choose the tasks or number of workers.
Trace the flow, one step at a time.
Fan-in
Wait, then merge
Several inputs converge at a barrier. The merge runs only when all required inputs have arrived.
The merge may use a model to synthesize the inputs.
Trace the flow, one step at a time.
Diamond
Split, work, reunite
Fan-out and fan-in together. Divide the work, execute in parallel, then combine the results.
A planner can divide tasks; a synthesizer can merge results.
Trace the flow, one step at a time.
Star
A coordinator at the center
A central hub delegates to specialists and receives their responses. Workers communicate through the hub.
The coordinator decides whom to ask and what to do next.
Trace the flow, one step at a time.
Tree
A tournament of candidates
Candidates compete in pairs. Judges select winners in successive rounds until one candidate remains.
Every judge can be a model comparing the two inputs.
Trace the flow, one step at a time.
Loop
Repeat until a condition is met
Do the work, then decide whether to continue. A backward edge repeats work until the stop condition is met.
The check can be a model decision. Always set an iteration limit.
Trace the flow, one step at a time.
Feedback
Generate, critique, revise
A critic evaluates a draft. Revise using the feedback, then evaluate again within a bounded loop.
The critic judges quality and accepts the draft or requests revision.
Trace the flow, one step at a time.
DAG
Dependencies without cycles
An arbitrary directed acyclic graph. Each node runs after its dependencies; no edge leads back to an ancestor.
Any node can call a model. Dependency edges must remain acyclic.
Trace the flow, one step at a time.