Home / Concepts

Loop or graph: how should agents be coordinated?

Use a loop to improve one task until it passes. Use a graph when several specialists need to branch, rejoin and share state.

There are three shapes. A sequence is steps that depend on each other and run once. A loop repeats one task, checking it each time, until it meets an exit condition. A graph coordinates several tasks, with connections that decide what runs, retries, pauses or stops.

A graph needs shared state so every agent stays aligned. In mine that is scope, diff, evidence, status and budget.

Graphs cost coordination. Start with the simplest shape that fits. A common mistake is building a complicated system for work a checklist could finish.

Lessons that use it

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