Agent Loop

Module: agentic

What it is

The agent loop is the repeating cycle of an agent's operation: observe the current state, decide what to do, take an action, observe the result, and repeat until the goal is achieved or the agent determines it can't proceed. This loop is the heartbeat of agent execution.

Why it matters

Understanding the agent loop helps you understand agent behaviour. Each iteration involves decisions that can succeed or fail. Long agent loops can accumulate errors. Knowing about the loop helps you set appropriate expectations and design tasks that work well with iterative execution.