What an AI agent is
An agent is a language model put in a loop and given tools, so it can carry out actions instead of only describing them.
You’ve used a chatbot: you type, it types back. Ask it to “rename every file in this folder to lowercase” and it will tell you it can’t: it 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. What changes is what 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 executes the tool 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:
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.
Act
If it asked for a tool, the runner executes it. This is the only step that reaches the real world.
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.
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:
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 is already in everyday use. 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 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 useful, and what the risks are
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 basic one: 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 the mechanism is clear, the practical question for anyone running production systems: when to let an agent loose, and when not to.