Lab

AI agent

AI agent: A language model that outputs tool calls, plus ordinary software that runs them and feeds the results back, repeating until a stop condition is met.

People hear “agent” and picture something that acts on its own. What is really there is simpler, and easier to reason about.

An AI agent has two parts. The first is a language model, which only ever outputs text. Some of that text is a tool call: a short, structured request such as “read this file” or “search for this phrase”. The second is the harness, the ordinary software around the model that reads the tool call, runs the matching tool and pastes the result back into the model’s context. The harness also holds the rules for when to stop and when to ask a person.

Put those together and repeat, and you have an agent: the model reads everything so far, outputs the next step, the harness carries it out, and the model reads again. The ReAct paper showed that interleaving steps like these with the results they bring back lets a model gather information it did not start with.

Nothing in the loop changes the model. Its weights stay the same from the first step to the last. What changes is the context it is given, and what the harness lets it touch. That is why most of the safety and quality of an agent lives in the ordinary software around the model, not in the model itself.

The explainer lets you step through a small scripted agent, one tool call at a time.

See it working

Explore it in How an AI agent works

Step through a model calling tools in a loop, and see how the harness around it decides what it sees, what it may touch and when it stops.

Open the explainer