Guide contents

Lesson 31 of 57

Models vs AI Agents

People often say they asked "the model" when what they did was type into a chat app. The two are not the same thing. Almost nothing you have ever used is a model on its own. There has always been a program between you and the model.

Knowing where the line between the two falls explains most of what a model can and cannot do for you. It explains why a chat app sometimes tells you to save a file yourself, how a model can "read" a PDF, and what changes when a product is called an agent.

This lesson separates the model from the software around it. It shows what a model is by itself, what the surrounding software does in an ordinary chat app, and what that software does when it is allowed to act on your files. After this lesson you can look at any AI product and say which part is the model and which part is ordinary software.

Idea Short meaning
Model A system that takes tokens in and produces tokens out, and nothing else
Application The ordinary software around a model: the window, the buttons, the code that sends and receives
Deciding Working out what should happen next and writing it down as text. A model does this
Doing Making something happen, such as opening a file. Only a program does this
AI agent Software around a model that is allowed to carry out actions the model asks for
Tool One action the software is willing to perform when the model asks

1. What a model is by itself

A large language model does one thing. Text goes in, and text comes out. More exactly, tokens go in and tokens come out.

flowchart LR
    A["Text in"] --> M["Large language model<br/>tokens in, tokens out"]
    M --> B["Text out"]

The diagram is complete. There is nothing else attached to the box.

It helps to say what is not inside the box, because everyday language suggests otherwise.

Not inside the model What is true
A brain The model is a very large set of numbers used in a calculation. It is not a living, continuously running mind. It computes only when a request arrives
A memory The model keeps nothing from one request to the next. An app that seems to remember is sending the earlier conversation again each time
A database The model cannot look a fact up in a store of records. What it knows from training is spread across its weights, which is why it can state a wrong fact confidently

The output is produced one token at a time: one token, then the next, then the next.

Text
Let | me | work | through | this | step | by | step

This is also what happens when a model appears to think. A reasoning model that writes out its working is using the same mechanism for longer. It produces more tokens before the answer. There is no separate thinking machine beside the text generator.

2. Asking a bare model to write a file

Because text is the only thing a model produces, a model on its own cannot do anything. Here is what happens when a model with no extra software is asked to save a file:

Text
you:     Save that summary to ~/notes/lease.md

model:   Here is the content. Create ~/notes/lease.md and paste this in:

         # Lease summary
         Term: five years, break at 36 months
         Rent review: annual, capped...

         Let me know once you have saved it and I can carry on.

Nothing was written to the disk. The model produced text that describes a file being written, and it asked the person to do the saving. That is the correct behaviour for a system whose only output is text. It cannot reach the disk, so it hands the job back.

3. Deciding and doing are different jobs

The file example shows a split between two jobs.

What a model is for: deciding What a model alone cannot do: doing
It reads what is going on Opening the file
It works out what should happen next Running the search
It writes that down, as text Sending the request

A model can produce a thought process. It cannot produce a consequence. Every item in the right-hand column needs a program, something that runs on a computer and can touch files, networks, and other systems. A model is not a program in that sense. It is a calculation that turns tokens into tokens.

So the model can work out that the next step is "save this text to lease.md". Saving it is a different job, and something else has to perform it.

4. The software that goes around the model

Since the model only turns text into text, someone has to build the software that surrounds it. That software has four jobs.

flowchart LR
    U["You"] --> S1["Software<br/>takes your input<br/>and sends it to the model"]
    S1 --> M["The model<br/>(on the provider's servers)"]
    M --> S2["Software<br/>reads the model's output<br/>and shows it to you"]
    S2 --> A["The answer"]

Reading the diagram from left to right: the software takes what you typed, sends it to the model, reads back what the model produced, and hands you the answer. Not one of those four jobs belongs to the model.

The model usually runs on the provider's servers, and the software reaches it through the API. The software acts on the model's behalf. The model never reaches you directly.

Every part of this arrangement except the model itself is ordinary software that a programmer wrote, in the same way as any other app.

5. The chat app is that software

You already use such a system. A chat app in a browser tab, or installed on your computer, looks like this:

Text
you:     What goes in a lease renewal letter?
model:   Start with the tenant, the property and the current term...

Around that exchange are several parts:

  • the text box
  • the send button
  • the scrollback, meaning the list of earlier messages you can scroll through
  • the account you signed into
  • the attach button

Every one of those is a program somebody wrote. Not one of them is the model.

