An LLM that calls tools and reads their results is an agent. That's the whole definition. The simplicity is deceptive — getting an agent to actually work in production, without runaway loops or $100 surprise bills, is the hard part, and that's what this track covers.
Learning Objectives
After this lesson, you will be able to:
Explain what an AI agent actually is and how it differs from a chatbot (answers questions) or a copilot (suggests next steps)
Name the five parts every agent needs: a brain (LLM), a loop (keep going), hands (tools), a notebook (memory), and a mission (goal)
Walk through the core agent loop: observe what is happening, think about it, plan the next move, take action, and repeat
Understand the ReAct pattern -- where the AI writes out its reasoning before acting -- and why this simple trick dramatically improves results
Recognize the safety guardrails that prevent agents from going off the rails in production
Welcome to the Agents track. This is where AI goes from "answering questions" to "getting things done." If you have ever wished ChatGPT could actually do things instead of just talk about them, you are in the right place. Let's build that.
The term "agent" gets thrown around a lot in AI. Let us nail down what it actually means, because the distinction matters -- both conceptually and architecturally.
LLM -- The reasoning engine. It reads context, generates thoughts, and decides what to do. Without the LLM, there is no intelligence.
Loop -- The autonomy mechanism. The agent does not respond once and stop. It cycles: observe the result, decide the next step, act again. Without the loop, the LLM is a one-shot text generator.
Tools -- The hands. Functions the agent can call to interact with the real world -- search the web, query a database, send an email, run code. Without tools, the agent is all talk and no action.
Memory -- The context. What the agent remembers from previous steps, previous conversations, and external knowledge. Without memory, every step starts from scratch.
Goal -- The direction. What the agent is trying to accomplish. Without a goal, the agent is a hamster on a wheel -- looping endlessly with no purpose.
Figure
Five components surround and connect to the LLM at the centre: the Loop that keeps it running, the Tools it can call, the Memory it carries between steps, and the Goal it is working toward. Each one is load-bearing — remove it and you get something strictly less than an agent. Without Tools you have a chatbot. Without the Loop you have a one-shot function caller. Without a Goal you have an expensive random walk.
Remove any one of these and you have something less than an agent. An LLM without tools is a conversationalist. An LLM with tools but no loop is a single-shot function caller. An LLM with a loop but no goal is an expensive random walk.
Not every AI system is an agent, and not every system needs to be. There is a spectrum, and understanding where each system falls on it helps you choose the right architecture for your task.
Chatbot -- Stateless question-answer. You ask, it responds. No tools, no planning, no memory between turns beyond the conversation window. Think basic customer support bots or the early versions of ChatGPT. It cannot take any action in the real world. It generates text and only text.
Copilot -- Watches what you are doing and suggests next steps. It has context (your code, your document, your spreadsheet) and sometimes has tools, but you drive the action. You decide which suggestions to accept, which to reject, and when to ask for more. GitHub Copilot, smart autocomplete, and writing assistants live here. The copilot augments your capability; it does not replace your decision-making.
Agent -- You give it a goal, and it figures out the steps. It decides which tools to use, in what order, and adapts when things go wrong. It operates in a loop until the task is complete or it determines it cannot proceed. You define the what. The agent determines the how. Claude Code, Devin, and research agents like those in AutoGPT represent this category.
The boundaries are not always sharp. A copilot that can execute code and retry on failure is almost an agent. An agent that always asks for human approval before acting is almost a copilot. The key question is: who decides the next step? If the human decides, it is a copilot. If the AI decides, it is an agent.
What Do You Think?
If you give a chatbot the task 'Book me a flight to Tokyo for March 15-22 under $1500,' what happens?
What Do You Think?
Which of these is the BEST modern example of a production AI agent (2025)?
A chatbot can only respond with text. It might describe how to book a flight, even in convincing detail, but it cannot open a browser, search Kayak, compare prices, or click "purchase." An agent can -- because it has tools and a loop. The chatbot generates words about actions. The agent takes them.
Try it! Open ChatGPT or Claude and give it this task: "Book me a flight to Tokyo for next week under $1500." Notice how it describes what you could do but cannot actually perform any actions. Now imagine if it could call a flight search API, compare results, and report back. That gap between "talks about it" and "does it" is exactly what agents close.
Every agent, regardless of framework or architecture, runs some version of this loop:
Observe -- Gather information from the environment. This could be the user's initial message, the output of a tool call, an error message, or a change in state. The agent takes in new data.
Think -- Reason about the current situation. What do I know? What do I still need? Is my current plan working, or do I need to change course? This is where the LLM's reasoning capabilities shine.
Plan -- Decide on the next action or sequence of actions. Should I call a tool? Which one? With what arguments? Or should I respond to the user directly?
Act -- Execute the plan. Call a tool, generate text, or take some other action that changes the state of the world.
Then the cycle repeats. The agent observes the result of its action and begins reasoning again. This continues until the goal is achieved, the agent gets stuck, or it hits a stopping condition (timeout, max steps, user cancellation).
The user says: "Find me the cheapest flight to Tokyo for March 15-22." The agent receives this as its initial observation. It has a goal now: find a cheap flight with specific dates.
The agent reasons: "I need to search for flights to Tokyo departing March 15 and returning March 22. The user wants the cheapest option. I should search flight databases to find available options within these dates."
The agent plans: "Step 1: Search flights with my flight_search tool. Step 2: Compare prices across results. Step 3: Present the best option to the user."
The agent calls flight_search(destination="Tokyo", depart="2026-03-15", return="2026-03-22"). The tool queries airline databases and returns five flight options with prices ranging from $780 to $1,450.
The agent receives the search results: five flights. ANA direct for $780, JAL with a stop for $830, United direct for $1,050, Delta with a stop for $920, and American with two stops for $1,450.
The agent reasons: "The ANA direct flight at $780 is the cheapest AND it is nonstop. This is clearly the best option. I have enough information to respond."
The agent responds: "The cheapest flight to Tokyo for March 15-22 is an ANA nonstop for $780. The next cheapest is JAL at $830 with one stop in Osaka. Want me to provide booking links?" Task complete.
Notice what happened: the agent made multiple decisions across multiple phases. It assessed what information it needed. It chose which tool to call and how to format the arguments. It analyzed the results and identified the best option. It decided how to present the answer. A chatbot would have given a generic paragraph about how to search for flights. The loop is what makes an agent an agent.
Many people think agents are defined by having access to tools. That is part of it, but the deeper insight is the loop. A single tool call is just a function call with extra steps. What makes agents powerful is the ability to:
React to results: The agent sees what the tool returned and decides what to do next based on that new information.
Handle failure: If a tool returns an error or unexpected data, the agent can try a different approach.
Chain actions: The output of one action becomes the input for the next, with the agent deciding the connections at runtime.
Know when to stop: The agent judges whether the goal is met and stops the loop, rather than running a fixed number of steps.
A script can chain tool calls. But a script follows a fixed path. An agent navigates a dynamic one.
Select a scenario above and watch the agent reason through it step by step. Pay attention to how each phase (Observe, Think, Plan, Act) contributes differently to the agent's decision-making. Try all three scenarios to see how the same loop adapts to very different tasks.
Everything starts with a goal. The user says: "Book me a flight to Tokyo under $1000." This is the agent's mission. Without a clear goal, the agent has no direction -- it is a reasoning engine with nothing to reason about.
The agent ingests everything available: the user's message, system prompt instructions, available tools, and any memory from past interactions. This is the observe phase -- gathering all the information needed to make a decision. The richer the context, the better the first action.
The agent reasons explicitly: "I need to search for flights to Tokyo. I have a flight_search tool. The user wants it under $1000, so I should filter by price. Let me search with the destination and date parameters." This chain-of-thought reasoning is the ReAct "Thought" step -- it prevents the agent from jumping to poorly targeted actions.
Based on its reasoning, the agent decides the next concrete action: call the flight_search tool with specific arguments. The plan might be a single step or a multi-step sequence, but the agent commits to one action at a time. Planning before acting is what separates agents from random tool callers.
The agent outputs a structured tool call: flight_search(destination="Tokyo", max_price=1000). Your code receives this request, validates the arguments, and executes the actual API call. The LLM decided what to do; your code does it. This separation is critical for safety.
The tool returns results: 3 flights under $1000. The agent reads this new observation and updates its understanding. Did the action succeed? Is the goal met? Does it need more information? Each observation feeds directly into the next reasoning step.
The agent evaluates: "I found 3 flights under $1000. The cheapest is ANA at $780. The goal is met -- I can present the results." If the goal were not met (no flights found, or more filtering needed), the loop would cycle back to Step 3. The loop continues until the goal is achieved, the agent gets stuck, or a safety limit is hit (max steps, token budget, timeout).
The most influential framework for understanding agent behavior is ReAct -- Reasoning + Acting. Published by Yao et al. in 2022, ReAct formalized something powerful: at each step, the agent explicitly generates a Thought (reasoning trace), then takes an Action, then processes the Observation.
Here is what a ReAct trace looks like:
Thought: "The user wants flights to Tokyo. I have the destination and dates. Let me search."
Action:flight_search(destination="Tokyo", depart="2026-03-15", return="2026-03-22")Observation: Five flights found. Cheapest: ANA at $780.
Thought: "I have good results. The ANA flight is the cheapest and nonstop. Let me present the options clearly."
Action: Generate response with recommendation and comparison.
The explicit reasoning trace is not just for show. It dramatically improves the quality of the agent's decisions because it forces the LLM to "think out loud" before acting. Without the Thought step, the model is more likely to jump to conclusions, call the wrong tool, or hallucinate arguments. The Thought step acts as a self-check -- the model articulates its reasoning, and if the reasoning is flawed, the flaw becomes visible in the text and can sometimes self-correct.
Research showed that interleaving reasoning traces with actions significantly outperforms either reasoning-only or action-only approaches on tasks like multi-hop question answering and interactive decision making.
To understand why ReAct is so effective, consider what happens without it:
Pure reasoning (no actions): The LLM tries to answer everything from memory. "The cheapest flight to Tokyo is probably around $800 on ANA." This might be right or wrong -- the model has no way to verify. It hallucinates confidently.
Pure acting (no reasoning): The agent calls tools mechanically without thinking about why. It might call flight_search before asking about dates, or search for "Tokyo" when the user meant "Tokyo Narita" vs "Tokyo Haneda." Without reasoning, tool calls are poorly targeted.
ReAct (reasoning + acting): The agent thinks before acting and acts to gather information for further thinking. It reasons: "I need dates before I can search." It acts: asks the user. It observes: "March 15-22." It reasons: "Now I can search with these constraints." Each thought refines the next action. Each action informs the next thought.
ReAct: Synergizing Reasoning and Acting in Language Models
Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, Yuan Cao (2022)
The foundational paper that formalized the Thought-Action-Observation loop. Showed that interleaving reasoning traces with actions significantly outperforms either reasoning-only or action-only approaches on knowledge-intensive and interactive tasks.
Memory is the component that gives agents context beyond the current step. There are three types:
Short-term memory (conversation context): The messages exchanged in the current task -- user inputs, agent thoughts, tool results. This is what the LLM sees in its context window. It is automatically maintained by the conversation history and disappears when the task ends.
Working memory (scratchpad): Intermediate results the agent stores explicitly. "I found 5 flights. The cheapest is ANA at $780." The agent writes this to a scratchpad so it can reference it later without re-reading the full tool output. Some frameworks call this "agent state."
Long-term memory (persistent): Knowledge that persists across tasks and sessions. User preferences ("always search economy class"), learned facts ("this user lives in San Francisco"), and past interaction summaries. Typically stored in a vector database or structured store. This is what makes an agent feel like it "knows" you over time.
The balance between these memory types is an active area of research. Too much context overflows the LLM's window. Too little causes the agent to repeat mistakes or forget user preferences.
The agent idea moved from research toy to production stack in just two years. A snapshot of the landscape worth knowing:
Coding agents in production. Devin (Cognition, 2024), Claude Code (Anthropic, 2024), Cursor Agent and Composer (2024-2025), Windsurf Cascade (Codeium, 2024). All run the observe-think-plan-act loop over a real codebase, tool surface (read/write file, run shell, run tests), and a feedback signal (compile errors, failing tests, lint output). See Code AgentsCode AgentsCode agents autonomously read codebases, plan changes, edit files, run tests, and iterate on failures to produce working software changes.Learn more →.
Computer-use agents. Anthropic's Computer Use API (Claude Sonnet 4.5/Opus, October 2024) lets the model take screenshots and emit click/type actions; OpenAI Operator (January 2025) is the same idea over a browser. The "tool" is the entire desktop. See Computer Use Agents.
Multi-agent orchestration. LangGraph (2024) makes the agent loop a typed state graph; OpenAI Swarm and CrewAI formalize role-based handoffs. See Multi-Agent Systems.
Reasoning models in the loop. OpenAI o1 and o3 (2024-2025), DeepSeek R1 (2025), Claude with extended thinking (2025) collapse part of the "think" step inside the model. They make agents better planners and cheaper to operate per useful step. See Reasoning modelsReasoning ModelsReasoning models are LLMs trained to perform extended chain-of-thought reasoning before producing a final answer, improving performance on complex tasks.Learn more →.
Benchmarks that actually measure agency. SWE-bench Verified (2024) for coding; OSWorld and WebArena for computer use; GAIA for multi-step reasoning; AgentBench for the general loop; TheAgentCompany (2024) for white-collar workflow. See Agent Evaluation.
Standard agent observability. Langfuse, LangSmith, Braintrust, and OpenLLMetry (built on OpenTelemetry) became standard in 2024-2025 because agent failures are emergent and unreplayable without traces. See Agent ObservabilityAgent ObservabilityAgent observability captures every prompt, tool call, retry, and token cost into traces so you can debug nondeterministic loops and attribute failures to a specific step.Learn more →.
If a system is shipping agentic behavior to real users today, it almost certainly leans on at least one item from each of these rows.
Agents are LLMs in a loop with tools, memory, and goals. Unlike chatbots that respond to single messages, agents autonomously observe, think, plan, act, and iterate until a goal is achieved
The ReAct pattern interleaves reasoning and action. By explicitly generating reasoning traces before each action, agents make better decisions and their behavior becomes interpretable and debuggable
Agents need guardrails to be safe and reliable. Token budgets, action allowlists, human-in-the-loop approvals, and sandbox execution prevent agents from taking harmful or runaway actions
The core loop is Observe-Think-Plan-Act. The agent observes the current state, reasons about what to do, plans a sequence of steps, executes the next action, and repeats until the task is complete or a limit is reached
What is the defining feature that distinguishes an AI agent from a chatbot?
You now understand what makes an agent tick: the loop. The five ingredients -- LLM, loop, tools, memory, goal -- combine to create something qualitatively different from a chatbot. Next up, we will dive into the most important capability that makes the loop useful -- tool use. How does an LLM "reach for a calculator" when it needs one?