← Dashboard

The Agentic Loop

Chapter 2: Think, Act, Observe, Repeat

Think
Act
Observe
Decide
Step 1

Think, Act, Observe, Repeat

Every agent runs a loop. The model thinks about what to do, takes an action, observes the result, then decides whether to continue. Without this loop, the model generates one response and stops. With it, the model can work through multi-step problems.

Step 2

Think: Prompt In, Plan Out

The "think" step sends the accumulated context to the model. The model responds with a plan: which tool to call, what arguments to use, or whether to ask the user for clarification. This is where intelligence lives.

Step 3

Act: Touch the World

The harness parses the model's output and executes the requested tool. Read a file. Run a command. Search the web. The model can't do any of this itself. The harness is the bridge between thinking and doing.

Step 4

Observe: Feed Results Back

The tool's output flows back into the context window. Now the model can see what happened. Did the file exist? Did the test pass? This feedback is what turns a single generation into an iterative problem-solver.

Step 5

When Does It Stop?

A loop without exit conditions is a time bomb. Every production harness checks: Is the task done? Have we hit the token budget? Are we past the max iterations? Did the human intervene?

The loop doesn't decide when to stop. The harness does.

Step 6

Not All Loops Are Equal

Click the tabs to see how different agent architectures organize their loops. ReAct is the simplest. Plan-Execute separates planning from execution. Reflexion adds self-critique. Claude Code optimizes for tight code iteration.

The loop shape determines what the agent can do, not the model inside it.