What you will learn in AI Agents in Action, Second Edition
Intelligent workflows with LLMs, MCP, A2A, and more
Chapter by chapter
Chapter 1: The rise of AI agents
The introduction distinguishes response-generating LLM apps from AI agents that can decide and act toward goals.
What you learn in chapter 1 →Chapter 2: Core components: Large language models, prompting, and agents
The chapter introduction identifies the roles of the LLM, prompting, and OpenAI Agents SDK in an agent’s core architecture.
What you learn in chapter 2 →Chapter 3: Actions with Model Context Protocol for AI agents
The introduction presents MCP as a standard way to connect agents with tools and describes how agent workflows can themselves be offered as reusable tools.
What you learn in chapter 3 →Chapter 4: Architecting and building multi-agent systems
The chapter introduction explains why multi-agent design shifted from simply adding agents toward structuring their roles, while noting the tradeoff between single-agent simplicity and capability.
What you learn in chapter 4 →Chapter 5: Agent reasoning and planning
Introduces decomposition and planning as distinct, necessary parts of LLM reasoning and explains why distinguishing their failures matters for agents.
What you learn in chapter 5 →Chapter 6: Working with memory and knowledge RAG for agents
The introduction explains why agents need retrieval for external information and memory for their own past experiences.
What you learn in chapter 6 →Chapter 7: Building robust agents with evaluation and feedback
The introduction explains why evaluation and feedback matter for robust agents, what kinds of signals they provide, and why they should be considered throughout development.
What you learn in chapter 7 →Chapter 8: Deploying agents and agentic systems
The introduction frames deployment as a choice among ways to make an agent available, from embedding it in an application to using containers.
What you learn in chapter 8 →Chapter 9: Understanding the agentic loop
The introduction distinguishes the familiar internal SPAL loop from broader agentic looping used for long-horizon goals and multi-agent collaboration.
What you learn in chapter 9 →Chapter 10: Exploring the cognitive agent that thinks, monitors, and adapts
The introduction explains why capable agents need cognition and metacognition rather than simply more reasoning patterns.
What you learn in chapter 10 →Chapter 11: Tips for building agentic systems
Introduces the chapter’s production-informed tips and previews guidance for customer support, RAG, and deep research agents.
What you learn in chapter 11 →Concepts explained in this book
- AI agentSoftware that perceives an environment, selects actions, and acts toward a goal using resources provided by a large language model.
- evaluatorLLM-as-judge is an evaluation technique in which a language model assesses another model's output against specified criteria.
- ReActReAct is an agent reasoning technique that interleaves verbal reasoning with tool actions and observations in a feedback loop.
- toolA tool is an instrument or software capability that enables a person or system to perform a task, obtain information, or interact with resources.
- human-in-the-loopHuman evaluation is the assessment of system outputs or behavior by people applying judgment that may depend on context, policy, tone, or edge cases.
- MCP serverAn MCP server is a service that exposes tools, prompts, and resources to AI applications through the Model Context Protocol.
- agencyAgency is the capacity to perceive, decide, and act with some degree of autonomy in pursuit of a goal.
- MCPThe Model Context Protocol is an open protocol for connecting AI applications and models with external tools, data sources, and contextual resources.
- similarity searchRetrieval is the process of finding relevant information from an external source and bringing it into a model's context.
- embeddingA dense vector is a numerical vector in which the representation generally assigns a value to every dimension.
- guardrailA guardrail is a constraint, check, or control that limits an AI system's reasoning or actions.
- retryA retry is a repeated attempt to perform an API operation after an earlier attempt fails or does not complete successfully.
- guardrail agentA guardrail agent is an AI agent that validates, annotates, or handles data to control another agent's inputs or outputs.
- agent flowAn agent flow pattern is a multi-agent collaboration pattern in which specialized agents are arranged sequentially to perform a multistep task.
- pipelineIngestion is the phase of preparing source documents by loading, transforming, embedding, and storing them for later retrieval.
- memoryAgent memory is information retained from prior interactions or external sources that can augment an agent's context.
- hybrid searchHybrid search combines multiple retrieval methods, typically including vector-based and lexical or structured search, to improve information retrieval.
- agent orchestrationAn orchestrator is an agent that maintains a plan, delegates subtasks to worker agents, evaluates their results, and decides how execution continues.
- agentic RAGAgentic RAG is a retrieval-augmented generation approach in which an agent dynamically decides how and when to retrieve information, often iterating or using tools before generating a response.
- trajectoryAn execution history is a record of operations and attempts performed during an agent's task.
- chain-of-thought promptingChain-of-thought prompting is a technique that elicits or guides a model to produce or follow intermediate reasoning steps before a final answer.
- retrieval-augmented generationRetrieval-augmented generation is a technique that retrieves pertinent information at generation or decision time and adds it to a model's context.
- branchConditional routing is a pattern in which a router directs an input to one or more specialized agents or workflows according to the input's characteristics.
- iterative debate patternAn iterative debate pattern is a multi-agent collaboration in which agents repeatedly propose, critique, and revise solutions toward a vetted result.
- modeMajority voting is a selection technique that chooses the answer receiving the greatest number of votes among candidate outputs.
- parallel flowA parallel flow is a multi-agent pattern in which independent agents execute subtasks concurrently and a downstream step combines their outputs.
- peer-to-peer networkA peer-to-peer network is a decentralized multi-agent pattern in which agents communicate and cooperate without a central coordinator.
- role-playing collaborationRole-playing collaboration is a multi-agent pattern in which agents perform complementary roles and interact cooperatively through dialogue.
- routingModel routing is selecting and dispatching a request to a model or agent based on the request's characteristics and required task complexity.
- autonomyAutonomy is the capacity of a system to select and perform actions without requiring a separate user decision for each step.
- iterative critique patternAn iterative critique pattern is a one-to-one hierarchical collaboration in which a critic evaluates and gates revisions of a worker's output.
- vectorizationVectorization is the transformation of documents or other data into numerical vector representations.
- benchmarkA benchmark test measures how well a system solves a defined problem or achieves a known goal using a repeatable evaluation set.
- handoffA handoff pattern is a multi-agent design in which control of a task transfers from one agent to another without a separately coded transition.
- collaboration patternA reusable design in which multiple peer agents share state, contribute to a task, critique or refine one another's work, and collectively determine completion.
- containerAn isolated software execution environment that packages an application with its dependencies while sharing the host operating system kernel.
- multi-agent systemA multi-agent system is a system in which multiple autonomous or semi-autonomous agents coordinate to perform tasks or achieve shared or related goals.
- workerA worker agent is an agent specialized in performing delegated tasks or a defined set of tools for an orchestrator.
- evaluation and feedbackEvaluation and feedback are mechanisms for assessing agent behavior and supplying signals that guide improvement or correction.
- term frequency-inverse document frequencyTF-IDF is a term-weighting technique that scores a word by its frequency in a document relative to its frequency across a collection of documents.
- attention moduleAn attention module is a control component that selects which cognitive processing module receives control next based on current signals and state.
- exponential backoffExponential backoff is a retry scheduling technique that increases the waiting interval between successive attempts.
- planningPlanning is the process of constructing and organizing steps needed to achieve a goal.
- rubricA rubric is a structured set of criteria and standards for evaluating the quality of an output or behavior.
- language modelA large language model is a machine-learning model that generates and interprets language using patterns learned from extensive text data.
- evaluationEvaluation is the systematic assessment of an agent's output or behavior against defined criteria or expected results.
- reasoning modelA reasoning model is a language model that explicitly allocates computation to multistep deliberation before producing its final output.
- test-driven agent developmentTest-driven agent development is an iterative methodology for building an agent by defining evaluation goals and incrementally adding the instructions and tools needed to satisfy them.
- vector databaseA vector database server is a service that exposes storage and similarity retrieval over vector representations.
- stagnationStagnation detection is the identification of repeated iterations whose outputs do not meaningfully change.
- context windowThe finite amount of input and conversational context that an agent can retain or process in one interaction.
- cosine similarityCosine similarity measures the similarity of two nonzero vectors by the cosine of the angle between them, independently of their magnitudes.
- monitoringLogging is the recording of inputs, outputs, events, and intermediate execution steps for later inspection and analysis.
- working memoryShort-term memory is the recent interaction history of the current session that remains directly in the model's context window.
- metacognitionMetacognitive monitoring is the ongoing assessment of an agent's own knowledge and confidence while producing answers or taking actions.
- Tree-of-thoughtA thought tree is a tree-structured representation of alternative intermediate reasoning steps and their extensions.
- conversational aiA software system that performs tasks with user approval, typically through a conversational interface.
- reasoning and planningReasoning and planning is the process of deriving intermediate conclusions and organizing actions to achieve a goal.
- sequential thinking serverA sequential thinking server is an MCP server that provides a structured workflow for explicit multistep planning and reasoning.
- knowledge and memoryKnowledge and memory are the information resources an agent maintains or accesses to support decisions across interactions and tasks.
- domain knowledgeDomain knowledge is specialized understanding of the concepts, facts, practices, relationships, and constraints of a particular subject area.
- personaAn agent persona is a role, background, behavioral style, expertise profile, and operating-constraint specification that guides an AI agent's responses and task behavior.
- cognitive workspaceA cognitive workspace is a structured data object that represents an agent's task, findings, confidence, and other information needed across a cognitive cycle.
- cognitionCognition is an agent’s ability to model a task, decompose problems, reason about dependencies, compose tools, and update its understanding from new information.
- stdio transportSTDIO is the standard input and output stream interface through which a process receives input and emits output.
- decompositionDecomposition is the process of dividing a complex whole into smaller constituent parts that can be handled or analyzed separately.
- planning moduleA cognitive-agent component that selects a strategy, reviews relevant experience, and constructs a plan for task execution.
- groundingGrounding is the process of anchoring a model's responses in relevant external information, data, or context.
- prompt engineeringPrompt engineering is the deliberate design and refinement of instructions and contextual input to elicit desired behavior from a language model.
- evaluation moduleAn evaluation module is an architectural component that monitors an agent's intermediate work and assesses whether execution is progressing correctly.
- sparse vectorA sparse vector is a vector in which most positions contain zero or otherwise absent values.
- reflectionReflexion is an agent technique in which an agent uses feedback or self-reflection to improve subsequent decisions or attempts.
- principle of least privilegeLeast privilege is a security principle that grants each user, process, or agent only the minimum permissions needed for its tasks.
- perception moduleA perception module is a cognitive component that interprets incoming queries or environmental input and assigns relevant characteristics such as complexity.
- promptA prompt is an instruction or contextual input supplied to a language model to guide the content and behavior of its response.
- tool descriptionTool metadata is descriptive information about a callable tool, including its name, purpose, and parameter schema.
- prompt injectionJailbreaking is the use of crafted inputs or interactions to bypass an AI system's intended behavioral restrictions.
- stopping criterionA stop condition is a rule that determines when an iterative agent process must terminate.
- structured dataData organized according to an explicit format or schema that makes its contents and relationships readily evaluable.
- server-sent eventsServer-Sent Events is an HTTP-based protocol for streaming event updates from a server to a client over a persistent connection.
- knowledge boundary detectionKnowledge boundary awareness is an agent’s ability to recognize when a question or task lies outside the knowledge it can reliably use.
- memory moduleA memory module is a cognitive component that retrieves relevant prior experiences or information for use in subsequent processing.
- task loopA task loop is a repeated sequence of task execution attempts that continues until a completion condition or stopping condition is reached.
- tool chainingTool chaining is the process in which the output of one tool call becomes the input to a subsequent tool call.
- cachingCaching is the practice of storing reusable data or computation results so later access can avoid repeating retrieval or computation.
- Chroma DBChroma DB is a database system for storing and retrieving vector embeddings and associated document data.
- evaluatorAn evaluator is a procedure, model, or component that assesses an output or behavior against criteria and produces a judgment or score.
- context window managementContext window management is the architectural practice of controlling which conversation, tool, retrieval, and shared-state information is included within a model's context window.
- observabilityObservability is the practice of inferring and diagnosing a software system's internal state from its externally emitted telemetry.
- text chunkSemantic chunking is the segmentation of source material into sections that preserve meaningful units of content.
- OpenAI Agents SDKA software development kit for building applications with OpenAI-based agents and coordinating their execution flows.
- temperatureA temperature parameter adjusts the concentration of a probability distribution, affecting sampling randomness or the likelihood of accepting less favorable transitions.
- inverse document frequencyInverse document frequency is a logarithmic measure of how uncommon a term is across a document collection.
- term frequencyTerm frequency is the frequency of a term in a document, commonly normalized by the document's total number of words.
- function_tool decoratorA decorator or helper that exposes a programming-language function as an agent-callable tool and generates its structured tool description.
- continuous improvementAn iterative improvement process in which an output is revised or enhanced across successive iterations.
- deterministic checkA deterministic checkpoint is a programmatic or schema-based control point that evaluates a condition repeatably without relying on stochastic model judgment.
- agent communicationAgent communication is the exchange or sharing of information among agents in a software system.
- Docker ComposeDocker Compose is a tool for defining and running multi-container applications from a declarative configuration file.
- rate limitA rate limit is a constraint on how frequently or how many times a system may receive requests within a specified interval.
- actionAn action is an operation an AI agent performs that can affect its environment or internal state.
- functional layerA distinct architectural responsibility used to describe an AI agent, such as persona, tools, reasoning, memory, or evaluation.
- deep research agentA deep research agent is an AI agent designed to conduct multi-step information gathering, analysis, and synthesis over an extended task horizon.
- context pruningContext trimming is the selective summarization or removal of conversation history, tool information, attachments, or other context before a model call.
- intent-based routingIntent-based routing classifies a user's request by intent and dispatches it to an appropriate downstream model or agent.
- Arize PhoenixArize Phoenix is an open-source observability platform for tracing, evaluating, and monitoring generative AI and machine-learning applications.
- attentionAn attention layer computes context-dependent interactions among input elements to form representations for prediction.
- contractAn API is a defined interface through which software applications communicate with services or other software components.
- separation of concernsSeparation of concerns is a software design technique that isolates distinct responsibilities so they can be developed and changed independently.
- microservice architectureA microservices architecture is a software architecture in which an application is composed of independently deployable services with focused responsibilities.
- red-teamingRed team testing is adversarial testing that probes a system with inputs or patterns intended to expose failures, vulnerabilities, or unsafe behavior.
- tokenA token is a discrete unit of text represented numerically for processing by a language model.
- tokenizationTokenization is the process of converting text into discrete tokens that a language model can process.
- fallbackA fallback is an alternative action or implementation used when the preferred operation cannot complete successfully.
- semantic memorySemantic memory is memory retrieved according to the meaning of stored information rather than only its explicit graph relationships or literal terms.
- scratchpadA scratchpad is temporary storage for intermediate information generated during an agent's task execution.
- shared state objectA data object containing information that multiple agents can read and update during collaborative execution.
- confidence gateA confidence gate is a control that prevents low-confidence results from being presented as facts and requires explicit uncertainty handling.
- mcp clientAn MCP client is an application component that connects to an MCP server and discovers and uses the capabilities it exposes.
- parallelismThe concurrent execution of independent workloads or subtasks to reduce elapsed processing time.
- DockerDocker is a platform for building, packaging, distributing, and running applications in containers.
- image generation agentAn image generation agent is an AI agent that produces images from textual or other multimodal instructions.
- model updatingModel updating is the revision of an agent's task understanding or plan in response to newly arrived evidence or information.
- query refinementQuery refinement is the technique of reformulating a search query when its results are absent, weak, or insufficiently relevant.
- state persistencePersistence is the continuation of a system's goal-directed operation across multiple steps or interactions.
- cognitive cycleA recurring agent process that perceives a task, retrieves relevant memory, plans, executes actions, evaluates results, and records new experience.
- vector indexAn approximate nearest neighbor index accelerates similarity retrieval by finding vectors that are close to a query without exhaustively comparing every stored vector.
- objective functionA product metric measures business or user outcomes associated with an agent's deployed role.
- MCPServerStdioMCPServerStdio is a class that runs an MCP server locally through standard input and output while managing its subprocess lifecycle.
- hallucinationA hallucination is model-generated content that is plausible-sounding but wrong or contradictory to the relevant source information.
- SequentialThinking toolThe SequentialThinking tool is a callable tool that accepts structured input describing operations for tracking and organizing an agent's reasoning process.
- voice agentA voice agent is an AI agent that communicates with users through spoken-language input and output.
- execution moduleAn execution module is an agent component that carries out selected operations through available actions or external tools.
- agent collusionAgent collusion is a failure mode in which multiple agents reinforce incorrect conclusions because they share assumptions, biases, or training data without an effective external check.
- PydanticPydantic is a Python library for defining typed data models and validating, parsing, and serializing data.
- samplingSampling is a procedure for selecting or generating observations, values, or outcomes from a larger population, signal, or probability distribution according to a specified method.
- mcp promptAn MCP prompt is a predefined template that standardizes how agents interact with workflows and the tools or resources provided by an MCP server.
- MCP resourceAn MCP resource is a data-bearing capability that an MCP server exposes for a client, agent, or language model to read.
- agent layerAn agent layer is one of five architectural dimensions for analyzing and building an AI agent: persona, tools and actions, reasoning and planning, knowledge and memory, or evaluation and feedback.
- allowlistTool allowlisting is a security technique that restricts an agent's visible or callable tools to an explicitly approved set.
- knowledge graphA knowledge graph is a graph-structured representation of entities, entity types, observations, and relationships among them.
- specializationSpecialization is a system-design technique that assigns distinct focused responsibilities to separate agents rather than loading one agent with all responsibilities.
- sensory memorySensory memory in AI is multimodal retrieval of information from modality-specific indexes such as image or audio stores.
- meta loopA meta loop is an agent-controlled runtime loop in which an agent manages decisions, state, planning, delegation, and continuation across subtasks.
- model calibrationConfidence calibration is the degree to which an agent’s expressed or inferred confidence corresponds to the correctness of its output.
- cognitive agentA cognitive agent is an agent that decomposes novel tasks, reasons about dependencies, composes tools, and updates its understanding as new information arrives.
- MCP inspectorMCP Inspector is a developer tool for exploring, invoking, and diagnosing Model Context Protocol servers and their tools.
- non-reasoning modelA non-reasoning model is a language model that produces output without an explicit dedicated deliberation phase.
- compressionCompression is the reduction or summarization of stored information while preserving information needed for later retrieval or use.
- validationOutput validation is the process of checking generated or returned data against defined conditions before it is accepted or delivered.
- Docker DesktopDocker Desktop is a desktop application that installs and manages Docker container development and runtime components.
- hybrid memory systemA hybrid memory system combines semantic retrieval with graph-based retrieval and updates to support an agent's memory.
- tool usageA tool call is a structured request from an AI system to invoke a tool and obtain its result.
- asyncio.gatherA Python asyncio function that concurrently schedules awaitable objects and returns their results together.
- single-agent systemA single-agent system is a system in which one autonomous agent performs the tasks needed to solve a problem or achieve goals.
- iteration limitA fixed maximum number of iterations that an iterative agent process may execute.
- cosine distanceCosine distance is a metric equal to one minus cosine similarity that measures angular dissimilarity between vectors.
- tools and actionsTools and actions are the agent capabilities and operations through which an agent interacts with external systems and changes its environment.
- MCP memory serverThe MCP memory server is the official reference MCP server that provides persistent memory through a local knowledge graph.
- accuracyRouting accuracy is the proportion of inputs assigned to the appropriate agent or processing route.
- Claude DesktopClaude Desktop is a desktop application that provides access to Claude models and supports local and remote Model Context Protocol server connections.
- top-p filteringTop-p is a generation parameter that restricts sampling to the smallest set of tokens whose cumulative probability reaches a specified threshold.
- schemaA data schema is a formal specification of the structure, fields, types, relationships, and constraints of data.
- reciprocal rank fusionReciprocal rank fusion combines ranked result lists by summing the reciprocal of each result's rank offset across the lists.
- token limitA configured limit on the number of language-model tokens consumed during an execution.
- FastAPIFastAPI is a Python web framework for building APIs with type-based request validation and automatic interface documentation.
- lexical searchKeyword matching retrieves content by comparing literal terms in a query with terms in stored content.
- pass-off patternA pass-off pattern explicitly controls the information and communication passed between agents during a multi-step flow.
- prompt augmentationPrompt augmentation is the addition of retrieved information to an input prompt to provide a model with relevant context.
- reasoning and planning layerA reasoning and planning layer is an agent architecture component that controls how an agent reasons about and sequences its actions.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
