Study Guide · Chapter 3: Execution Loop · 5 min read · 🎒 Middle School
How AI Learns From Trying, for Middle Schoolers
Ask a chatbot a question and it answers once. Give an AI agent a big job — like planning a party — and it has to try steps, check whether they worked, and fix its mistakes. That repeating pattern is called an execution loop, and it is how AI gets things done.
Think, do, check, repeat
For big tasks, an agent does not answer once and stop. It runs a loop: think about the next step, do it, look at the result, and repeat until the goal is complete.
Engineers call this pattern ReAct — Reason, Act, Observe. It is how experienced cooks work through a new recipe: read the step, do the step, look at the pan, adjust.
Plans are just recipes
Before acting, good agents write a plan: a list of steps in order, with the tools each step needs. Big goals are just many small plans chained together.
The trick is that plans are flexible. When reality disagrees with the plan — a link is broken, a step fails — the agent updates the plan instead of marching bravely into a wall.
Mistakes are fuel
Every failed step is a signal. Maybe the step was in the wrong order, or the wrong tool was used, or the goal was unclear.
Smart agents use those signals to change strategy: try differently, pick another tool, or ask a human for help. Escalating to a human is not failure — it is the agent knowing its own limits.
💡 The Big Analogy
Beating a Video Game Level
You cannot see the whole level at once. You plan a route, try it, fall into the pit, and learn. Next try you jump earlier — further, faster. That is an execution loop: plan, act, observe, adjust, repeat. AI agents do the same thing, except they keep notes on what failed so they do not need a new game every time.
🛠️ Try It Yourself
Spot the missing steps
- Write 5 steps for 'get ready for school in the morning' — for example: get up, eat breakfast, go to school.
- Read your list to a friend who pretends to be super-literal. They do exactly what you wrote, nothing more.
- Find at least three missing details. Did you say 'put on shoes' before 'go outside'? Did you pack a backpack?
- Rewrite your improved list. Congratulations — you just did the 'replan' step of an execution loop!
📝 Quick Quiz
Try to answer before peeking. The correct answer is marked with a check, and the explanation shows you why.
Q1. What does an execution loop do?
A. Plans, acts, checks, and adjusts until the goal is done ✔
B. Answers only once and stops
C. Deletes old data
D. Talks faster
Why? Execution loops repeat think → do → check → adjust until the task is genuinely complete.
Q2. When an agent's step fails, what should it do?
A. Give up forever
B. Look at why it failed and try a better step ✔
C. Pretend it succeeded
D. Turn itself off
Why? Failure feedback is the signal the loop needs to replan, retry differently, or escalate to a human.
Q3. Why plan before acting?
A. It makes big tasks clearer and easier to fix ✔
B. Plans never change, so they are always right
C. Plans are faster than doing anything
D. You only need plans for tests
Why? A good plan breaks big goals into steps, and those steps can be revised when reality disagrees.
Key Points
- Big tasks run in loops: think, do, check, adjust, repeat.
- Mistakes teach the agent what to change.
- Plans are flexible recipes — designed to be revised.
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 · How AI Learns From Trying, for Middle Schoolers
