Foundations

The Agent Loop

The agent loop is the core observe-think-act cycle that drives all agentic behavior: the model receives context, reasons about what to do next, executes a tool or produces output, then feeds the result back into the next iteration. This cycle continues until the agent determines the task is complete, hits a predefined limit, or requires human input, making the termination condition one of the most important design decisions you will encounter. Every other concept on this map, from context engineering to evaluation, is ultimately about making individual iterations of this loop more reliable, efficient, or safe.