Agents: From Theory to Production

Foundations of Intelligent Agents and the Craft of Building Modern LLM Agents

A practical, research-grounded guide that connects the classical theory of intelligent agents to the modern practice of building autonomous LLM agents with tools, memory, planning, and multi-agent orchestration.

Author

bkhatri

Published

July 2026

Preface

Why this book

The word agent is doing a lot of work these days. To a researcher trained in classical AI, an agent is anything that perceives its environment through sensors and acts upon it through actuators to pursue a goal [1]. To a developer in 2026, an “agent” is more likely a large language model wired to a set of tools, running in a loop until a task is done. Both are right. This book argues that you cannot build the second well without understanding the first.

Most material on AI agents falls into one of two camps. Academic texts give you the theory of rational agents, environments, and architectures but stop short of today’s LLM-driven systems. Industry blog posts and framework tutorials show you how to call an API but rarely explain why a design succeeds or fails. This book deliberately bridges the gap: it treats modern LLM agents as the latest chapter in a long story about building systems that sense, reason, and act.

What you’ll learn

By the end, you will be able to:

  • Explain what an agent is, how it differs from a fixed workflow, and where each belongs [2].
  • Reason about environments, rationality, and architectures using the classical vocabulary — and see how LLMs fit that frame.
  • Build agents that use tools, retrieve knowledge, remember, plan, and self-correct.
  • Orchestrate single- and multi-agent systems with LangGraph and the OpenAI Agents SDK [3], [4].
  • Evaluate, observe, secure, and deploy agents responsibly in production [5].

Who this book is for

The book serves a mixed audience. Developers get runnable Python examples and production patterns. Technical leaders and product managers get mental models and honest trade-offs. Students and the curious get the foundational theory explained from first principles. Chapters open with intuition, add just enough formalism, then show working code — so you can read at the depth you need.

How to read it

  • Part I builds the theoretical foundation of agency.
  • Part II reframes the LLM as an agent and introduces the core building blocks and reasoning strategies.
  • Part III is hands-on: choosing between workflows and agents, agentic patterns, tools, memory, orchestration, and multi-agent systems.
  • Part IV covers what it takes to run agents in production — evaluation, observability, safety, and cost.
  • Part V looks at the frontier and the open problems.

If you are impatient to build, skim Part I, then start at Part II. If you want the “why” before the “how,” read straight through.

Conventions

  • 🧠 Deep dive boxes add optional theory.
  • 🛠️ In practice boxes add production tips and gotchas.
  • Code is Python, uses the OpenAI, LangChain/LangGraph, and Agents SDK libraries, and is runnable after following Appendix A.

A note on a fast-moving field

Agent tooling changes monthly. Where possible the book teaches durable principles and marks provider-specific guidance clearly. See PLAN.md in the source repository for the living roadmap and the last-reviewed date of each chapter.