Study Guide · Chapter 3: Execution Loop · 5 min read
Execution Loops, Explained Simply
Ask a model a question and it answers once. Give an agent a goal and it has to figure out the steps — try them, notice what went wrong, and adjust. That repeatable rhythm is the execution loop.
Think, act, look, repeat
The most common pattern is called ReAct: Reason, Act, Observe. The agent reasons about what to do next, takes one action (often a tool call), observes the result, and repeats until the goal is met.
It is exactly how experienced cooks work through an unfamiliar recipe: read the step, do the step, look at the pan, adjust the heat. No one executes all steps blindly in one shot.
Planning is just writing the recipe first
For bigger goals, agents plan before acting: break the objective into ordered subtasks, note dependencies, and estimate what tools each subtask needs.
Good plans stay flexible. When reality disagrees with the plan — an API fails, a file is missing — the agent revises rather than marching on. Plans are hypotheses, not scripts.
Self-correction needs honest feedback
An agent can only fix what it can see. Validation errors, failed assertions, and explicit test results give the loop something real to correct against.
Without honest signals, self-correction becomes confident wandering: the model keeps rewriting its mistakes into new, differently-shaped mistakes.
Key Points
- ReAct — reason, act, observe — is the heartbeat of nearly every modern agent.
- Plans decompose big goals; they should be revised when reality disagrees.
- Self-correction works only when failures produce clear, machine-readable feedback.
- Every loop needs guardrails: budgets, retries limits, and stop conditions.
All study guides for this chapter: Execution Loops, Explained Simply · How Planning and Self-Correction Work Under the Hood · Execution Loops in the Real World
