# Micheal Lanham - AI Agents in Action, Second Edition (Highlights)

## Metadata
**Review**:: [readwise.io](https://readwise.io/bookreview/61622487)
**Source**:: #from/readwise #from/manning
**Zettel**:: #zettel/fleeting
**Status**:: #x
**Authors**:: [[Micheal Lanham]]
**Full Title**:: AI Agents in Action, Second Edition
**Category**:: #books #readwise/books
**Category Icon**:: 📚
**Document Tags**:: #from/manning
**Highlighted**:: [[2026-06-25]]
**Created**:: [[2026-07-04]]
## Highlights
### 2 Core components: Large language models, prompting, and agents
- Tools are overhead. The JSON description of every tool you register with an agent gets sent on every LLM call, and as we saw with JSON tokenization in section 2.1.2, that structure is not free. Each tool description adds input tokens, and those tokens are paid on every call regardless of whether the tool is used. For agents who make many calls per task, the cost adds up. ([View Highlight](https://livebook.manning.com/book/ai-agents-in-action-second-edition/chapter-2/ce52692400eb7cc28ee280423fd6a979)) ^1028637560
### 3 Actions with Model Context Protocol for AI agents
- In this book, we generally focus on using tools from MCP servers. The OpenAI Agents SDK currently doesn’t support resources and prompts, which is acceptable because tools can take on their role. ([View Highlight](https://livebook.manning.com/book/ai-agents-in-action-second-edition/chapter-3/e3f82c3d2135343b67b117086c445e0b)) ^1028637562
### 4 Architecting and building multi-agent systems
- The iterative debate pattern is the most consequential multi-agent pattern in production agent systems, and it is worth slowing down on. Two or more agents work toward a high-quality output through repeated rounds of proposal, critique, and revision. The agents converge on a well-vetted solution rather than committing to the first plausible answer. ([View Highlight](https://livebook.manning.com/book/ai-agents-in-action-second-edition/chapter-4/d4a2eca52c0e4cd03df64b45d182abf8)) ^1028637564
- The handoff pattern transfers control from one agent to another internally without the need to code the transition as we did earlier. ([View Highlight](https://livebook.manning.com/book/ai-agents-in-action-second-edition/chapter-4/49a899238f85a7fac8796208ca41ebb6)) ^1028637565
- A guardrail is a semantic circuit breaker that halts execution before a risky action is committed, which is a meaningfully different design pattern from filtering output after the fact. ([View Highlight](https://livebook.manning.com/book/ai-agents-in-action-second-edition/chapter-4/ad9ebc51643f08128282dafe3d63e2b7)) ^1028637566
- The cost is real and worth naming. LLM-based guardrails run an additional model call (or several) per agent step, which adds latency and tokens to every interaction the guardrail covers. For high-volume agent systems, the guardrail layer can rival or exceed the cost of the agent itself. ([View Highlight](https://livebook.manning.com/book/ai-agents-in-action-second-edition/chapter-4/7f6b22916969cbd475bf8c5f7770b245)) ^1028637567
- A practical defense-in-depth posture combines the layers. Deterministic checks run first and cheaply, classifier models catch structured risks, and LLM guardrails handle the semantic cases that the cheaper layers cannot. ([View Highlight](https://livebook.manning.com/book/ai-agents-in-action-second-edition/chapter-4/71abb135ff3232bbfdced8a6803b53ce)) ^1028637568
### 5 Agent reasoning and planning
- While CoT keeps the reasoning entirely internal, the ReAct paradigm alternates between reasoning and taking actions in an interactive loop. The model interleaves thought steps (natural-language reasoning about what to do) with action steps (commands to use an external tool or to query an API). After each action, the model observes the result, updates its reasoning based on that feedback, and continues the cycle. ([View Highlight](https://livebook.manning.com/book/ai-agents-in-action-second-edition/chapter-5/88b74117c77f56dd50b2dd2f249fd11b)) ^1028637570
- Reflexion is a self-critique pattern in which the agent evaluates its own output, generates feedback on what went wrong, and tries again, incorporating that feedback into its context (figure 5.5). ([View Highlight](https://livebook.manning.com/book/ai-agents-in-action-second-edition/chapter-5/c30bacad4da8543ccc9f2091b051a15e)) ^1028637571