liveBook · Manning

AI agent

As explained in AI Agents in Action, Second Edition

Software that perceives an environment, selects actions, and acts toward a goal using resources provided by a large language model.

A chatbot can list flights; an AI agent can work toward booking one. An AI agent is software that perceives its environment, decides what to do, and acts toward a goal using resources provided by a large language model (LLM). The model supports reasoning, while instructions, tools, memory, and orchestration turn decisions into work. section 1.0 section 5.2

The practical distinction is sustained, multistep work. A tool-using assistant may act on a request and stop or seek approval for each task. An agent can choose further steps after seeing results. Autonomy does not mean unchecked authority: high-stakes actions can still require explicit approval. section 1.1.1 section 3.2.4

Table 1.1 The four LLM interaction patterns covered in this book

Pattern

Approval model

Autonomy level

Typical use case

Example platform

Direct LLM chat

No tools invoked; the model only generates text

None

Q&A, drafting, brainstorming, learning

Original ChatGPT (2022), early Claude (2023)

Tool-augmented LLM

Implicit per call; a user prompt triggers a single tool

Low

Image generation, web search, simple lookups

ChatGPT with DALL·E, Gemini with Google Search

Assistant

Per-task approval; the user confirms each action

Medium

Pair programming, cited research, document editing

GitHub Copilot Chat, Cursor, Claude in Excel

Agent

Goal-level approval with gated high-stakes actions; the user sets the objective, and the agent decides the steps

High

Multistep research, repo-wide refactors, browser automation

Claude Code, OpenAI Operator, Devin

Compare direct chat, one-off tool use, assistants, and agents by approval model, autonomy, and typical task. section 1.1.1

For a goal requiring several actions, use the sense–plan–act–learn cycle:

  • Sense: receive the goal and relevant context or feedback. section 1.1.2
  • Plan: identify tasks and select tools. section 1.1.2
  • Act: execute a tool, such as a search or booking function. section 1.1.2
  • Learn: inspect the result, then finish or choose another step. section 1.1.2

From a goal to tool calls

For “travel to Calgary,” an agent may search for flights, book flights, book a hotel, and book transportation. A search result can inform the next call. The goal is broader than any one tool invocation. section 1.1.2

Five functional layers help organize an agent: persona (role and instructions), tools and actions, reasoning and planning, knowledge and memory, and evaluation and feedback. They describe interacting capabilities, not a fixed execution order; a simple agent need not use every layer. Tools commonly wrap APIs, databases, or applications, allowing actions beyond the model’s own output. section 1.3 section 1.1.3

Start small, then make results inspectable

A minimal research-planning agent can be checked for five numbered tasks. Next, constrain its output with a typed research-plan model, refine its instructions, add a source-retrieval tool, and inspect traces. Each addition makes behavior easier to specify or verify before expanding its authority. section 2.5

Design for mistakes as well as success. A tool can time out, reject arguments, or return an unexpected schema; the agent should receive a usable error and have bounded options to retry, fall back, ask the user, or stop. Restrict available tools, validate outputs, cap runaway loops, and gate consequential actions. When one agent becomes overloaded with tools or context, focused agents can divide specialized or parallel work. section 1.1.3 section 3.2.4 section 1.4

How AI Agents in Action, Second Edition covers it

How deep it goes
Develops a sense–plan–act–learn loop and five functional layers, then progresses through a minimal agent, typed output, tools, and tracing.
Examples
Uses flight booking and a research-planning exercise with numbered tasks, typed output, a retrieval tool, and traces.
What it assumes
Introduces agency by contrasting familiar chatbots and assistants, then builds from a first-pass agent.
What you can do after
Build it from scratch as a minimal research-planning agent, then add structured output, tool use, and tracing.
How it connects
Connects large language models, prompt engineering, tool calling, memory, evaluation, Model Context Protocol, and multi-agent systems.

Also explained in

Compare how 33 books explain AI agent →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action, Second Edition. The section links point to the parts of the book it draws on.