Kick off your book project in 3 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Saturday, June 6, 2026. Learn more…

Leanpub Header

Skip to main content

Agentic Engineering

From Execution to Orchestration

This book is 100% completeLast updated on 2026-05-03

You have been using AI as a faster keyboard.

The engineers who will define the next decade are using it as a cognitive workforce they direct, constrain, and govern. The gap between those two practices is not a matter of better prompts. It is a matter of an entirely different mental model.

This book is that mental model. Built from first principles. Illustrated through 28 chapters of real architectural decisions, real failures, and real production systems.

From execution to orchestration. The complete practitioner guide.

Minimum price

$24.00

$48.00

You pay

Author earns

$
PDF
EPUB
About

About

About the Book

Software engineering is undergoing a fundamental shift. For three decades, the value of a developer was measured in syntax produced — the elegance of their algorithms, the speed of their implementations, the volume of their commits. That measure is being superseded.

Large language models can now generate syntactically correct, architecturally plausible code in seconds. The mechanical translation layer — converting human intent into machine-readable syntax — has been commoditised. The bottleneck has moved permanently upstream, to the definition of intent itself.

Agentic Engineering: From Execution to Orchestration is the complete practitioner guide to operating at the new frontier.

What this book teaches

This is not a book about using AI tools faster. It is a book about thinking differently about what the work is.

Over 24 Hours across 28 chapters, you will build the complete operational stack of the Agentic Engineer — the professional who directs intelligence rather than generates syntax:

  • The ROCC Protocol — a four-element framework that transforms a chat prompt into a precise engineering specification
  • Test-Driven Generation (TDG) — writing the contract before the code, so AI-generated implementations are verified rather than trusted
  • The Reflection Loop — a multi-model review cycle that catches memory leaks, race conditions, and lifecycle errors before they reach production
  • Skeletonisation — compressing legacy codebases into architectural maps that make AI reasoning precise rather than diluted
  • Contract-Bound Refactoring — liquidating technical debt safely using characterisation cages and constrained prompts
  • The Hypothesis Matrix — replacing guess-and-check debugging with a multi-hypothesis investigation that proves root causes before applying fixes
  • The Intentional Repo — structuring your codebase as a machine-readable environment that autonomous agents can navigate deterministically
  • Autonomous State Machines — connecting specialised agents into pipelines that execute without your manual intervention
  • Prompts as Code — version-controlled, schema-validated prompt registries that survive model updates
  • Durable Orchestration — decoupling AI latency from HTTP timeouts using job queues and polling architectures
  • Dual-Tier Memory — replacing stateless RAG with an episodic working memory that makes agents coherent across a conversation
  • Cognitive Tracing — distributed observability that captures what the model saw and what it decided, not just whether the function ran
  • Total Cost of Intelligence (TCI) — semantic routing, context compression, and caching that make production AI financially sustainable
  • The Ideality Equation — measuring and communicating the financial value of cognitive infrastructure in language the boardroom funds
  • Cognitive Swarms — replacing human ticket assignment with webhook-driven agent pipelines that escalate exceptions to humans
  • Self-Healing CI/CD — making the pipeline an active engineering participant that diagnoses and patches its own failures
  • Model Agnosticism — a Universal LLM Gateway that makes your architecture immune to vendor outages and model deprecations
  • Governance-as-Code — transitioning from building software to governing the autonomous enterprise that builds software

The KAIROS thread

Every concept is illustrated through a single, continuous engineering narrative: Jay, a senior architect, building KAIROS — a production-grade multi-agent knowledge system — from a string-matching script in Chapter 1 to an autonomous enterprise governance framework in Chapter 28.

Jay's failures are as instructive as his successes. The 600-line PR diff that resulted from an unconstrained prompt. The confident hallucination that sent the wrong AWS CLI command to production. The $450 API bill that arrived because a greeting was routed through a frontier reasoning model. The 504 Gateway Timeout that killed a 75-second cognitive pipeline 15 seconds before it completed.

Each failure is the setup for a precise architectural solution. By the end of the book, KAIROS executes an 8-month architectural migration in under 19 hours for $342.18 in API costs, with one human action: the final merge approval.

Who this book is for

This book is written for practitioners who already know how to build software and are ready to change how they think about what building software means.

Specifically: senior software engineers who find themselves spending increasing time prompting AI tools and decreasing time writing syntax, and who want a disciplined framework for doing that deliberately. Architects and tech leads who need to govern AI-assisted delivery across a team and need the vocabulary to do it. Engineering leaders who need to articulate the financial value of agentic infrastructure to organisational stakeholders.

This is not a beginner's guide to AI tools. It does not explain what a large language model is. It does not cover the basics of prompt engineering. It starts where most AI books stop.

What you will have when you finish

Not just knowledge. A complete operational toolkit:

