Agent loop
The control structure where a model decides an action, it is executed, and the result feeds the next turn until the task is done.
By Kunj ShahEntry last reviewedmethod
What it implies
Twenty lines, and the least interesting part of an agent system. The engineering is in the host around it: surviving a deploy mid-loop, idempotent side effects, and a hard ceiling on turns and tokens. Prompts are advisory; only the host can stop a loop.
Related terms
- Tool callingA model emitting a structured request to call a function, which your code executes and returns the result of.
- Durable executionA workflow engine that checkpoints progress so work resumes after a crash, rather than restarting from nothing.
- Budget ceilingA hard limit on turns, tokens or wall-clock time, enforced by the host rather than requested in the prompt.