Agent loop
The cycle that turns tool calls into an agent - send the request, run any tools the reply asks for, add the results, and repeat until a reply asks for none. Each time round is a turn, and each turn sends everything again.
Depth 1 · Foundation
You can describe the loop and how it ends, explain why seeing results each turn makes agents good at real tasks, and say what each turn costs.
Sign in to prove what you know with a short quiz, see how deep you've gone, and earn XP for it.
Sign in with GoogleDepths of understanding
- 1
Foundation
You can describe the loop and how it ends, explain why seeing results each turn makes agents good at real tasks, and say what each turn costs.
- 2
Deeper
You can build it: a loop that sends the conversation, adds the whole reply, runs every tool call when stop_reason is tool_use, returns the text on end_turn, stops on any other stop reason and gives up after a fixed number of turns.
Master depth 1 first
Your path here
What's still between you and Agent loop, depth 1, in the order you can learn it.
- 1Language modelDepth 1 · Foundation · Language Models
- 2AI agentDepth 1 · Foundation · AI Agents
- 3TokenDepth 1 · Foundation · Language Models
- 4CountingDepth 1 · Foundation · Number Systems
- 5Comparing numbersDepth 1 · Foundation · Number Systems
- 6ProbabilityDepth 1 · Foundation · Probability
- 7Flat shapesDepth 1 · Foundation · Geometry
- 8Equal partsDepth 1 · Foundation · Fractions
- 9LengthDepth 1 · Foundation · Measurement
- 10LengthDepth 2 · Deeper · Measurement
- 11Equal partsDepth 2 · Deeper · Fractions
- 12FractionsDepth 1 · Foundation · Fractions
- 13ProbabilityDepth 2 · Deeper · Probability
- 14ProbabilityDepth 3 · Connected · Probability
- 15ProbabilityDepth 4 · Deeper still · Probability
- 16ProbabilityDepth 5 · Deeper still · Probability
- 17Next-token predictionDepth 1 · Foundation · Language Models
- 18Stateless modelDepth 1 · Foundation · Language Models
- 19Context windowDepth 1 · Foundation · Language Models
- 20System promptDepth 1 · Foundation · Language Models
- 21Tool useDepth 1 · Foundation · AI Agents
- 22Agent loopDepth 1 · Foundation · AI Agents
Where it fits
Builds on
This concept