"Great contents, broad coverage, fun exercises. This book has it all.” —Saurabh Sawant, Microsoft AI Agents in Action, Second Edition is a substantial revision and update of the first edition. It is a practical and comprehensive guide to building AI agents—not just understanding what they are, but designing, implementing, evaluating, and deploying them. Its strength is in the way it combines conceptual clarity with working code examples, so readers build progressively rather than absorb isolated ideas. The examples form a continuous learning path, moving from a minimal agent to more capable, tool-using, multi-agent, and deployable systems. Each step adds a new skill while reinforcing what came before. The book begins by giving readers a usable mental model for agent design. Its central organizing idea is the five functional layers: persona, actions and tools, reasoning and planning, knowledge and memory
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A hands-on, code-first guide to designing, building, evaluating, and deploying AI agents—from minimal assistants to multi-agent systems—using LLMs, MCP, and modern orchestration patterns. Ideal for developers with basic Python skills who want to move beyond chatbots into production-grade agentic workflows.
【Book Arc】
- **Opening (~0%–9%)**: Introduces the core mental model of agent design through the five functional layers (persona, tools/actions, reasoning/planning, knowledge/memory, evaluation/feedback). Establishes the difference between assistants, agents, and LLM patterns, and frames agentic thinking as sense-plan-act-learn. Early chapters also cover LLM fundamentals (tokens, temperature, prompting) and the first minimal agent built with OpenAI Agents.
- **Early (~9%–25%)**: Dives into the Model Context Protocol (MCP) as the standardization layer for tools, resources, and prompts. Shows how to build and consume MCP servers over STDIO and SSE, then moves to multi-agent architectures—covering control patterns, handoffs, agent flows, and guardrails. Reasoning and planning techniques (chain-of-thought, ReAct, tree-of-thought, Reflexion) and RAG-based memory/knowledge systems are introduced here.
- **Middle (~25%–47%)**: Shifts from concepts to engineering practice. Covers test-driven agent development (TDAD), evaluation and feedback loops, and deployment strategies—embedding agents in apps, exposing them as microservices, and Dockerizing for production. Security, safety, governance, and reliability patterns (timeouts, fallbacks, cost control) are addressed. The agentic loop is unpacked into three layers (inner SPAL loop, task loop, meta loop) and applied to building a deep research agent.
- **Late (~47%–end)**: Explores advanced cognition and metacognition as engineering concepts—mapping cognitive science into a concrete agent architecture with modules for perception, planning, execution, evaluation, attention, and memory. Includes confidence-gated execution, stagnation detection, and knowledge boundary awareness. The book closes with field-tested tips organized by the five layers and role-specific blueprints for customer support, RAG, and deep research agents.
【Key Takeaways】
- **The five functional layers are the organizing backbone** (Early): persona, tools/actions, reasoning/planning, knowledge/memory, and evaluation/feedback. Every chapter maps back to these layers, giving readers a reusable framework for designing any agent system.
- **MCP is the standardization layer that makes agents composable** (Early): By separating tools, resources, and prompts into client-server architecture, MCP solves the fragmentation problem and lets agents connect to local or remote capabilities over STDIO or SSE. This is the protocol-level foundation for modern agent workflows.
- **Reasoning patterns are a spectrum, not a single technique** (Early): Chain-of-thought, ReAct, tree-of-thought, and Reflexion each suit different tasks. Knowing when to apply which pattern—and using the sequential thinking MCP server for complex problems—is a core skill for agent developers.
- **Multi-agent systems need explicit orchestration and guardrails** (Early): Handoffs, agent flows, and hub-and-spoke orchestrations are the building blocks. Input/output guardrails and agent-as-guardrail patterns are essential for validating behavior in pass-off flows.
- **Test-driven agent development (TDAD) is a practical discipline** (Middle): Treating agent behavior as testable units—with grounding and critic agents providing evaluation layers—makes agents more reliable. Tools like Phoenix enable comprehensive feedback loops.
- **Production agents require deployment and security thinking** (Middle): Dockerizing agents, exposing them as microservices, and embedding them in applications are covered alongside threat modeling, identity/access control, secrets management, sandboxing, and prompt-injection defenses.
- **The agentic loop has three layers that scale from simple to complex** (Middle): The inner sense-plan-act-learn loop, the external task loop, and the meta loop. Building a deep research agent demonstrates how to structure iteration, termination gates, and synthesis in practice.
- **Cognition and metacognition are engineering concepts, not just theory** (Late): Mapping cognitive science into modules (perception, planning, execution, evaluation, attention, memory) enables agents to monitor their own performance, detect stagnation, and pivot strategies—moving beyond fixed reasoning primitives.
【Reading Tips】
- **Skim the LLM fundamentals if you're experienced** (~6%–9%): Chapters on tokens, temperature, and basic prompting are refreshers. Focus instead on the minimal agent build and tool integration, which establish the code patterns used throughout.
- **Deep-read the MCP and multi-agent chapters** (~9%–16%): These are the conceptual core of the second edition. Work through the MCP server examples hands-on—they're foundational for everything later, including memory and deployment.
- **Treat the agentic loop chapter as a capstone exercise** (~44%–47%): The deep research agent walkthrough ties together tools, reasoning, memory, and evaluation. If you only build one thing, build this—it exercises nearly every layer.
- **Use the final tips chapter as a reference, not a read** (~end): Chapter 11 organizes field-tested advice by the five layers and gives role-specific blueprints. Return to it when you're designing your own customer support, RAG, or research agent.
- **Watch for the low-code approach**: Many examples use AI-assisted code generation. Don't skip writing the code yourself—the value is in the iterative building process, not just reading the listings.
【Coverage Limits】
Excerpts do not cover specific code listings, exercise solutions, or detailed walkthroughs of individual chapters beyond the table of contents and chapter summaries. The guide focuses on the book's structure, core concepts, and progression rather than step-by-step implementation details.
running the cognitive agent 10.3.1 The cognitive loop 10.3.2 A complete cognitive agent with MCP 10.3.3 Walkthrough: Watching the cognitive cycle in action 1...
ouldn’t have asked for a better content editor than Frances. Many thanks go to Nicolai Nielsen, my technical editor, for his invaluable assistance. Nicolai i...
sted by me or by other organizations in GitHub repositories. Throughout this book, I strive to make the content as accessible as possible, taking a low-code...
transform ideas into action in ways once thought impossible. Let’s start by clarifying what we mean by agents in this context and what AI agents bring to AI....
n to the tool level, so each task involves executing a tool. Tools may be designed for specific tasks, such as creating images, or for more general uses, suc...
build and maintain one that wraps the underlying capability. But that work happens once per integration rather than once per agent, and the resulting server...
fundamental to the functions used in the upper agent layers. Tools & actions can be categorized into task completion, context retrieval, reasoning and planni...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
AI Agents in Action, Second Edition Intelligent workflows with LLMs, MCP, A2A, and more (Micheal Lanham)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
AI Agents in Action, Second Edition Intelligent workflows with LLMs, MCP, A2A, and more (Micheal Lanham)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment