Before You Start
This book is for engineers who build agents: systems where a language model calls tools in a loop until a task is done. Each chapter also ends with a short section for new grads and one for the managers who decide what an agent is allowed to do.
What an agent engineer does
The model supplies the reasoning. Everything around it is engineering: the loop that feeds tool results back, the tools themselves, the rule for when to stop, what the agent remembers, how failures are handled, and which actions need a person's approval. Most production problems with agents come from that surrounding code, which is why the job exists.
If you've built distributed systems or backend services, a lot of this will feel familiar: retries, timeouts, idempotency, tracing, rate limits. The difference is that one component in the middle makes its own decisions and doesn't always make the same one twice.
How each chapter is laid out
Chapters start with a short case about a team whose agent went wrong, and what fixed it. Then comes the reading, with the numbers worked out, and a lab: starter code you finish and run, followed by a worked solution. A running story about Ridgeline, a software company building an agent that resolves support tickets, moves forward a step each chapter.
Two short sections close each chapter. If you're starting out covers background and how the topic comes up in interviews. If you run the team is for managers, founders and PMs deciding where agents fit and how much freedom to give them. A five-question test comes last.
Running the labs
The labs use plain Python and run offline. Where a lab would call a model, it ships with a mock that replays realistic behavior, and a USE_REAL_API flag if you'd like to try a real model with the Anthropic SDK.
Quiz · Before You Start
- In an agent, what does the engineer build?
- Why can you run the labs without an API key?
- Which background carries over most directly to agent work?
- What makes agents harder than ordinary backend services?
- Who is the "If you run the team" section written for?