Chapter 8. Agentic RAG
Agents are systems in which an LLM acts as a decision-maker. The model observes the current situation, plans a sequence of actions, and selects tools to execute those actions. Like a human who adjusts travel plans when a train is canceled, an agent adapts its strategy as new information becomes available (Figure 8-1).
Figure 8-1. Complex problem-solving with agents mimics human behavior
This way of thinking about problem-solving did not emerge overnight. Early LLM applications were built as isolated features such as summarization or translation. Over time, these grew into multistep workflows, and finally into fully agentic systems that can decide for themselves which tools to use.
Figure 8-2 shows the progression from single LLM features to orchestrated workflows to autonomous agents that freely select and combine tools.
Figure 8-2. From single-LLM features to autonomous agentic systems
Once you view an agent as an autonomous problem solver, its internal structure becomes easier to reason about. At the core, an agent runs in a continuous loop. It performs an action, observes the result, and decides what to do next.
Figure 8-3 shows the main components that make this possible. The agent uses an LLM to reason and plan, relies on tools to perform actions, ...
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