chapter six

6 Creating effective AI agents

 

This chapter covers

  • The limitations of standalone LLMs and how AI agents address those challenges
  • The core components of reliable agents
  • How to build and deploy agents

Imagine asking a cutting-edge AI tool to book a flight or manage your schedule. Despite its impressive ability to understand language, it can’t perform real-world actions, leaving you to handle the details. This is where AI agents come in, transforming powerful but passive large language models (LLMs) into active task managers. You might ask an LLM the following:

Find me a morning flight from New York to San Francisco for next Tuesday.

An LLM might respond with a general suggestion:

You could try Delta or JetBlue.

This is hardly helpful. The LLM understands the question but can’t connect to flight APIs, check live schedules, or book the ticket. It simply lacks the ability to interact with the real world.

An AI agent (figure 6.1) bridges the gap between LLMs and real-world systems. Whereas an LLM provides reasoning and language, the agent adds the following capabilities:

  • Connecting to external tools like APIs and databases
  • Acting by performing tasks, retrieving data, and triggering workflows
  • Adapting to dynamic inputs and maintaining context across conversations
Figure 6.1 Core differences between a standalone LLM and AI agent
figure

6.1 Why do we need agents?

6.1.1 Static knowledge

6.1.2 Inability to act

6.1.3 No workflow management

6.1.4 How AI agents solve these challenges

6.1.5 Broader applications of AI agents

6.2 Core components of reliable agents

6.2.1 Memory: Context that sticks

6.2.2 Balancing memory systems with LangChain

6.2.3 Active tool use vs. passive retrieval

6.2.4 Strategies for reducing hallucinations with tools

Summary