Module 1Episode 111 min
The whole of module 1 as one video. Jump to any chapter, or read the lesson it comes from.
What it teaches, what that builds on, and what it opens up next.
Covered in this episode
You type a question into a chat assistant. A few seconds later, a clear, confident answer appears. Sometimes with a table, or a piece of code. It feels like talking to someone who knows a lot. So what is actually on the other side? Today, two questions. What is a language model? And how does it become an agent, that does real work for you?
Meet two friends. Leila works in marketing. She has used AI chat for a year, and started using an agent a month ago. Her friend Omid builds agents for a living. Leila asks him, "When I ask it something, does it look the answer up somewhere?" Omid asks her back. "What happens when you ask it for something it has never seen? Like a poem about your own cat?" It writes one. A new poem, about a cat it has never met. So it can't just be looking things up. There is no page with that poem on it. So let's be exact. What goes in? Your message. Text. What comes out? Text. Sometimes code, or a table. But that is text too. That is the whole interface. At the centre of every chat assistant, and every agent, is a language model. A program that takes text in, and gives text out. Nothing else. It can't click. It can't open your files. It can't go on the internet. It reads text, and it writes text. But Leila says: it knows things. It knew the capital of Uruguay, and how to fix my spreadsheet. So where is that knowledge kept?
A language model starts as a huge set of numbers. All of them random. Then it is shown a vast amount of text. Books, websites, articles, code. Billions of pages. Again and again, it gets the start of a piece of text, and has to guess what comes next. When it guesses wrong, its numbers are nudged a tiny bit. So next time, the right word is a little more likely. This is called training. For a large model, it takes months, on thousands of computers. Something remarkable happens along the way. To guess the next words of a chemistry book well, it helps to know some chemistry. To continue a story, it helps to keep track of who is who. To finish a line of code, it helps to know how the code works. So the model ends up with a lot of knowledge and skill. All packed into its numbers. Hundreds of billions of them. Then it is trained some more, on examples of a helpful assistant answering people. Before that, it might continue your question with more questions. After it, it continues your message with a helpful reply.
So the knowledge is in the numbers. There is no library inside it. Nothing it read is kept as a page it can go back to. Which means it can't check. If it remembers something a little wrong, it just says the wrong thing. And it says it in the same confident tone as everything else. A confident sentence is what usually comes next. That is one reason AI answers are sometimes wrong in ways that sound completely right.
Leila again: but my chat assistant does search the web sometimes. I have seen it show links. It does. But the model is not the one searching. The app around it is. The model writes, in effect, "please search for this". The app does the search, and pastes the results back in, as more text. The model reads them, and writes its answer. So the model is still only reading and writing text. The app does everything else.
Here is the picture to keep in your head. Whatever you see an AI system do, the model did one thing. It read some text, and wrote some text. The text you give a model is called the prompt. In a chat, the prompt is more than your latest message. The app quietly adds the earlier messages too, and some instructions of its own. Here is a way to see it. Open a brand-new chat, and ask, "What did I ask you yesterday?" Most assistants will tell you they can't know. Some apps have a memory feature. But without one, the model only knows what is in the text it is given right now. When the app around the model does something, like searching the web, that is the app acting on text the model wrote. Now give a model the right app around it. It can rename your photos, fix a bug, or fill in a report. That is an agent.
So how do you use this tomorrow? Three habits. One. Treat facts from the model as a good first guess, not a source. Its knowledge is patterns in numbers, and it can't look anything up unless the app gives it a search tool. Two. Give it the text it needs. If the answer depends on your document, your numbers, or your situation, paste them in. It can only work with what is in front of it. Three. When it does something, ask who did it. It searched the web means the app searched, and the model read the results.
Leila has three hundred photos from a company event. They all have names like IMG 4471 dot jpg. She wants them renamed by the date they were taken. She asks a chat assistant. It gives her clear instructions. Eleven steps, and a small script to copy and run. Then she asks an agent. A minute later, the photos are renamed. Both used the same kind of model. So what made the difference? Leila says: you told me the model only reads and writes text. But the agent renamed my files. Something touched my computer. So what was it? The app around the model. Just like with the web search. Imagine the app tells the model this, before Leila's message. You can ask me to run commands on Leila's computer. Write the command in this special format. I will run it, and tell you what happened. So what would the model write first?
Leila thinks it through. First, it would want to see the photos. So, a command to list the files. The app runs it, and pastes the list back in. Next, look at one photo's details, to find the date it was taken. Then, one command to rename them all. And then list them again, to check that it worked. So how many times did the model write something? Four or five. Each time, it saw the result of the last step, and then chose the next one. That is an agent. The model still only writes text. But some of that text is a request to do something. The program around it carries it out. And the result comes back, for the model to read. Round and round, until the job is done. And the chat assistant? Its app gave it no way to run commands on her computer. Same kind of brain. No hands.
So here it is. An AI agent is a language model, inside a program that gives it three things. One. Tools. Actions the model can ask for, like reading a file or running a command. The model writes the request, and the program does the action. Two. A loop. After each action, the result goes back to the model, and it decides what to do next. Three. A goal. Your request, like rename these photos by date. The model works towards it, over many steps. The important part is this. The model chooses the steps. Compare a workflow. In a workflow, a person fixed the steps in advance. Take each new email. Ask the model to sort it into one of five folders. Move it there. The model helps at one step. But it doesn't decide what happens next. In an agent, nobody wrote down, first list the files, then read the dates. The model worked that out itself. That is what makes agents powerful. And it is also what makes them harder to predict. Much of this course is about getting the first, without being surprised by the second.
Which agents might you meet? Coding agents, like Claude Code, Codex, Cursor and Gemini CLI. They work in a folder of files on your computer. They read code, edit it, run it, and fix what breaks. Many people who don't program use them for files and data too. Browser agents click through websites, to fill in forms or compare prices. Office agents work on documents, spreadsheets and email. Their tools are different. But inside, they all work the way Leila worked out. This course uses Claude Code as its main example.
Every part of an agent gets its own module in this course. Tokens. The pieces of text a model really reads and writes. The context window. Everything the model can see at one moment. Tools and the loop. Exactly how a tool request works. Giving an agent knowledge. Instruction files, memory, and skills. Keeping an agent in check. Permissions, hooks, and planning before acting. Many agents, many tools. Helper agents, and MCP, a standard way to plug in new tools. And using agents well. Cost, safety, and checking the work. Here is the difference, side by side. Ask a chat assistant, make a folder called test on my desktop. It tells you how to do it. Now ask an agent the same thing, in an empty practice folder. It shows each action, and does it.
And three habits for agents. One. Ask for the outcome, not the steps. Choosing the steps is what an agent is good at. Two. Watch the first few actions. If it heads the wrong way, stop it and say so. That is cheaper than letting it carry on. Three. Use a workflow when the steps never change. Fixed steps are faster, cheaper, and easier to predict.
Let's put it all together. A language model only reads text and writes text. It keeps what it learned as numbers, not pages. An agent is a model with hands. It asks for actions, sees what happened, and decides the next step, until the job is done. Next time, tokens. The pieces of text a model really reads, and why they decide its speed, its limits, and its price. The lessons and quizzes for this course are free on knaph dot com. See you in the next episode.