Foundations: What Is an AI Agent?
Module 1 — Foundations: What Is an AI Agent? 🧠
Goal of this module: By the end, you’ll clearly understand what an AI agent is, how it’s different from a regular chatbot, and the “loop” that makes agents work. This is the foundation for everything else.
1.1 Start with something you know: a chatbot
When you type a question into ChatGPT and it replies, that’s a chatbot. It works like this:
You ask a question → The AI answers → Done.
It’s a single back-and-forth. The AI reads your message and produces text. It cannot do anything in the real world — it can’t check today’s weather, send an email, run code, or look something up. It only predicts words.
Think of a chatbot like a very smart friend on the phone who has read almost the entire internet (up to a certain date) but is locked in a room with no phone, no computer, and no window. They can talk about anything, but they can’t do anything or check anything new.
1.2 Now, the big idea: an agent
An AI agent takes that smart friend and gives them:
- Tools — a calculator, a web browser, the ability to run code, send emails, etc.
- A goal — not just “answer this message,” but “accomplish this task.”
- The ability to take multiple steps — think, act, see what happened, think again.
- Memory — so it can remember what it learned earlier.
So instead of one question and one answer, an agent does something like:
Goal: "Book me the cheapest flight to London next Friday."
Step 1: Think → "I need to search for flights first."
Step 2: Act → Uses a flight-search tool.
Step 3: Observe→ Sees a list of flights and prices.
Step 4: Think → "The cheapest is £90 at 7am. Let me confirm dates."
Step 5: Act → Checks the calendar tool for next Friday's date.
Step 6: Think → "Confirmed. I'll present this option."
Step 7: Answer → "The cheapest flight is £90, departing 7am Friday."
See the difference? The agent decides what to do next on its own, repeatedly, until the goal is done.
Key insight: A chatbot responds. An agent acts toward a goal over multiple steps.
1.3 The Agent Loop (the most important concept in this course)
Almost every AI agent runs on the same simple cycle. Memorize this — it’s the heartbeat of every agent:
┌────────────────────────────────────┐
│ │
▼ │
1. THINK → 2. ACT → 3. OBSERVE ───────┘
(reason) (use a (see the
tool) result)
...repeat until the goal is reached, then → 4. RESPOND
Let’s define each part in plain English:
- THINK (Reason): The language model looks at the goal and everything that has happened so far, and decides what to do next. (“I should search the web.”)
- ACT (Take action): The agent uses a tool to actually do something. (“Calling the web_search tool with query ‘weather in Paris’.”)
- OBSERVE (Get the result): The tool returns an answer, and the agent reads it. (“The result says: 18°C and rainy.”)
- Repeat: With this new information, the agent thinks again. Maybe it’s done, maybe it needs another step.
- RESPOND: When the goal is achieved, the agent gives the final answer.
This think → act → observe loop is sometimes called the ReAct loop (Reason + Act). We’ll go deep on it in Module 5. For now, just remember the rhythm.
1.4 A concrete example, step by step
Your request: “What’s the population of the country where the Eiffel Tower is, multiplied by 2?”
A plain chatbot might guess from memory and could be out of date. An agent does this:
THINK: "The Eiffel Tower is in France. I need France's current population. I'll search."
ACT: web_search("current population of France")
OBSERVE: "About 68.4 million (2024)."
THINK: "Now I multiply 68.4 million by 2. Let me use the calculator to be safe."
ACT: calculator("68,400,000 * 2")
OBSERVE: "136,800,000"
THINK: "I have the answer."
RESPOND: "France has about 68.4 million people, so doubled that's about 136.8 million."
Notice three things:
- The agent chose to search and to calculate — nobody told it the exact steps.
- It used two different tools for two different sub-tasks.
- Each step’s result shaped the next decision.
That’s agency. 🎯
1.5 The anatomy of an agent (the parts)
Every agent is built from a handful of building blocks. Here’s the whole picture — we’ll spend a module on each:
| Component | Plain-English job | Module |
|---|---|---|
| The Model (LLM) | The “brain” that thinks and decides | 2 |
| Planning | Breaking a big goal into small steps | 3 |
| Tools | Hands and senses — search, code, APIs | 4 |
| Reasoning loop | The think-act-observe cycle | 5 |
| Memory | Remembering facts across steps and sessions | 6 |
| Reflection | Checking and fixing its own work | 7 |
| Orchestration | Coordinating multiple agents | 8 |
Picture it like a person:
- The LLM is the brain.
- Tools are the hands and eyes.
- Memory is, well, memory.
- Planning is the to-do list.
- Reflection is self-doubt (“wait, did I get that right?“).
1.6 Words you’ll hear a lot (mini-glossary)
- LLM (Large Language Model): The AI model (like GPT-4, Claude, Llama) that predicts text. It’s the brain. More in Module 2.
- Prompt: The text instructions you give the model.
- Token: A chunk of text (roughly ¾ of a word). Models read and write in tokens.
- Tool / Function: Something the agent can call to do an action (search, calculate, send email).
- Context window: The model’s short-term “working memory” — how much text it can consider at once.
- Autonomy: How much the agent decides on its own vs. asking a human.
(Full glossary is in Module 13.)
1.7 Levels of autonomy (how “free” is the agent?)
Not all agents are equally independent. A helpful way to think about it:
- Level 0 — Assistant: Answers questions, no actions. (A plain chatbot.)
- Level 1 — Tool-using assistant: Can call tools when asked, one step at a time.
- Level 2 — Multi-step agent: Plans and runs several steps to reach a goal, checking in with you for big decisions.
- Level 3 — Autonomous agent: Runs many steps on its own, only stopping for approval on risky actions.
- Level 4 — Multi-agent system: A whole team of agents collaborating.
As autonomy goes up, so does usefulness — and risk. That’s why Module 11 (Safety) matters so much. More freedom means more chances to make an expensive mistake, so good agents are designed to ask permission before doing anything irreversible (like spending money or deleting files).
1.8 Why agents matter (why you’re learning this)
Agents are a huge shift because they turn AI from a “thing that talks” into a “thing that does work.” Examples already in the real world:
- Coding agents that read your codebase, write code, run tests, and fix bugs.
- Research agents that browse dozens of sources and write a report.
- Customer-support agents that look up your order, issue a refund, and email you.
- Personal assistants that manage your calendar and inbox.
Learning to design and reason about agents is one of the most valuable AI skills right now. You’re in the right place. 💪
1.9 Check yourself ✅
Try answering these before moving on (answers below):
- In one sentence, what’s the difference between a chatbot and an agent?
- Name the three repeating steps of the agent loop.
- In the Eiffel Tower example, why did the agent use two tools?
- What does “context window” mean?
Answers
- A chatbot responds to a single message; an agent takes multiple actions toward a goal, deciding each step itself.
- Think (reason) → Act (use a tool) → Observe (read the result).
- One tool (web search) found a fact; the other (calculator) did the math. Different sub-tasks need different tools.
- The amount of text the model can “see” at once — its short-term working memory.
1.10 Summary
- A chatbot answers; an agent acts toward a goal over multiple steps.
- The agent loop is: Think → Act → Observe → (repeat) → Respond.
- An agent = LLM (brain) + Tools (hands) + Memory + Planning + Reflection.
- Autonomy comes in levels; more autonomy = more power and more risk.
Next up: Module 2 — the brain itself. How does the LLM actually think, and how do we talk to it? 👉 02_LLMs_And_Prompting_For_Agents.md