All chapters
Thirty chapters in six parts, from a single model call to agents that act, coordinate, recover and improve themselves. Each chapter has a central question, a narrated lecture, a principle, and experiments you can replay in the Lab.
Part I · What Is an Agent?
- 01From an LLM to an Agent
What actually changes when a large language model becomes an agent? It sounds like a simple question. But the word agent is used so loosely that it's worth answering precisely.
- 02Structured Decisions
How can probabilistic language safely control deterministic software? A language model produces text, and that text is never guaranteed. Software, on the other hand, needs exact inputs.
- 03The Agent Loop
How does an agent continue acting until a goal is complete?
- 04Workflows vs Agents
When should software decide the path in advance, and when should a model decide the path at runtime?
Part II · Giving Agents Abilities
- 05Tools
How does a model gain reliable access to capabilities it does not possess internally?
- 06Context Engineering
What information should the model see at this decision, and what should be left out?
- 07Retrieval and RAG
How do we find useful evidence in a large knowledge source, and turn it into a grounded answer?
- 08Memory
What should an agent preserve from the past, and when should that information influence the present? The answer we'll arrive at is that memory is not a database.
- 09Context Compression
How do we make growing context smaller, without removing information that future decisions still need?
- 10Model Context Protocol (MCP)
How can an agent discover and invoke external capabilities through a standard interface, instead of a custom integration for every system?
Part III · Making Agents Think and Work
- 11ReAct
When does alternating model decisions with external observations improve performance over answering in one shot?
- 12Planning
When does deciding a sequence before acting improve an agent, and when does following that sequence become a liability?
- 13Reflection
Does letting an agent critique its own output actually improve the result?
- 14Search and Tree Reasoning
When is exploring multiple candidate paths better than committing to the first plausible path?
- 15Routing
How should an agent decide which capability, workflow, or model should handle a task?
- 16Parallelism
When can independent work run concurrently, and how should multiple results be recombined into one reliable outcome?
Part IV · Agents Working Together
- 17An Agent Is Just Another Tool
What changes when one agent can invoke another agent, through the same action interface used for ordinary tools? Multi-agent systems can sound like a whole new field.
- 18Supervisor and Workers
When does a coordinator improve a team of specialist agents, and when does another management layer merely add overhead and information loss?
- 19Debate and Voting
Can several agents make a better decision than one? And what happens when their errors are correlated, or when the most persuasive answer is wrong?
- 20Shared State
What happens when several agents coordinate by reading and writing the same workspace, rather than passing every message directly?
- 21Agent-to-Agent Communication
How can independently implemented agents discover capabilities, delegate work, exchange status and artifacts, and preserve trust across a system boundary?
Part V · Engineering Reliable Agents
- 22Evaluation
How do we determine whether an agentic system succeeds, why it fails, and whether a proposed architectural improvement is actually better?
- 23Observability
How do we reconstruct what an agent actually did, and attribute quality, latency, cost and failure to the steps that caused them?
- 24Failure and Recovery
How should an agent recover from failure without multiplying load, repeating side effects, losing progress, or hiding the original defect?
- 25Human-in-the-Loop
When should an agent act autonomously, when should it ask a human, and how do permissions ensure that approval actually constrains execution?
- 26Security
How do we prevent untrusted information from becoming trusted control, when agents can read external content, remember it, call tools, write state, and take actions?
- 27Budgets and Stopping
How does an agent know when to stop? Not only because it has finished, but because additional autonomy is no longer worth the cost, the time, the uncertainty, or the risk.
Part VI · Advanced Agentic Engineering
- 28Coding Agents
What changes when an agent can inspect software, modify it, execute it, observe failures, and iteratively repair its own proposed solution?
- 29Computer-Use and Multimodal Agents
What changes when an agent must perceive an interface or an image, infer what it means, ground an action in that perception, act, and then verify that the world actually changed as intended?
- 30Self-Improving Agents and the Future
When can an agent legitimately be called self-improving? And how do we prevent adaptation from silently becoming regression, reward hacking, or uncontrolled self-modification?
Download the bookRun the experiments in the Lab