All terms
Patterns
Loop Engineering
Designing the control loop that decides how an agent thinks, acts, and stops.
Definition
Loop engineering is the craft of designing the iterative control loop at the heart of an agent: when to call the model, how to feed tool results back in, how to manage and compact context across turns, when to branch or retry, and crucially when to stop. As agents handle longer tasks, the quality of this loop — not just the underlying model — increasingly determines reliability and cost.