liveBook · Manning

Chapter 6: Creating effective AI agents

What you will learn in chapter 6 of Building Reliable AI Systems

The chapter introduction contrasts a standalone LLM’s ability to respond with an agent’s ability to interact with real-world systems, and notes a production risk that reliable agents must control.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The chapter introduction contrasts a standalone LLM’s ability to respond with an agent’s ability to interact with real-world systems, and notes a production risk that reliable agents must control.

Key terms: standalone LLMs, AI agents, external tools, APIs, workflows, context, decision-flow controls, monitoring features, infinite loops

6.1 Why do we need agents?

This section introduces why agents matter by noting that standalone LLMs are capable but face real-world challenges, without yet explaining those challenges.

6.1.1 Static knowledge

Explains why a standalone LLM cannot reliably answer questions requiring current information and how external data access can address that limitation.

Key terms: static knowledge base, tool integration, retrieval-augmented generation (RAG), API integration

6.1.2 Inability to act

This section explains why an LLM that understands a request may still be unable to carry out the requested action.

Key terms: glass wall, external systems, external tools

6.1.3 No workflow management

The section explains why a standalone LLM cannot carry out a multistep task even when it can describe what needs to be done.

Key terms: standalone LLMs, complex workflows, subtasks

6.1.4 How AI agents solve these challenges

This section explains how agents extend LLMs with external connections, the ability to act, and coordination of multistep tasks.

Key terms: AI agent, standalone LLM, control system, external tools, APIs, databases, live data, performing actions, external systems, workflow orchestration

6.1.5 Broader applications of AI agents

This section illustrates how agents act across several industries, contrasts them with standalone LLMs, and reports recent progress on real-world computer tasks.

Key terms: Standalone LLMs, AI agents, tools, actions, workflows, health care, patient overview, market trends, portfolio risks, e-commerce

6.2 Core components of reliable agents

Introduces reliable agents as systems built from memory, tool integration, and decision-making frameworks.

Key terms: memory, tool integration, decision-making frameworks

6.2.1 Memory: Context that sticks

This section explains how agent memory preserves conversational context, distinguishes short-term from persistent memory, and describes how to retain useful information without overloading the agent or compromising privacy.

Key terms: memory, context, multistep workflows, short-term memory, conversation history, session, buffer, dictionary, persistent memory, preferences

6.2.2 Balancing memory systems with LangChain

The section compares ways to retain conversational context, then explains how external tools ground agent responses and why standardized tool interfaces help.

Key terms: buffer memory, HumanMessage, AIMessage, message lists, summary memory, running summary, context window, token overflow, buffer, perfect recall

6.2.3 Active tool use vs. passive retrieval

This section distinguishes an agent’s ability to act through tools from passive retrieval and shows how consulting external APIs can ground answers that an LLM would otherwise guess.

Key terms: tools used for retrieval, tools used for action, passive retrieval, change state, RAG, hallucination, tool integration, weather API, real-time data, grounds its response

6.2.4 Strategies for reducing hallucinations with tools

This section presents three ways to reduce agent hallucinations when using tools: ground answers in tool data, handle tool failures without fabricating, and validate tool outputs.

Key terms: anchor responses to tools, APIs, databases, grounded responses, fallback logic, timeouts, rate limits, network issues, validate tool outputs, accuracy

6.2.5 Decision-making: Making AI agents intelligent

This section explains how agents choose and sequence actions, contrasts rule-based and AI-driven decisions, and introduces ReAct and tree-of-thought reasoning.

Key terms: decision-making frameworks, tools, multistep workflows, rule-based systems, AI-driven reasoning, predefined logic, LLMs, ReAct, Reasoning + Acting, Reason

6.3 Agentic RAG for reliable agents

This section contrasts traditional RAG’s reliance on stored information with Agentic RAG’s combination of retrieval and action for real-world tasks.

Key terms: traditional RAG, Agentic RAG, stored knowledge, retrieval capabilities, take actions

6.3.1 Project: Building an agentic RAG system with LangChain

The section introduces a travel-assistant project and explains why its examples use a transparent TypeScript interface while also providing equivalent Python code.

Key terms: ReAct-based chat interface, transparent UI, reasoning steps, ch06_agentic_rag.py, Python equivalent, agent logic

6.3.2 Setting up dependencies

6.3.3 Building the knowledge base

This section introduces the travel assistant’s knowledge base and identifies a vector store as a way to search it semantically.

Key terms: knowledge base, vector store, semantic search

6.3.4 Creating interactive tools

This section identifies using tools to gather information as central to the agentic system, then previews two tools.

Key terms: agentic system, tools, gather information

6.3.5 Configuring the agent’s behavior

6.3.6 Implementing transparent decision-making

6.3.7 Managing conversation context

The section states why conversation context matters and illustrates how an Agentic RAG system answers a query that needs both stored knowledge and live information.

Key terms: context across interactions, Agentic RAG, retrieval tool, knowledge base, weather tool

6.3.8 Making the system work in production

This section identifies practical requirements for production agentic RAG systems and explains how they connect retrieved knowledge with agent actions.

Key terms: tools, tool descriptions, error handling, external services, APIs, agentic RAG, knowledge access, action capabilities

6.4 Advanced techniques

Introduces why ReAct agents need safeguards beyond tool-grounded reasoning to be reliable in production.

Key terms: ReAct framework, grounding, production-grade reliability

6.4.1 Cross-referencing

This section explains how agents can cross-check independent sources before relying on results for important decisions.

Key terms: cross-referencing, independent tools or sources, inconsistencies

6.4.2 Guardrails for security and preventing hallucinations

This section explains how content guardrails keep agent responses within safe, relevant boundaries and why simple keyword filters are insufficient in production.

Key terms: guardrails, content filtering, safe operating boundaries, rule-based approach, keyword matching, LLM-as-a-judge guardrails, semantically

6.4.3 Reinforcement Learning from AI Feedback

This section explains that feedback on an agent’s outputs can guide iterative improvements to its reasoning and decisions.

Key terms: Reinforcement Learning from AI Feedback (RLAIF), explicit feedback, reasoning and decision-making processes

6.4.4 Transparency in multistep reasoning

The section explains how showing an agent’s intermediate steps and sources helps users understand, verify, and correct its answers.

Key terms: transparency, intermediate reasoning steps, sources

6.4.5 Case studies for agents in production

This section uses production case studies, adoption figures, and a brief framework comparison to show how organizations put AI agents to work and measure their value.

Key terms: ambient documentation technology, clinical notes, documentation burden, LLM Suite, Coach AI, EVEE Q&A agent, AI coding assistants, specialized AI agents, automation rates, edge cases

6.5 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 5: Fine-tuning LLMs for improved performance Chapter 7: Tool integration and MCP →

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.