Module 5 · Lesson 2 of 6 · Emerging
A model in a loop
Think, act, read, repeat
An agent loops: it decides a step, calls a tool, reads the result, and repeats until it can answer.
Scene 1 of 5 · Think first
The agent starts by deciding its plan: find a restaurant with a table for 4 on Friday.
- Agent (model) — healthy — deciding
- Tools — healthy
- You — healthy
| Step | What happened |
|---|---|
| 1. Think (highlighted) | Plan: find a restaurant with a table for 4 on Friday. |
- Steps
- not shown yet
- Tool calls
- not shown yet
- Think first. The agent starts by deciding its plan: find a restaurant with a table for 4 on Friday.
- Call a tool. It asks for the search tool; the result comes back as new text for it to read.
- Read, then repeat. Reading that result, it picks the closest place and checks it with a second tool.
- Ask, book, answer. It asks you to confirm, books with a third tool, and ends the loop with its answer.
- Slower than one answer. That took 7 steps and 3 tool calls, where a plain answer is a single model call.
- Now you try. Tap the moves in the order the agent loop makes them; a round can repeat. For example, tapping Call a tool, Think about the next step, Read the result and Answer the user gives this: Not quite. Each round goes think, call a tool, read the result. The model decides each step from what the last tool returned, so it must read before it thinks again.
Scene 1 of 5: Think first. The agent starts by deciding its plan: find a restaurant with a table for 4 on Friday.
Key points
- Each round starts with the model deciding what to do next.
- The result of one tool call shapes the next step.
- Every round is another model call, so agents are slower and cost more.
- If the steps never change, a fixed workflow does the job for less.
An (A model that calls tools in a loop, deciding each next step from the results, until it can answer.) is a model that can call tools, such as a search or a booking system. It decides what to do next from the results.
It works in a loop: think about the next step, call a tool, read the result, and repeat until it can answer.
Each turn of the loop is another model call, so an agent is slower and costs more than a single answer.
In system design: Use an agent only when the steps depend on each other; when the steps are known in advance, a fixed workflow is cheaper.