CONTENTS
PREFACE

Start here

3 MIN READ

In June 2024 six practitioners (Eugene Yan, Bryan Bischof, Charles Frye, Hamel Husain, Jason Liu and Shreya Shankar) published a long essay called What We Learned from a Year of Building with LLMs. One line from it is the reason this book exists:

The model isn't the product, the system around it is.

Calling a model is easy. You send text, you get text back. The hard part, and the part that decides whether your product works, is everything around that call: which text you send, where it comes from, what the model is allowed to do with its answer, how you know the answer was good, how much it cost, how long it took, and what happens when someone tries to trick it. That surrounding machinery is what this book calls AI system design.

Who this is for

You're a software engineer. You've built web or mobile apps, you know what an API, a database, a cache and a queue are, and you've probably called an LLM API and maybe built a small RAG demo or a toy agent. You may have read this library's earlier book, From Pixels to Agents, which covers how LLMs work and the basic toolkit.

This book picks up where that one stops. It assumes you know what the parts are and teaches you how to put them together: how to reason about the trade-offs, which designs fail and why, and how the best people in the field think about it. It goes deep on the underlying ideas (why decode is slow, why long contexts degrade, why prompt injection can't be filtered away) because those ideas transfer to every tool you'll ever use.

Your teachers

You asked to learn from the people who know this best. This book is built on their work, and each chapter names whose ideas it's teaching so you can go to the source. The core faculty:

Person Known for Start with
Chip Huyen The end-to-end architecture of AI applications AI Engineering (O'Reilly, 2025); "Building A Generative AI Platform" (2024)
Eugene Yan Patterns for LLM products, evals, recommendation systems "Patterns for Building LLM-based Systems & Products" (2023)
Hamel Husain & Shreya Shankar Evals and error analysis "Your AI Product Needs Evals" (2024); their evals FAQ and course
Jason Liu Retrieval done systematically; structured outputs (Instructor) "The RAG Playbook" (2024)
Erik Schluntz & Barry Zhang (Anthropic) Workflows versus agents "Building effective agents" (2024)
Simon Willison Prompt injection and agent security "The lethal trifecta for AI agents" (2025)
Lilian Weng Surveys of agents, memory, hallucination "LLM Powered Autonomous Agents" (2023)
Lance Martin, Drew Breunig, Yichao "Peak" Ji Context engineering "Context Engineering for Agents", "How Long Contexts Fail", the Manus context engineering post (all 2025)
Dex Horthy Agents as ordinary software "12-Factor Agents"
Walden Yan (Cognition) The case against naive multi-agent designs "Don't Build Multi-Agents" (2025)
D. Sculley, Martin Zinkevich The classic ML engineering lessons that still apply "Hidden Technical Debt in Machine Learning Systems" (2015); "Rules of Machine Learning"

Appendix A gives a reading order for all of them. Where they disagree (and on multi-agent systems they do, loudly) this book shows both sides and tells you which way the evidence leans.

How the book is laid out

Part I (Chapters 1–3) builds the foundation: why AI systems need their own design discipline, a method for approaching any design problem, and a working model of inference, the physical machine every design decision eventually hits.

Part II (Chapters 4–8) covers the building blocks in the order you'd add them to a real system: context, retrieval, structured outputs and tools, workflows and agents, then multi-agent and long-running systems.

Part III (Chapters 9–12) covers what makes a system production-grade: evals, observability, security, and cost, latency and reliability.

Chapter 13 puts everything together in three full design walkthroughs.

Every chapter ends with key takeaways and exercises. Do the exercises. System design is a skill you build by designing, not by reading.

A note on numbers

This field moves fast. Where the book quotes a number (a benchmark result, a price, a speedup) it says where the number came from and when. Prices especially change every few months; treat them as illustrations of the shape of a trade-off, and check the provider's current docs before you put one in a spreadsheet.