Overview

6 Creating Effective AI Agents

AI agents extend standalone LLMs from passive text generators into systems that can retrieve current information, take actions, and coordinate multi-step workflows. The chapter explains that LLMs are limited by static knowledge, inability to interact with external systems, and lack of workflow management. Agents address these gaps by connecting to APIs, databases, and tools; executing tasks such as scheduling meetings or booking travel; and adapting their actions based on context, user preferences, and intermediate results.

Reliable agents depend on three core capabilities: memory, tool integration, and decision-making. Memory allows agents to retain session context and, when appropriate, long-term user preferences, though it must be balanced against privacy, scalability, and context-window limits. Tool integration grounds responses in real-world data and reduces hallucinations by letting agents verify information through trusted sources. Decision-making frameworks, including rule-based logic, AI-driven reasoning, ReAct, and Tree-of-Thought approaches, help agents select tools, sequence actions, observe results, and adjust their behavior as tasks evolve.

The chapter also shows how agentic RAG combines retrieval with real-time actions, using a travel assistant example that can answer stored-knowledge questions while also checking live weather through tools. For production use, it emphasizes focused tools, clear tool descriptions, error handling, validation, fallback logic, cross-referencing, guardrails, transparency, and feedback loops to improve trust and reliability. Real-world case studies in healthcare, finance, document processing, and retail demonstrate that agents are moving from prototypes to deployed systems, where they reduce manual work, improve productivity, and support complex business workflows at scale.

Core differences between a Standalone LLM and AI Agent
Travel Agent LLM Flow starts from query and finishes booking the flight or suggests alternatives
The 3 core components of building a reliable agent
The two types of memory in agents: Short-term and Persistent Memory
The ReAct Framework for reasoning
An Agentic RAG system consisting of a Weather Tool (API) and Vector Store (RAG)
Example: Perplexity displays the steps that the agent used to answer the question as well as citations

Summary

  • Standalone LLMs like GPT-5 are powerful but face key limitations: static knowledge, inability to act, and lack of workflow management. AI agents address these challenges by integrating tools, performing actions, and orchestrating workflows.
  • Reliable agents rely on key components: memory systems (both short-term for session context and persistent for long-term storage), tool integration to connect with external systems, and decision-making frameworks like ReAct and Tree-of-Thought for intelligent behavior.
  • Memory comes in two main types: short-term memory for session-based context (implemented as a plain message list for full history retention) and persistent memory for cross-session information like user preferences. For longer conversations, an LLM-based summarization step can compress history to stay within context limits.
  • The ReAct framework enables intelligent behavior through a continuous cycle of reasoning about next steps, executing actions, and observing results. This approach helps agents adapt dynamically to user needs while maintaining reliability.
  • Agentic RAG systems merge retrieval capabilities with actionable insights, bridging the gap between knowledge retrieval and real-world tasks by combining document search with the ability to take actions.
  • Advanced techniques such as tool validation, cross-referencing, and guardrails help prevent hallucinations and ensure accuracy, making agents more reliable for production use.

FAQ

What is an AI agent, and how is it different from a standalone LLM?An AI agent is an LLM wrapped with additional capabilities such as tool access, memory, and decision-making logic. A standalone LLM can understand and generate text, but it usually cannot fetch live data, interact with APIs, or execute real-world tasks. An AI agent can connect to external systems, take actions, maintain context, and manage multi-step workflows.
Why do standalone LLMs struggle with real-world tasks?Standalone LLMs have three major limitations: static knowledge, inability to act, and lack of workflow management. They rely on information learned during training, cannot directly interact with calendars, booking systems, databases, or APIs, and cannot reliably coordinate multi-step tasks such as booking travel or processing business workflows.
How do AI agents solve the problem of static knowledge?AI agents solve static knowledge limitations by connecting to external tools such as APIs, databases, search systems, and retrieval systems. For example, instead of guessing current stock prices or weather conditions, an agent can query a live financial or weather API and return grounded, up-to-date information.
What are the core components of a reliable AI agent?Reliable AI agents are built on three core components: memory, tool integration, and decision-making frameworks. Memory helps agents retain context, tool integration connects them to real-world systems, and decision-making frameworks help them choose the right tools, sequence actions, and complete workflows correctly.
What is the difference between short-term memory and persistent memory in agents?Short-term memory stores context for a single session, such as recent conversation history or temporary task details. Persistent memory stores information across sessions, such as user preferences, past interactions, or long-term personalization data. Persistent memory usually requires a database and must be designed with privacy, security, and user control in mind.
How does tool integration reduce hallucinations?Tool integration reduces hallucinations by grounding the agent’s responses in verified external sources. Instead of relying only on the LLM’s training data, an agent can query APIs, databases, or knowledge systems. Good implementations also include fallback logic and output validation so the agent does not fabricate answers when a tool fails or returns invalid data.
What is the difference between passive retrieval and active tool use?Passive retrieval, such as traditional RAG, retrieves relevant information from documents or knowledge stores. Active tool use goes further by allowing the agent to change state in external systems. For example, an agent might retrieve flight options passively, then actively book a selected flight, send a confirmation email, and update a calendar.
What is the ReAct framework?ReAct stands for Reasoning + Acting. It is a decision-making framework where an agent alternates between reasoning about what to do next, taking an action with a tool, observing the result, and repeating the process until it reaches a final answer. This helps agents handle complex workflows step by step and adapt as new information becomes available.
What is Agentic RAG?Agentic RAG combines retrieval-augmented generation with agent capabilities. Traditional RAG can retrieve and synthesize stored knowledge, but it cannot take action or access live services by itself. Agentic RAG adds tools, decision-making, and workflow execution, allowing a system to combine document retrieval with real-time data and actions.
What techniques improve reliability and accuracy in production AI agents?Production agents benefit from safeguards such as cross-referencing multiple sources, validating tool outputs, fallback logic, guardrails, transparent reasoning steps, and feedback loops such as RLAIF. These techniques help prevent hallucinations, improve trust, handle tool failures gracefully, and keep the agent operating within safe and intended boundaries.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Building Reliable AI Systems ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Building Reliable AI Systems ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Building Reliable AI Systems ebook for free