Chapter 1: From an LLM to an Agent
Lecture
Chapter principle
Key takeaways
- An LLM call is not, by itself, an agent.
- A tool is a capability; software still executes it.
- The critical transition: Decision $ $ Action $ $ Observation $ $ Next decision.
- Agent = Model + Context + Actions + State + Control.
- System quality depends on both the model and the harness around it.
Experiments
Every experiment in the book is small, runnable and printed with its real output. In the Lab you can replay a recorded real run of each one, with no programming, and watch what the model and the agent do.
Experiment 1: A model call
Can a language model do exact arithmetic on its own?
A language model receives text and returns text. Here a real model is asked what 27611 × 2033 is, and told to reply with the number only. The program then compares the reply with the true answer. This is one recorded run. A new run will probably give a different number.
Experiment 2: From model to agent
What changes when the model can ask for a tool?
The same multiplication, but now the model is told that a calculator exists. Nothing in the request says to use it. If the model asks for the calculator, the program runs it, adds the result to the conversation, and asks the model again. This is a recorded run of a real model. A new run may word the answer differently.
All the code for this chapter: github.com/agentic-engineering-book/code
Download the bookBrowse all chapters