Agents
Agent loop
An agent loop repeatedly observes state, chooses an action, and evaluates the result.
How it works
The loop converts a one-shot model into a stateful process. Budgets, idempotency, and termination checks prevent uncontrolled repetition.
A concrete example
Illustrative: cap execution at 12 turns or $0.50, whichever occurs first.
Do not confuse it with Retry loop
a retry repeats an operation; an agent loop can choose a different action from new evidence.