Agent Loop
The repeating cycle where an agent observes, thinks, acts, and re-observes until its goal is achieved or a stop condition triggers.
The agent loop is the heartbeat of any agentic system: read state → reason about next action → execute a tool call → read the new state → repeat. Each pass through the loop costs LLM tokens, so the loop’s design is the main lever for cost, latency, and reliability.
Common loop patterns include ReAct (reason then act, repeat) and Plan-then-Execute (plan once, then run steps with minimal re-planning). Production loops add stop conditions: max iterations, time budget, cost budget, or a guarded final-answer check. Without these, agents will happily spin forever on hard problems. Most failures of “the agent didn’t finish” trace back to loop control, not model intelligence.
Stéphane Viaud-Murat
CEO, mi4.fr