ML//agent//agent loop
The agent loop repeatedly assembles context, asks a model for the next action, executes or rejects that action, records the observation and decides whether another iteration is warranted.
The agent loop repeatedly assembles context, asks a model for the next action, executes or rejects that action, records the observation and decides whether another iteration is warranted.
Its source code can be tiny. Its policy surface is not. Timeouts, retry rules, budgets, validation, compaction, permissions and termination conditions all change which trajectories remain possible. A loop that continues after every error creates a different agent from one that returns control immediately, even with the same prompt and model.
The loop is the heartbeat. The surrounding rules decide what kind of organism gets a pulse.