How an agent works
First, the model
A large language model is a vast collection of numbers.
Which is weird, right? Didn’t we just call it a language model? But stay with me. The model encodes statistical relationships between words. Because words contain meaning, these statistics become a strange repository of ideas, ready to be played back at will.
The model, in the simplest terms, can predict the next word that comes in a series of words. If you ask any given person the most essential ingredient for a sandwich, we’ll all give you the same answer: it’s bread. There are many kinds of sandwich, but without bread, you’re looking at a different category of food altogether.
Now imagine 10,000 recipes for sandwiches. Nearly all of them will indicate this fact about bread. So the statistical weight behind the question “what do I need to make a sandwich?” will immediately load bread as the highest item on the list.
Where things get interesting: the model encodes far more than just sandwich recipes. These relationships between ideas stack and entangle, leaving the domain of food entirely, and all of it is reachable inside of a single conversation. So a model can help you imagine a science fiction sandwich for a species that metabolizes metals, or an ancient and fictional civilization built on breadmaking, where sandwiches have social consequences.
Models are “trained” on a variety of inputs, from books and manuscripts to scientific papers to recipes and computer code, anything with language is fair game. Even internet discussions are included in the training process.
The result is a pile of numbers so big, most computers can’t even hold them in memory. Lurking in these numbers are relationships between ideas, facts, strategies for solving problems, even references to historical events. Building a model is an attempt to suspend human knowledge itself in a jar, ready to be applied to any given situation.
How agents use models
Imagine a sequence:
1, 2, 3, 4
You know what comes next. So does the model.
When you “chat” with a model, you take a turn speaking, then the model replies. On each of these turns, the entire conversation history is provided to the model, which then generates a response to tack on at the end.
So, a boring conversation that looks like this:
me: 1, 2, 3, 4
agent: 5, 6, 7, 8
me: 9, 10, 11, 12
is shown to the model on the fourth turn not as
9, 10, 11, 12
but instead as that complete conversation transcript to that point. The model then makes a statistical prediction about what that conversation should contain next.
This is called context, and it has limits. Information is physical. The same way your computer can only contain so much information before you need to upgrade it, the computing systems that drive a model have a ceiling on how much information they can process. Dealing with these limits is one of the big jobs you’ll have working with agents.
Context and its limits are measured in tokens, which are fragments of text, usually a few characters.
Because the entire conversation is played back for the model on every turn, it’s able to incorporate the information from 20 turns ago into a later question, if necessary. Or, to keep track of multi-step plans.
An agent uses the output of a model to drive forward toward a goal.
The problem with models
If models are a jar of preserved human knowledge, it’s important to take that metaphor to its conclusion. Like jam, models can be kind of wobbly.
In the study of information, it’s accepted that to make things smaller, you discard some information. No photo you send contains the full collection of light data your camera saw. Much of it is discarded. This is called “loss” or “lossiness” and LLMs are lossy indeed. For many facts, the information contained is pretty solid. A 2026 model is pretty trustworthy on the facts of cosmology, major world history, chemistry, math, programming: places with loads of statistical weight and ample data sources. But models grow fuzzier around the edges. The less statistical weight, the less guarantee a model will represent ideas or facts with high integrity.
But it gets worse: across the total sum of an entire conversation, a model might lose emphasis on an important detail or accumulate a set of contradictory notions. This can result in behavior that works against your goals. Worse, it can make it so that the same process produces different output.
These are the perils of statistical processes.
Compared to how computing used to work, all of this is kind of weird. In the past, computers were predictable. They always worked the same way, assuming competent programming. But this came at its own cost: computers were highly inflexible. You had to know exactly what you wanted to happen ahead of time.
In this, the model’s wobbliness is a blessing: it can read nearly any file format. It would be hard to write code that did this. But we also have to compensate for this wobbliness with structure.
That structure is the agent. Agents are computer code that rides the flexibility of models, channeling their compressed information and ability to interpret data into useful work. You can customize an agent to accomplish loads of tasks.
That’s where tools and skills come in.