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.

10 patterns, endless combinations
READ THE GRAPH Fixed stepModel decisionChosen / dispatched pathTerminal
10 of 10 patterns
01Sequence

Chain

One step after another

A predictable pipeline. Each step passes its output to the next, with no branching or parallel work.

Chain: A predictable pipeline. Each step passes its output to the next, with no branching or parallel work.ABC

A step may call a model, but the next destination is fixed.

Trace the flow, one step at a time.

3 steps
02Decisions

Branch

Route to exactly one path

One input, several possible paths. A router selects a single specialist for this request.

Branch: One input, several possible paths. A router selects a single specialist for this request.inputrouteABC

The router can use a model to select one destination.

Trace the flow, one step at a time.

3 steps
03Parallel

Fan-out

Launch independent workers

A single source starts several workers in parallel. Each continues independently; there is no join.

Fan-out: A single source starts several workers in parallel. Each continues independently; there is no join.dispatchABC

A model may choose the tasks or number of workers.

Trace the flow, one step at a time.

2 steps
04Parallel

Fan-in

Wait, then merge

Several inputs converge at a barrier. The merge runs only when all required inputs have arrived.

Fan-in: Several inputs converge at a barrier. The merge runs only when all required inputs have arrived.ABCmerge

The merge may use a model to synthesize the inputs.

Trace the flow, one step at a time.

4 steps
05Parallel

Diamond

Split, work, reunite

Fan-out and fan-in together. Divide the work, execute in parallel, then combine the results.

Diamond: Fan-out and fan-in together. Divide the work, execute in parallel, then combine the results.planABmerge

A planner can divide tasks; a synthesizer can merge results.

Trace the flow, one step at a time.

3 steps
06Coordination

Star

A coordinator at the center

A central hub delegates to specialists and receives their responses. Workers communicate through the hub.

Star: A central hub delegates to specialists and receives their responses. Workers communicate through the hub.hubABCD

The coordinator decides whom to ask and what to do next.

Trace the flow, one step at a time.

5 steps
07Decisions

Tree

A tournament of candidates

Candidates compete in pairs. Judges select winners in successive rounds until one candidate remains.

Tree: Candidates compete in pairs. Judges select winners in successive rounds until one candidate remains.ABCDjudgejudgejudgewinner

Every judge can be a model comparing the two inputs.

Trace the flow, one step at a time.

4 steps
08Cycles

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.

Loop: Do the work, then decide whether to continue. A backward edge repeats work until the stop condition is met.continuestopworkagain?done

The check can be a model decision. Always set an iteration limit.

Trace the flow, one step at a time.

5 steps
09Cycles

Feedback

Generate, critique, revise

A critic evaluates a draft. Revise using the feedback, then evaluate again within a bounded loop.

Feedback: A critic evaluates a draft. Revise using the feedback, then evaluate again within a bounded loop.generatecritiquerevisefinish

The critic judges quality and accepts the draft or requests revision.

Trace the flow, one step at a time.

5 steps
10Dependencies

DAG

Dependencies without cycles

An arbitrary directed acyclic graph. Each node runs after its dependencies; no edge leads back to an ancestor.

DAG: An arbitrary directed acyclic graph. Each node runs after its dependencies; no edge leads back to an ancestor.ABCDE

Any node can call a model. Dependency edges must remain acyclic.

Trace the flow, one step at a time.

3 steps
GRAPH ENGINEERING

Choose the shape. Decide what stays fixed and what the model decides.

Back to top ↑