A short book on how to design LLM agents that actually work in production. Written for developers new to agents and engineers already shipping them.
If this book helps you build something that works — please ⭐ the repo. It's the only signal I get that the writing landed, and it's how other readers find it.
The thesis, stated up front. Writing an agent is, almost entirely, the practice of managing context. You don't get to change the model. You get to decide what enters its context, in what order, with what budget, and how its output gets folded back in. Every chapter in this book is, underneath, a chapter about that.
📕 Building_Agents.pdf — the full book, ~90 pages.
Or read it chapter by chapter in markdown:
Front matter
Part I — What Even Is an Agent?
- Chapter 1 — The Intern with a Library Card
- Chapter 2 — A Very Short History of Things That Decide Things
- Chapter 3 — The Spectrum from Script to Swarm
Part II — The Anatomy of an Agent
- Chapter 4 — The Iron Law: Context Is the Whole Job
- Chapter 5 — Picking a Brain
- Chapter 6 — The Hands: Tools
- Chapter 7 — Skills: The Cookbook on the Shelf
- Chapter 8 — The Heartbeat: Loops, Steps, Stopping
- Chapter 9 — The Working Memory
Part III — Patterns and Behaviors
Part IV — Making It Real
- Chapter 12 — Evaluating and Validating
- Chapter 13 — Observability
- Chapter 14 — Safety, Permissions, Reversibility
Part V — The Wider World
Back matter
- Appendix A — A Glossary You Won't Be Embarrassed to Use
- Appendix B — A Reading List, Without the Hype
- Appendix C — A Checklist for Shipping Your First Agent
The full outline lives in TABLE_OF_CONTENTS.md.
It is a thinking book — analogy-driven, code-light, vendor-neutral. Each chapter opens with an analogy, includes a recurring "What this costs you" sidebar (tokens, latency, 3am pages, cache hits), ends with a short "Mistakes I have made" list, and closes on the same chime: this was a chapter about context.
It is not a framework tutorial, a hype piece, or a philosophy book. It tries to give the durable picture — the stuff that will still be true when the model you're using today is a footnote.
python3 -m venv .venv
.venv/bin/pip install markdown-pdf
.venv/bin/python build_pdf.pyThis writes a fresh Building_Agents.pdf from the chapter markdown.
The source markdown is released under CC BY 4.0. Use it, fork it, quote it, teach from it — attribution appreciated.
Two small things would mean a lot:
- ⭐ Star the repo — it tells me the writing was worth it, and helps other people stumble onto the book.
- 🐛 Open an issue if you find a mistake, a stale claim, or a chapter that didn't land. The book is meant to age well, and corrections from readers are how it stays useful.
If you ship an agent after reading this — I'd genuinely love to hear what worked, what didn't, and which chapter you'd rewrite. Find me on the repo's discussions.
Thanks for reading.