Skip to main content
Agents are systems that use a language model to choose a sequence of actions to take. In chains, a sequence of actions is hardcoded. In agents, a language model is used as a reasoning engine to determine which actions to take and in what order.

What is an Agent?

An Agent consists of three main components:
  1. The Model: The LLM that acts as the core reasoning engine.
  2. Tools: Functions or APIs that the agent can choose to execute (e.g. search engines, calculator, database retrievers).
  3. The Agent Loop: The prompt-based loop (commonly ReAct: Reason and Action) that coordinates reasoning steps, tool calling, and parsing results.

The ReAct Framework

ReAct stands for Reasoning and Acting. It allows LLMs to solve complex problems by combining reasoning traces (thoughts) with action execution (tool calls). The cycle continues until the agent determines it has enough information to formulate the final answer: In the next sections, we will cover how to build basic ReAct agents, add memory, load retriever tools, and build custom tools using various construct methods.