How AI Actually Works

Lesson 11 of 14

Tools and agents in one picture

Everything so far produces words. But the AI stories filling your feed involve doing: assistants that search the web, run calculations, book the meeting, write code and then execute it, or grind through a half-hour research task unsupervised. The distance from eloquent text to actual action is covered by two ideas — tools and the loop that turns tool-use into an agent — and once you see them, a solid third of current AI headlines snap into focus.

Tools: the model asks, the system does

Start with a confession the whole course has been building toward: the model can't do anything. It cannot browse, calculate, check a calendar, or send an email — it emits tokens, full stop. The trick is disarmingly clerical: the system around the model gives it a menu — "you may reply normally, or output a specially-formatted request like: use CALCULATOR with 847 × 1.18" — and watches the output stream. When a tool request appears, the surrounding software pauses the loop, actually runs the calculator (or the search, or the calendar lookup), pastes the result back onto the desk, and lets the model continue with the answer now in view.

Notice what this buys, given everything you know. The model's arithmetic wobbles (lesson 2)? The calculator's doesn't — the model just has to notice a calculation is called for and delegate, which is a language skill, the one thing it has. Knowledge frozen (lesson 5)? The search tool fetches today (and yes — search mode is RAG, and RAG's fetch step is simply a tool; the ideas you've collected are converging). The division of labour is clean and beautiful: the model supplies judgment about what's needed; the tools supply truth and consequences.

Agents: the loop, with a goal

Now the step that gets the headlines. One tool call answering one question is an assistant. Put the same machinery in a loop with a goal — act, observe the result, decide the next act, repeat until done — and you have an agent.

The agent loop: goal → think → act with a tool → observe the result → think again — until done
The agent loop: goal → think → act with a tool → observe the result → think again — until done

Give an agent "find the three best-reviewed logistics software options under our budget and draft a comparison": it searches (act), reads what came back (observe), notices a gap in pricing info (think), searches again with sharper terms (act), pulls up reviews, compiles, drafts. Nobody scripted that sequence — the model improvised each step in response to what the previous step actually returned, which is precisely what a fixed script can't do and precisely why agents can handle tasks nobody enumerated in advance. Coding agents run this loop with file-editing and test-running tools; research agents with search and reading; the "deep research" buttons appearing in mainstream assistants as of mid-2026 are exactly this, given minutes instead of seconds.

The catch is arithmetic you can do yourself. An agent's every step inherits every model property this course has catalogued — plausible-not-true (lesson 7), drifting attention on long contexts (lesson 8), dice in the sampling (lesson 9) — and steps compound. A 95%-reliable step, thirty steps deep, is a coin flip. That's why real deployments keep humans at the checkpoints that matter, why "agent autonomy" is graded in degrees rather than switched on, and why the demo that nailed a task once is not yet a product (a distinction lesson 14 arms you for). The frontier of the field as of mid-2026 is exactly this: making each step reliable enough that thirty of them multiply out to something you'd stake money on.

You now hold the complete modern stack, assembled across eleven lessons: predictor → assistant → grounded assistant → agent — each layer wrapping the previous, none of it magic. When you want the builder's view — frameworks, guardrails, multi-agent systems — the Pro shelf's AI Agents in Production picks up precisely here.

Try this in your chatbot: ask something that forces live lookup and calculation — "find the current USD-INR rate and work out what $2,400 a month is in rupees per year." If your assistant shows its work, you'll see the loop naked: search call, result, calculation, answer. Then ask it "what tools did you just use, and what did each return?" — most will happily show you the seams.

← Previous