The model is not in the window. The window stands between what you typed and what came back. When the scrollback shows yesterday's conversation, the app stored it, not the model. When you sign in, the app checks your account, not the model.

6. What happens to a PDF you attach

The attach button shows the split clearly.

flowchart LR
    A["lease.pdf<br/>(you drag it in)"] --> B["The app<br/>opens the file and<br/>pulls out the text"]
    B --> C["Your prompt<br/>plus the text from the file<br/>(one block of text)"]
    C --> D["The model<br/>(on the provider's servers)"]

You drag lease.pdf into the app. The app opens the file and pulls out the text. It then joins that text to your prompt, so that one block of text is ready. That block is sent to the model on the provider's servers.

The model never saw your PDF. It was handed text, as it always is. The work of opening the file and extracting its contents was done by ordinary software before the model was involved.

Two details vary between products. First, the extraction may happen on your own machine or on the app's servers, depending on how the app is built. Second, a page that is a scan or a picture cannot be turned into text this way, so many apps send it as an image, and the model receives image tokens instead. In both cases the principle holds: software in front of the model converts the file into something the model can take as input.

So the accurate way to think about it is this. You have never used a model on its own. Something has been standing in front of it every time.

7. An agent is the same software, allowed to do more

A chat app's software does a small set of things: it sends your text, shows the reply, and converts attachments. An AI agent has the same shape, with the software permitted to do a few more things on your behalf.

Suppose an agent is pointed at a folder on your computer.

Text
~/projects/atlas/                  a folder the agent is pointed at; it can look through this
    notes.md  report.pdf  budget.csv     files it can list, open, and read
        summary.md                       a file it did not find; one it wrote

The first line is the folder. The agent's software is allowed to look through it. The second line shows three files that were already there. The software can list them, open them, and read them. The third line is different. summary.md was not in the folder at the start. The agent created it.

Compare this with section 2. There, the model asked the person to create the file. Here, the file exists at the end. The model did not gain a new ability. The software around it was given permission to write files, and it did the writing.

8. What an agent offers the model

An agent does not give the model powers. It gives the model a list of things the software is willing to do if asked. Each item on the list is called a tool.

The tools this agent offers:

Text
list_folder(path)
read_file(path)
write_file(path, text)
search_files(query)

Each line is the name of an action, followed in brackets by the information the action needs. read_file(path) means "read a file, given its location". write_file(path, text) means "write this text to a file at this location". This list is sent to the model as part of the request, as text, along with your prompt.

What the model sends back when it wants to use one:

JSON
{
  "tool": "search_files",
  "query": "renewal terms"
}

This reply is structured output: a small piece of JSON with two fields. It says which tool the model chose, search_files, and what to search for, "renewal terms". It is a choice, written out in text, like everything else the model produces.

The model runs nothing. It names one of the tools. The software reads that reply, performs the search on the real files, and hands back what happened, again as text. The model then decides what to do next with the search results in front of it.

The division of work is the one from section 3. The model decides, and the software does. An agent is the arrangement that connects the two. The next lesson follows one task through this arrangement step by step.

Interview points

  • A model is a function from tokens to tokens. It has no persistent memory, no database to query, and no ability to act on the outside world.
  • Apparent thinking is the same token-by-token generation continued for more tokens before the final answer.
  • A bare model asked to perform an action can only describe the action in text, because text is its only output.
  • Deciding and doing are separate. The model reads the situation, works out the next step, and writes it down. Opening files, running searches, and sending requests need a program.
  • Every AI product wraps the model in ordinary software that collects input, sends it to the model, reads the output, and presents the result. Chat app features such as history, accounts, and attachments belong to that software.
  • An attached file is converted by the application into text or image input before the model receives anything. The model never handles the file itself.
  • An agent is the same wrapper with permission to carry out actions. It sends the model a list of tools, the model replies with a structured request naming one tool and its arguments, and the software executes it and returns the result.
  • The model never executes a tool. Tools are capabilities of the software that the model can ask for.

Summary

  • A model takes text in and gives text out, and that is all it does.
  • It has no memory between requests and no database of facts to look up.
  • A model can decide what should happen, but it cannot make it happen.
  • The software around the model sends input, reads output, and shows the answer.
  • A chat app's window, buttons, history, and attachments are all ordinary software.
  • An agent is that software with permission to act, such as reading and writing files.
  • The agent offers tools, the model names one, and the software carries it out.