CHAPTER 02 · The Agent Loop Pattern · 5 / 8
Variants of the loop
The basic single loop scales surprisingly far, but you'll encounter variants:
Single-loop (ReAct-style)
One model, one loop, tools available. The model reasons and acts in an interleaved stream. This is the workhorse and is sufficient for most agents, including document assistants. Start here; don't reach for more complexity until you've proven you need it.
Planner–executor
A first model call produces a plan (a list of steps), then a loop executes each step, possibly with its own sub-loops. Useful when tasks are long and benefit from explicit decomposition, or when you want the plan visible/editable by the user. The cost is added complexity and latency; the benefit is structure and steerability.
Multi-agent
Several specialised agents (each its own loop, prompt, and tools) coordinate: a "researcher" hands off to a "writer," or a "supervisor" routes work to "workers." Powerful for genuinely heterogeneous tasks, but it multiplies cost, latency, and failure modes, and the coordination overhead is real. Most products that think they need multi-agent actually need better tools and context in a single loop. Reach for it only when sub-tasks are truly independent and benefit from isolation.
Reflection / critique loops
After producing output, the agent critiques its own work and revises. Improves quality on hard tasks at the cost of extra calls. Often implemented as an explicit "now check your answer" step rather than a separate agent.