Chapter 12 of 36 · ~1 min

The Agentic Loop

The agentic loopPlandecide what to doActrun a toolObserveread the resultCorrectrevise the planagainStopdone, or budget spentfinal answeriteration 1 of 6the loop is bounded: a limit stops it if the model does not
step 1 of 9

The model reads the task and decides what to do first.

Plan, act, observe, correct, stop. Every agent is some arrangement of these five moves.

Look inside the loop. Planning: the model decides what to do first. Execution: an action runs. Observation: the result comes back. Correction: the model revises its plan based on what it saw. Stopping: the model decides it is done, or a limit says it is. Every agentic system you will meet is some arrangement of these five moves, whatever the vendor calls them.

The stopping rule deserves attention. Left to itself, a model may keep searching for evidence that does not exist, or declare victory before it has any. Iteration limits, tool-call budgets, and explicit "you are done when" instructions turn an open-ended loop into a bounded one.

Experiment 1 of 2

Runs in your browser

A recorded run, replayed one move at a time: plan, act, observe, correct, stop.

Task: Which of our two kettles, the Aster or the Birch, sold more units last quarter?

PlanActObserveCorrectStopiteration 0 of 6
    An example run, replayed step by step. Not a live model.

    Experiment 2 of 2

    Live model

    Give the agent a task that takes several steps and follow the loop iteration by iteration until it stops, or the budget stops it.

    budget: 6 iterations, 5 tool calls

    Runs against a live model through Chatterfly's server. Your text is sent to the model provider and not stored. The tools are fakes over an invented catalogue; the arithmetic tool is a real calculator.

    Big question

    How does the agent know it has finished, and how do you?