Chapter 2. Large Language Models
As we saw in Chapter 1, the LLM powers agents to go from observations to actions. In Figure 2-1, we can see this general workflow. Here, we color-code the areas where the agent interacts with the user (on the left) and where the agent interacts with the environment (on the right).
Figure 2-1. The agent acts as a bridge between user and environment
Let’s take a simple example to unroll the loop we see in the figure. The example is a simple information-seeking agent trying to answer a question for a user using a web search tool. In Figure 2-2, we can see that interaction:
-
The user asks the agent a question.
-
The agent uses a web search tool, effectively pulling in information from the environment.
-
The retrieved information is presented to the agent, which decides that it now has enough information to answer the user’s question.
-
The agent prints out its ...
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