Raphael Friedmann
← Understanding AI

What an AI agent actually is

Strip the buzzword and an agent is one simple thing: a language model put in a loop and handed tools, so it can do things instead of just talking about them.

You’ve used a chatbot: you type, it types back. Ask it to “rename every file in this folder to lowercase” and the honest ones admit they can’t, they can only tell you how. An agent is what you get when you stop making the model just talk and let it act. Same model underneath, one structural change.

That’s the whole idea. Everything else is detail.

It’s still just guessing the next word

If you’ve read what an LLM is, you know the model does exactly one thing: given some text, guess what comes next. That doesn’t change. The trick is what we let some of those guessed words mean.

Normally the model’s output is just text for you to read. In an agent, we tell it up front: if you want to use a tool, write the request in this exact format. Then a piece of ordinary software (not AI, just a normal program, call it the runner) watches the output. When it sees the model “write” a tool request, it doesn’t show that to you, it runs the tool for real and feeds the result back to the model.

So the model never actually touches your files. It asks, and the runner does the touching. Keep that split in mind, it matters later when we talk about what can go wrong.

The loop

Put together, an agent runs the same three steps over and over:

  1. Think

    The model looks at the goal and everything that's happened so far, and decides the next move: either call a tool, or declare the job finished.

  2. Act

    If it asked for a tool, the runner executes it. This is the only step that reaches the real world.

  3. Observe

    The tool's result (the file list, the search hits, the error message) gets added to the model's text, and round we go again. This loop repeats until the model says it's done.

The agent loop: think, act, observe, repeat
loop until the model says it's done Think Act Observe decide the next move run one tool read the result
The same three steps, over and over: decide, call a tool, read what comes back, decide again, until the model judges the task finished. A chatbot stops after the first one.

A chatbot does the first step once and stops. An agent does all three, again and again.

Watching one run

Say you ask: “Summarise the newest file in my downloads folder”. Here is the trace, each line one trip around the loop:

Goal: summarise the newest file in downloads
Think: I need the file list. Act: list_files("downloads")
Observe: report.pdf (today), notes.txt (last week)
Think: newest is report.pdf. Act: read_file("report.pdf")
Observe: [the file's contents]
Done: "report.pdf is a Q2 sales summary. The headline is..."

Notice the model never “knew” what was in your downloads. It found out, one tool call at a time, exactly the way a person would: look, read, then answer.

You’ve probably already met one

This isn’t theoretical. Claude Code, the agent that wrote all 97,000 lines of imp, is exactly this: its tools are “read a file”, “edit a file”, “run the tests”, “run a shell command”. It loops, writing code, running the tests, reading the failures, fixing, until the tests pass. Same three steps. The support bot that actually looks up your order, the “deep research” feature that reads a dozen pages before answering, the assistant in your code editor, all the same shape underneath.

Why this is powerful, and a little dangerous

A chatbot’s worst failure is saying something wrong. An agent can do something wrong: delete the wrong file, send the wrong email, run the wrong command. And it makes those decisions with the same confident guessing that sometimes invents facts, because it still has no built-in sense of “true”. A wrong guess that used to be a bad sentence is now a bad action.

That isn’t a reason to avoid agents. It’s the reason the interesting part, the engineering and the judgement both, lies in which tools you hand it and where you put the guardrails. For now the point to take away is the small one that demystifies the whole field: an agent is a next-word guesser, in a loop, with tools.

Next: how the loop actually works, the tool calls and the “memory” that lets it keep track across many steps. And once you trust the mechanism, the real question for anyone running things in production: when to let an agent loose, and when not to.