Order the five steps of the canonical agent loop from first to last
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Each turn of an agent loop runs in one fixed order: observe state, reason, choose and invoke a tool, execute it, then feed the result back as the next observation.
Imagine cooking a dish you have never made before. First you look at what is on the counter. Then you think about the next move. Then you pick up a tool, maybe a knife or a pan. Then you actually do the step, like chopping an onion. Then you look again to see how it turned out before deciding what comes next. An agent works the same way, round after round. It reads the situation, decides, grabs a tool, runs it, and checks the result. The order matters: it has to look before it can think, think before it can pick a tool, and run the tool before any result exists. Each round feeds the new result back in, so the next decision is based on what actually happened rather than a guess made at the very start.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
State the five steps in order, justify each ordering from its data dependency on the previous step, highlight the feedback step as the one that closes the loop, and contrast the dynamic loop with a fixed chain.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Putting tool execution before the reasoning step, or dropping the feedback step so the result never returns as the next observation that shapes the following decision.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.