Leanpub Header

Skip to main content

AI Engineering Visualized, Volume 2: Agents

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

AI Engineering Visualized, Volume 2: Agents
This book is 100% completeLast updated on 2026-11-11

Agents that plan, act and recover: the harness around the model. Tools, plans, checks, state, approvals and memory, drawn and built in Python.

Minimum price

$19.99

$29.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

Buying multiple copies for your team? See below for a discount!

PDF
EPUB
About

About

About the Book

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.

Complete

All 17 chapters are written, and each chapter's explainer video is live. Buy once and get every future revision free.

Part of the AI Engineering Visualized series: Volume 1: Foundations, Volume 2: Agents, Volume 3: RAG & Knowledge Systems and Volume 4: Production AI. Get all four in the Volumes 1–4 bundle.

Team Discounts

Team Discounts

Get a team discount on this book!

  • Up to 3 members

    Minimum price
    $37.00
    Suggested price
    $60.00
  • Up to 5 members

    Minimum price
    $59.00
    Suggested price
    $96.00
  • Up to 10 members

    Minimum price
    $104
    Suggested price
    $168
  • Up to 15 members

    Minimum price
    $149
    Suggested price
    $240
  • Up to 25 members

    Minimum price
    $224
    Suggested price
    $360

Bundle

Bundles that include this book

Author

About the Author

Prateek Singh

Prateek Singh is the solo technical founder of Ganak AI Labs (https://ganak.ai), an Indian AI SaaS startup that also runs AI workshops for builders. Its product, Cloudeval AI (https://cloudeval.ai), runs pre-deployment reviews for Azure, plus AWS CloudFormation (beta), with evidence-backed reports, through the web, a CLI, GitHub and MCP. Before AI, Prateek worked as an infrastructure and cloud developer and was an active PowerShell community writer. Books and courses

Find me

Contents

Table of Contents

  • 1. The Agent Harness
  • 2. Tool Engineering
  • 3. Planning
  • 4. Verification Before Commit
  • 5. State Machines, Checkpoints and Stop Reasons
  • 6. Side Effects
  • 7. Long-Running Tickets
  • 8. Human Oversight
  • 9. Agent Memory
  • 10. Context Engineering
  • 11. Agentic RAG
  • 12. MCP: Hosts, Clients, Servers and Discovery
  • 13. Tool Trust
  • 14. Multi-Agent Systems
  • 15. Agent Failure Engineering
  • 16. Agent Evaluation
  • 17. Agent Reliability
  • Plus: Further Reading, Appendix: Capstone, One Ticket Through Every Boundary

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

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