home/glossary/The Agent Loop
Foundations

The Agent Loop

definition

The agent loop is the core observe-think-act cycle that drives all agentic behavior. The model receives context (observations), reasons about what to do next (thinking), selects and executes a tool or produces output (acting), then feeds the result back into the next iteration.

The agent loop is the core observe-think-act cycle that drives all agentic behavior. The model receives context (observations), reasons about what to do next (thinking), selects and executes a tool or produces output (acting), then feeds the result back into the next iteration. This loop continues until the agent determines the task is complete, hits a safety limit, or requires human intervention — and shaping how this loop terminates is one of the most important design decisions in agent architecture. Understanding the agent loop is critical because every other concept on this map — from context engineering to evaluation — is ultimately about making one or more iterations of this loop more reliable, efficient, or safe. This concept connects to the ReAct pattern for a specific implementation of the loop, error recovery for handling loop failures, and human-in-the-loop for understanding when to break the cycle for human approval.