Home / Lessons / Assign the work / 9 of 27

Loop or graph

A loop improves one task. A graph coordinates several.

  1. A loop: one agent, one task, and a check at the end of every lap.
  2. Not good enough. Round again.
  3. This time it passes, and the loop ends.
  4. A graph: several tasks branch out, rejoin, and stop at a person.
  5. More parts mean more coordination. Start with the loop.

A loop improves one bounded task through repeated checks. It plans, builds, verifies, fixes, and leaves when the result passes.

A graph coordinates several tasks, tools and decisions. Shared state keeps every agent aligned. The connections between steps decide what runs, what retries, what pauses and what stops.

Start with a loop. Add a graph when the work needs it.

How I do it

Most of my work is loops. A graph appears when a slice has real specialists that need to branch and rejoin.

The rule

Reach for the simple shape first.

Read next

The ideas behind it

This lesson as plain text, for your agent. Or all 27 on one page.

Try “secrets”, “merge”, “handover” or “database”.