Leanpub Header

Skip to main content

Agentic AI System Design

Production Scenarios Under Pressure

Agentic AI System Design
This book is 40% completeUpdated 3 Dec 2026

Every production failure starts with a fix that was not wrong, just not enough. Agentic AI System Design drops you into the incidents behind those fixes: a RAG assistant that gets worse with every document, five agents that turn Germany into Europe, a dashboard that hits a record while the bill triples. You find the structural cause, price the trade-offs, and design what holds, with the napkin math to defend it.

Minimum price

$12.99

$19.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
About

About

About the Book

Every production failure starts with a fix that was not wrong, just not enough.

In the demo, an agent looks like magic. In production, it meets flaky tools, silent drift, runaway retries, and bills that triple while the dashboard says it has never been better. So the team reaches for a fix: a retry cap, a stricter prompt, a bigger model. Each one treats the symptom while the structural flaw waits for the next Saturday night. You cannot prompt your way out of an architecture problem.

Agentic AI System Design: Production Scenarios Under Pressure is a flight simulator for that moment. Each scenario drops you into a production incident at a realistic company, with real numbers, real stakes, and a deadline. You stop and think before you read on. You ask the questions a Staff engineer would ask, dismantle the tempting fixes, trace every symptom to its structural cause, and design the architecture that holds, then find out where even that design breaks.

📖 Inside Every Scenario

  • Setup & Tipping Point: a three-panel story, the system as it stands, the evidence, and the moment it can't wait.
  • Digest & Disarm: a Pause Point to think first, the questions worth asking, and the instinctive fixes labeled honestly: wrong, or not enough.
  • The Pro Architecture: a root-cause map, numbered decisions, an architecture diagram tracing each one, and the napkin math behind them.
  • Beyond: how answers are graded at Mid, Senior, and Staff+, and curveballs that test whether the design holds.

🗺️ Six Chapters, Two Parts

Part I: The Building Blocks

  • Inference: Decoding, Structured Outputs & Serving. Why an output that reads perfectly breaks the program that receives it, and why a response is slow for reasons that have nothing to do with how hard the question was.
  • Adapting Models: Prompting, Fine-Tuning, Distillation & Alignment. Where to change a model, from the words around it to its weights, and what each change can and cannot reach.
  • Retrieval & Perception: Embeddings, Search & Vision. Why a system that finds similar things is not a system that finds the right one, and why seeing an image is not understanding it.

Part II: Agents in Production

  • Agent Architecture: Control Flow, Tools & Memory. Who decides what happens next, what each step can see, and what the system remembers.
  • Agent Security & Blast Radius. How far a plausible mistake can travel through an agent system, and what stands in its way.
  • Agent Economics & Evaluation. What a finished task really costs, how often it is really right, and how a dashboard can improve while the system gets worse.

👤 Who This Book Is For
Two readers who turn out to need the same thing:

  • Practitioners shipping LLMs and agents to production. If you already build these systems, the scenarios give you patterns for reliability, cost, evaluation, and containment, without vendor fluff or framework lock-in.
  • Engineers preparing for AI system design interviews. Interviews have moved past "design a chatbot" to "here is a system losing money and misleading customers; what do you do?" Every scenario trains what interviewers score: clarifying the problem, diagnosing before drawing boxes, pricing decisions out loud, and reasoning at the Staff+ level.

💡 Why This Book
Most system design material falls into one of two traps: classic playbooks built for deterministic services, which say nothing about probabilistic failure, or framework tutorials that break the moment inputs leave the happy path. This book trains the judgment in between.

If The Agentic AI Book taught how these systems work, this book puts them under pressure.

Instructions are behavioral. Architecture is structural.

📚 Three Ways to Read

  • Web Edition (free online): three complete scenarios.
  • Core Edition (free with your email): the full "How to Think Under Pressure" framework (the Eight Pressures, the Pressure Loop, and the Napkin Math cheat sheet), all six chapter primers, and six complete scenarios, one from every chapter.
  • Complete Edition (in progress, $12.99 today): the full book, written and released as it grows, from today's 40% to 100% in four installments, complete by February 2027. Buy now to lock in the lowest price it will ever have: every installment, and every update after that, is yours at no extra cost.

Bundle

Bundles that include this book

Author

About the Author

Dr. Ryan Rad

Dr. Ryan Rad is an AI researcher, professor, and industry advisor with over 15 years shaping how artificial intelligence is built, taught, and deployed. He holds faculty positions at Northeastern University and the University of British Columbia, where he has designed curricula and graduate programs in Machine Learning, Computer Vision, Generative AI, and Data Science—reaching thousands of students across six universities and online. His industry work spans research, engineering, and leadership at startups and tech giants including Microsoft, scaling AI solutions across 40 countries for Fortune 500 companies. A sought-after speaker with 50+ international talks and tens of top-tier peer-reviewed publications, Dr. Rad's research focuses on resource-efficient generative AI for edge deployment. He is the author of The Agentic AI Book—distilling years of building, teaching, and deploying AI into actionable insights—and shares AI perspectives on his YouTube channel.

Contents

Table of Contents

Table of Contents

 Front Matter 
  • Preface
  • How to Think Under Pressure
Part I: The Building Blocks  Chapter 1: Inference: Decoding, Structured Outputs & Serving 

Why Your Model Behaves That Way

  • 1.1 Nine Seconds to Say Allow
  • 1.2 Return ONLY Valid JSON
  • 1.3 A Bracket Costs as Much as an Algorithm
 Chapter 2: Adapting Models: Prompting, Fine-Tuning, Distillation & Alignment 

Changing What the Model Is

  • 2.1 Coming soon
  • 2.2 The $25k API Bill
  • 2.3 Coming soon
 Chapter 3: Retrieval & Perception: Embeddings, Search & Vision 

Similar Isn't Right. Seen Isn't Understood.

  • 3.1 Every New Document Makes the Answers Worse
  • 3.2 The Lamborghini Has No Dent
  • 3.3 The Same 300 Songs
Part II: Agents in Production  Chapter 4: Agent Architecture: Control Flow, Tools & Memory 

From One Call to Many Steps

  • 4.1 Germany Became Europe
  • 4.2 Coming soon
  • 4.3 Coming soon
 Chapter 5: Agent Security & Blast Radius 

How Far a Mistake Can Travel

  • 5.1 Coming soon
  • 5.2 Coming soon
  • 5.3 The Fraud Was a Maintenance Window
 Chapter 6: Agent Economics & Evaluation 

Every Step Has a Price

  • 6.1 Coming soon
  • 6.2 The Best Month on Record
  • 6.3 Coming soon
 Back Matter 
  • Further Reading

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub