Lab
Agent Loop Simulator
Step through goal, plan, tool call, observation and reflection.
A tool-using agent doesn’t answer in one shot, it runs a loop: plan the steps, act by calling a tool, observe the result, then reflect on whether it’s done. Step through it one phase at a time and watch the trace build.
Trace
Press Step to advance one phase, or Run to end to finish the loop.
Every capable agent, a coding assistant, a research agent, a computer-use agent, runs some version of this loop. The model never “knows” the tool result in advance; it proposes an action, the environment returns an observation, and only then does the model decide what to do next. Reflection is what lets an agent recover from a bad step instead of charging ahead.
Honest note: the tools here are real but tiny. The calculator is a genuine expression evaluator (no eval), and “research” looks answers up in a small built-in table, when nothing matches, the agent says it has no source rather than inventing one. A production agent swaps these stubs for real tools and a real model, but the loop is exactly this shape.
Challenge
Give the calculator a malformed goal like what is 5 / 0 or what is 2 + and step through. Where in the loop does the failure surface, and how does the final answer report it honestly?