Lattice
Skip to content

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 Lattice editorial · Entry last reviewed · method

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