A personal AI stack with explicit model roles and task boundaries. A ROCC-structured prompt library. A context compression script for legacy system navigation. A characterisation testing workflow for safe refactoring. A Hypothesis Matrix debugging protocol. A CONTEXT.md anchor system for machine-readable repositories. A working Evaluator-Optimiser pipeline in Python. A version-controlled prompt registry with Pydantic output schemas. A durable job queue architecture for async AI execution. A Dual-Tier Memory implementation. A cognitive trace decorator. A Semantic Router with TCI telemetry. A Universal LLM Gateway with cascading fallback. A governance directive template for autonomous task execution.

The engineers who build these systems will define the next decade of software delivery. This book is the manual.

A note on the technology

The frameworks, patterns, and architectural principles in this book are designed to outlast the specific models and API formats used to illustrate them. KAIROS is built using Python, FastAPI, pgvector, Celery, Redis, and the APIs of Anthropic, OpenAI, and Google — but the architectural decisions it embodies apply regardless of which providers are current when you read this.

The Post-Syntax Era is not a prediction. It is a present condition. This book is your operating manual for it.

28 Chapters · 4 Parts · 24 Hours · One complete system

Author

About the Author

Narayanan Jayaratchagan

Narayanan Jayaratchagan is a seasoned technology leader whose expertise rests on a solid academic foundation. He earned a bachelor’s degree in mathematics—graduating with a silver medal—and a master’s in computer applications from Bharathidasan University, India. Over a career spanning more than three decades, Narayanan has written software in virtually every paradigm—structured, functional and object‑oriented—using languages as varied as Java, C#, Scala, JavaScript and Python. This polyglot experience enables him to distill universal design principles that transcend any single ecosystem.

Driven by intellectual curiosity, he has immersed himself in the classic literature of software engineering and the contributions of its pioneers. He routinely studies mature systems such as the Java Development Kit and other open‑source projects to uncover the architectural patterns and design practices that make them resilient and elegant. For more than twenty years he has led digital‑transformation initiatives and cloud‑native application development across industries, building solutions that leverage multi‑cloud environments with ease.

A thought leader at heart, Narayanan shares his insights through his blog and public talks, engaging the community in discussions on software design, development best practices and digital innovation. His passion for elegant code and clear architecture is matched only by his commitment to mentoring the next generation of developers.

Contents

Table of Contents

Table of Contents

Part 0 – The Wakeup Call: The Pyramid Is Cracking

  • 01 – AI Writes the Code. Now What Is Your Job?
  • 02 – The Myth of "Using AI"
  • 03 – From Developer to Agentic Engineer
  • 04 – From Coding to Outcomes: How to Use This Book

Part 1 – Foundations: The Thinking Shift

  • 05 – Hour 01: Your First Agent
  • 06 – Hour 02: Thinking Before Prompting
  • 07 – Hour 03: Context Is Leverage
  • 08 – Hour 04: Constraints Are Power

Part 2 – The Craft: The Reality of the IDE

  • 09 – Hour 05: Test-Driven Generation – The Death of Implementation
  • 10 – Hour 06: The Reflection Loop – The Friction of Intelligence
  • 11 – Hour 07: Navigating Legacy Systems – The Map and the Territory
  • 12 – Hour 08: The Dark Art of Agentic Refactoring
  • 13 – Hour 09: Agentic Debugging
  • 14 – Hour 10: Structuring for Machine Readability – The Intentional Repo
  • 15 – Hour 11: Autonomous Workflows – Connecting the Agents
  • 16 – Hour 12: Prompts as Code – The Orchestrator's Checklists

Part 3 – The System: Scaling Cognitive Labor

  • 17 – Hour 13: Durable Orchestration – The End of the HTTP Request
  • 18 – Hour 14: Memory and State – The Vector Boundary
  • 19 – Hour 15: Observability and Distributed Tracing
  • 20 – Hour 16: The Total Cost of Intelligence (TCI)
  • 21 – Hour 17: Write-Access and Ephemeral Sandboxing
  • 22 – Hour 18: The Prompt Injection Epidemic – Cognitive Hacking
  • 23 – Hour 19: Evaluation-Driven Development – The Benchmark
  • 24 – Hour 20: The Ideality Equation and ROI

Part 4 – The Horizon: From Agentic Engineer to AI-Native Organization

  • 25 – Hour 21: The AI-Native Team
  • 26 – Hour 22: The Self-Healing Pipeline (Agentic CI/CD)
  • 27 – Hour 23: Model Agnosticism – The Polyglot Agent
  • 28 – Hour 24: The Autonomous Enterprise

Closing Sections

  • The 25th Hour
  • Appendix: The KAIROS Architecture – A Case Study in Agentic Evolution
  • About the Author

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.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

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.)

In fact, authors have earned over $15 million writing, publishing and selling 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