So far, we have used LLMs for direct, single-turn tasks like generating text or answering a question based on provided context. This chapter moves into building systems that can operate with more autonomy to achieve a goal. An autonomous agent uses an LLM as a reasoning engine to determine a sequence of steps, often interacting with external tools to gather information or perform actions. The process can be represented as a loop of thought, action, and observation.
In this chapter, you will learn to build these agents with the agent module. We will start by covering the ReAct (Reasoning and Acting) pattern, a common framework for structuring agent behavior. You will then implement a ReAct agent and learn how to provide it with tools, such as a search function or a simple calculator, to extend its capabilities. The core loop can be simplified to the following sequence:
Next, we will cover an alternative architecture known as a plan-and-execute agent. Finally, we will discuss the principles for building systems where multiple agents can collaborate to solve more complex problems. By the end of this chapter, you will be able to construct agents that can break down a problem, use tools to find solutions, and act on your behalf.
8.1 Introduction to LLM Agents
8.2 The ReAct Pattern for Reasoning and Acting
8.3 Building a ReAct Agent
8.4 Defining and Using Tools
8.5 Implementing Plan-and-Execute Agents
8.6 Orchestrating Multi-Agent Systems
© 2026 ApX Machine LearningEngineered with