Lab 05
Agent Loop
An agent is not a model. It is a loop around a model that adds instructions, state and tools in order to pursue a goal.
Conceptual model. A scripted walkthrough with fixed steps, not a running agent. The decisions shown are written in advance so the mechanism is visible; a real agent's model would make them, and could make them differently each run.
The goal
Find the refund window in the company handbook and summarise it in one sentence.
The loop
Model or agent?
A model
Takes text, returns text. One pass. No memory, no actions, no way to check its own work against the world.
An agent
A program that calls a model in a loop, carries state between calls, and executes the actions the model asks for — under whatever limits you impose.
Agent state
Empty. Start the loop to build it up.
This is the whole of the agent's memory. It is re-sent on every pass — nothing persists inside the model between steps.
Reading the result
- What just happened
- The loop has not started. The agent has a goal and nothing else.
- Why it matters
- A model answers once. An agent repeats — observe, decide, act, observe — until a goal is met or it gives up. That loop is the entire difference.
- Where you meet this
- Coding assistants that read files before editing, research tools that search then summarise, and support bots that look up an order all run this cycle.