Definition

Agent Loop

An agent loop repeatedly uses new state or tool results to decide the next step. A simple loop asks a model to choose an action, runs the allowed action and records the result before the next decision. Frameworks can add branching, parallel work and pauses. Define when the loop finishes or asks for help.

Give the loop a step budget and a stopping rule

A documentation assistant gets up to three read-only searches. It can finish as soon as it has a passage that answers the question. If it spends the third search without finding a reliable answer, it reports what it checked and asks for clarification. Store each tool result with its source so the stopping decision can be inspected.

Tool calling rounds and tool results

Intelligence at Scale by Shashank Agarwal

Agent Loop diagram from Intelligence at Scale
Diagram from chapter 10, Building AI Agents

Explained in

Chapter 10: Building AI Agents

Frameworks, patterns, and how to actually build an agent that works.

Related terms

This is one term. The chapter is the argument.

Intelligence at Scale: 22 chapters, 65,000 words, 80-plus diagrams. Kindle, paperback and hardcover on Amazon.

Buy on Amazon.com
← All terms