Chapter 4. Agent Basics
In Chapter 1, we introduced a very simple definition for an agent: “An agent is a program powered by LLMs that can independently make decisions, plan iteratively, and execute tasks to achieve complex goals.”
This foundation gives us a starting point. At its simplest, an agent is a piece of software that can perceive information, make decisions, and take actions in pursuit of a goal. In technical terms, an agent differs from ordinary programs because it is autonomous, adaptive, and able to sustain interactions over time. Whereas a script runs once and terminates, an agent can reason about what to do next, adjust when conditions change, and coordinate with other entities—whether human or digital. Researchers often describe agents by the components of their architecture: task planning, execution, memory, problem-solving, tool use, and learning—each working together to create a self-directed system.
This may sound abstract, but the underlying concepts are not foreign to us. People themselves plan their tasks, execute them step-by-step, solve problems with creativity and reasoning, use tools to extend their capabilities, remember and learn from experience, and communicate with others to accomplish more than they could alone. Agents are engineered to do much the same—only with computational mechanisms instead of neurons. Their “brains” are large language models, their “tools” are APIs and databases, and their “memory” takes the form of context windows, caches, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access