Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 1

Understanding LLM Agents: Distinguishing Them From Other LLM Applications

Recommended resources

Welcome to the first lesson of your course on building agentic AI systems. Your goal is to build production-grade agents, and to do that effectively, we need to start with a solid foundation. This first step is all about precision in language and thought. We'll clarify what an "agent" truly is and, just as importantly, what it is not.

Given your experience with Python and calling LLM APIs, you're already familiar with the most fundamental building block: the single LLM call. In this lesson, we will build on that foundation to distinguish between simple LLM calls, more complex chains and workflows, and finally, the autonomous, goal-directed systems we call agents. By the end of this session, you will be able to define an LLM agent and differentiate it from these other common patterns.

The Spectrum of Autonomy

It's helpful to think about LLM-based systems as existing on a spectrum of autonomy. On one end, you have highly controlled, predictable systems. On the other, you have systems with a high degree of freedom to make their own decisions.

To kick things off, let's watch a segment from the video "From Workflows to Multi-Agent Systems: How to Choose." The speaker introduces this idea of an "autonomy slider" which provides a great mental model for our discussion.

From Workflows to Multi-Agent Systems: How to Choose

Introduce the video by mentioning its title and channel/author (only on first use), say why to watch it

Please watch the section from this part of the video. Focus on the "autonomy slider" concept, which categorizes systems from a single prompt up to multi-agent systems.

As the video suggests, most applications you'll build will fall on the "workflow" side of this slider. But to innovate and tackle truly complex problems, you need to understand when and how to grant more autonomy, moving towards the "agent" side.


From Single Calls to Predefined Workflows

You already know what a plain LLM call is: you send a prompt, you get a response. It's a single transaction.

Things get more interesting when you start connecting these calls. This leads us to chains and workflows.

  • A chain is the simplest form of a workflow, where the output of one LLM call becomes the input for the next, creating a sequence.
  • A workflow is a more general term for any system where multiple components (which can include LLM calls, regular code, or API calls to other services) are connected to accomplish a task. The crucial characteristic is that you, the developer, pre-define the structure and flow of execution. The system follows a script.

Even very complex workflows, with branching logic, parallel execution, and loops, are still "workflows" as long as the paths are hard-coded. Let's look at some concrete examples.

Workflows and agents - Docs by LangChain

The LangChain documentation provides excellent, code-first examples of different workflow patterns. We'll examine a few to see how LLMs can be embedded within developer-defined logic.

Skim through the following sections. You don't need to understand every line of code yet, but focus on the structure of each example, as shown in the diagrams. Prompt Chaining: Notice how one LLM generates a joke, and another one potentially improves it. This is a simple, linear sequence. Parallelization: Here, three LLM calls are run independently, and their results are combined later. The execution graph is predefined. Routing: An LLM is used to decide which pre-written path to take (poem, story, or joke). The LLM directs traffic, but only to destinations you've already built. Orchestrator-worker and Evaluator-optimizer: These are even more advanced patterns. An orchestrator plans tasks for workers, and an evaluator provides feedback in a loop. Despite their complexity, the overall structure—the nodes and possible edges of the graph—are still defined by the developer. In all these cases, the LLM is a component within a predefined code path.


The Leap to Agency

So, what makes an agent different?

An agent is a system where the LLM is not just a component in a flow, but the director of the flow itself. It's not just following a script; it's writing the script as it goes, based on a goal and its observations.

The key ingredients for an agent are:

  1. A goal or high-level objective.
  2. A set of tools (functions, APIs) it can use to interact with the world.
  3. The ability to reason about its goal and observations.
  4. The autonomy to decide what to do next (e.g., which tool to use, what to say) in a loop.

Let's get a more formal definition.

How to think about agent frameworks - LangChain

This blog post from LangChain offers a practical, non-hype definition of agents.

Read the section "What is an agent". Pay close attention to Anthropic's definition, which the author prefers: "...typically just LLMs using tools based on environmental feedback in a loop." This is the core concept.

This feedback loop is the essence of agency. The agent takes an action (e.g., calls a tool), observes the result (the "environmental feedback"), and then passes that observation back into its reasoning process to decide the next action. This continues until it believes the goal is complete.

Now, let's return to the LangChain documentation to see a code example of this very pattern.

Workflows and agents - Docs by LangChain

This example shows a simple but complete agent.

Focus on the Agents section. Contrast the diagram and code with the previous workflow examples. Notice the loop: the llm_call node can lead to the tool_node, which always leads back to the llm_call node. The LLM itself decides when to break this loop by not making a tool call. It is in control of its own execution path.


Workflows vs. Agents: A Visual Summary

This distinction is so fundamental that it's worth summarizing visually. The following diagram cleanly separates these concepts.

This diagram illustrates the fundamental difference in control flow. In workflows (left and middle), the developer defines the paths. In an agent (right), the LLM directs its own actions in a loop based on feedback.
  • Left Column (Workflows): This represents simple patterns like the prompt chaining and parallelization we saw. The "LLM is embedded in predefined code paths."
  • Middle Column (Workflows): This shows the more complex routing and orchestrator patterns. Here, the "LLM directs control flow through predefined code paths." It's making decisions, but within a structure you built.
  • Right Column (Agent): This is the crucial leap. The "LLM directs its own actions based on environmental feedback." The loop from "feedback" back to the "LLM call" is the defining feature of an agent.

The speaker in the video you watched earlier makes this same point very clearly.

From Workflows to Multi-Agent Systems: How to Choose

This short segment reinforces the core distinction.

Watch the clip from this part of the video. The speaker emphasizes that in a workflow, the programmer controls the flow, whereas an agent decides its own steps. He also clarifies that simply using tools (APIs) doesn't automatically make something an agent; it's about who decides which tool to use and when.


Conclusion

In this lesson, we've established a clear vocabulary to discuss agentic systems. It's not just a matter of hype or marketing; these distinctions are critical for making sound architectural decisions.

Here are the key takeaways:

  • Plain LLM Call: A single input/output transaction.
  • Chain/Workflow: A system of connected components (including LLMs) where the execution path is pre-defined by the developer. The LLM is embedded within your logic.
  • Agent: A system where the LLM is given a goal and a set of tools, and it autonomously decides its sequence of actions in a loop, based on feedback from its environment. The LLM directs its own logic.

While most production systems today are sophisticated workflows, true agents unlock the ability to tackle dynamic, unpredictable, and long-running tasks. Your goal is to become proficient at building both and, more importantly, knowing when to choose one over the other.

In our next lesson, we will deconstruct the agent's decision-making process by examining its core operating cycle: the perceive, reason, act, and observe loop.