Leanpub Header

Skip to main content

AI Engineering Visualized: Volumes 1 & 2

From one prompt to an agent you can trust with real tickets. One project across two visual books: Foundations, then Agents.

Bought separately

$59.98

Minimum price

$34.99

$49.99

You pay

Author earns

$

Also available for 2 book credits with a Reader Membership

These books have a total suggested price of $59.98. Get them now for only $34.99!
About

About

About the Bundle

Start with one prompt. Finish with an agent you'd trust on real tickets.

AI Engineering Visualized: Volumes 1 & 2 follows one project from beginning to end: a support assistant for Northwind Goods, a fictional online store. Volume 1 builds it. Volume 2 makes it an agent you could trust with real tickets. Get both and you never have to restart with a new example, a new codebase or a new set of terms.

Volume 1: Foundations (24 chapters, 200+ hand-drawn doodles)

A Visual Guide to Building LLM Apps, RAG and Agents

A single prompt answering "Can I get a refund for order #1234?" grows into a working system that:

  • decides refunds with rules in code the model can't argue away
  • counts its tokens and checks its own output against a contract
  • calls tools, searches a handbook and answers with citations
  • says "I don't know" when the pages don't cover the question
  • measures itself with evals before every change
  • runs an agent loop with step limits, permissions and human approval
  • retries failed calls, masks personal data and logs every request for replay

Five parts take you there: The First Call, Making It Dependable, Giving It Knowledge, Giving It Hands, and Ship It.

Volume 2: Agents (17 chapters, 100+ hand-drawn doodles)

A Visual Guide to Designing Agents That Plan, Act and Recover

Volume 2 picks up the same assistant and builds the agent harness around the model: the loop, the tool registry, the checks, the state store, the approvals, the memory and the limits. The model is a part you can swap. The harness is what you test, version and ship. You get:

  • tools with schemas, validation and a limited blast radius
  • plans that are checked before they run and repaired when a step fails
  • verification before anything is committed
  • a state machine with checkpoints, so a ticket can resume, and a recorded reason for every stop
  • side effects with idempotency keys and receipts, so a refund is never paid twice
  • tickets that wait on a courier and can be cancelled safely
  • approvals bound to the exact action, so a changed amount needs a fresh sign-off
  • memory you can correct, and context that keeps what each step needs
  • agentic RAG, where retrieval is a tool the agent chooses, and checks that the evidence is enough
  • MCP hosts, clients and servers, so you can plug in tools you didn't write
  • tool trust: credentials, allow-lists and output you never trust blindly
  • multi-agent systems, added only when the measurement says so
  • failure engineering for loops, cascades and side effects
  • agent evaluation that grades outcomes and trajectories
  • reliability with repeat runs, scorecards and gates

How the books teach

Every idea is a named mental model drawn as a doodle, such as The Context Suitcase, The Citation Gate, The Agent Harness or One Operation, One Receipt. Each one comes with a plain definition, a failure you can trigger and the fix.

Every chapter has short Python examples from the free companion repository (MIT licence, Python standard library only). They run on a scripted stand-in model, so they cost nothing to try. Volume 2 also reports what happened when the same code ran against a real local model (llama3.2 through Ollama), including the bugs those runs exposed and how the harness was changed to catch them.

Who it's for

Backend and full-stack developers, data engineers who've been asked to "add AI", and technical founders who need LLM features that hold up after the demo. You need to read Python. You don't need a machine learning background.

Why the bundle

  • One project, start to finish. Volume 2 starts where Volume 1 ends, with the same assistant, the same code and the same terms.
  • Less than buying them separately.
  • Free updates for both books. Both are in early access. All 24 chapters of Volume 1 are in, and its explainer videos are still to come. All 17 chapters of Volume 2 are written, with final polish still landing. You buy once and get every new video and revision of both books free as it lands.

Books

About the Books

AI Engineering Visualized, Volume 1: Foundations

AI Engineering Visualized, Volume 1: Foundations

A Visual Guide to Building LLM Apps, RAG and Agents

You got the demo working. Now it has to work on Monday. AI Engineering Visualized is for developers who have to ship features that call a language model. A model is one box; a product is the whole diagram around it. This book draws that diagram, box by box, as hand-drawn doodles you can remember and reuse when you design or debug. Every idea is a named mental model, such as The Context Suitcase, The Citation Gate, The Golden Set or The Trojan Ticket, with a picture, a plain definition, a failure you can trigger and the fix. One assistant, built chapter by chapter. You build a support assistant for Northwind Goods, a fictional online store. It starts as one prompt answering "Can I get a refund for order #1234?" and grows into a system that:

  • decides refunds with rules in code the model cannot argue away
  • counts its tokens and checks its own output against a contract
  • calls tools, then searches a handbook and answers with citations
  • says "I don't know" when the pages don't cover the question
  • measures itself with evals before every change
  • runs an agent loop with step limits, permissions and human approval
  • retries failed calls, masks personal data and logs every request for replay

Real code, no API key. Every chapter has short Python examples from the free companion repository (MIT licence, Python standard library only) and an exercise with a tested solution. The examples run on a scripted stand-in model, so they cost nothing; swap in your provider with one function when you are ready. Who it's for: backend and full-stack developers, data engineers asked to "add AI", and technical founders. You need to read Python. You do not need a machine learning background. Who it's not for: readers who want to train models from scratch, or a catalogue of today's model prices and rankings. Prices and model names change too fast; the book shows you how to measure instead. Complete edition: all 24 chapters. All 24 chapters of Volume 1 are in this edition, fully illustrated.

AI Engineering Visualized, Volume 2: Agents

AI Engineering Visualized, Volume 2: Agents

A Visual Guide to Designing Agents That Plan, Act and Recover

Your agent worked in the demo. Then it refunded the wrong order, waited forever on a courier, or told a customer "your refund has been processed" when no payment ever went through.

AI Engineering Visualized, Volume 2: Agents is about everything around the model that turns its proposals into safe, finished work. The book calls that the agent harness: the loop, the tool registry, the checks, the state store, the approvals, the memory and the limits. The model is a part you can swap. The harness is what you test, version and ship.

One assistant, carried forward. Volume 1 ended with a support assistant for Northwind Goods, a fictional online store. Volume 2 picks it up and makes it an agent you could trust with real tickets: refunds, damaged items, late deliveries, address changes. Each chapter builds one part of the harness, shows a failure you can trigger, and fixes it.

Visual first. Every idea is a named mental model, such as The Agent Harness, The Identity Chain, Blast Radius, One Operation, One Receipt, The Waiting Ticket or Every Stop Has a Reason, drawn as a doodle with a plain definition next to it.

Real code. Each chapter has short Python examples ("Hands on Keys") and runs on a scripted stand-in model by default, so it costs nothing. Chapters also report what happened when the same code ran against a real local model (llama3.2 through Ollama), including the bugs those runs exposed and how the harness was changed to catch them.

Chapters 1-3 are in the free sample.

Who it's for

Developers who have a working LLM feature or a basic agent loop and now need it to behave on real tasks: backend and full-stack engineers, data engineers, and technical founders. You need to read Python. It helps to have read Volume 1 (especially its agent chapters), but the ideas it relies on are recapped where they are used.

Early access

This book is in early access: all 17 chapters are written, with final polish still landing. Buy once and get every revision free.

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