What an AI agent is
Chatbots talk. Agents act.
In Build Your Own AI Chatbot, Café Helper answered questions from the café's notes. Useful — but ask it "can I book a table for 4 on Saturday at 10?" and it can only guess, because it can't see the bookings. An AI agent can: it has tools (functions you write, like "check free tables") and it decides for itself when to use them.
| What it does | Who decides the steps | |
|---|---|---|
| Chatbot | Answers from what's in the prompt | Nobody — one step |
| Workflow | Runs a fixed series of steps, some using a model (sort the message, then answer it) | You, the developer |
| Agent | Uses tools in a loop until the job is done | The model |
The agent loop
- The model reads the conversation and decides: answer now, or use a tool?
- If it asks for a tool — say,
booking_times(date="2026-10-31", people=4)— your code runs the function - The result goes back to the model, which decides again: another tool, or answer?
The model never runs anything itself. It only asks; your code does the work, and decides what's allowed. That's the key to building agents safely.
When not to use an agent
Agents are flexible, but slower (several model calls per question) and less predictable. If you know the steps, a workflow is better: cheaper, faster and easier to test. Good agent builders use the simplest thing that works — and LangGraph handles both.
What is LangGraph?
LangGraph is a free, open-source Python library (from the company behind LangChain) for building workflows and agents as graphs: boxes for the steps (nodes), arrows for what comes next (edges), and a shared state that every step reads and updates. On top of that it gives you the hard parts agents need: memory, pausing for a person, and picking up where you left off.
What you'll build
Café Helper 2.0, step by step:
- Graphs with no AI at all, to learn the building blocks
- The model in a graph, and a workflow that sorts messages
- An agent with tools: search the café's notes, check free tables
- Memory that survives restarting the app
- Bookings that wait for a staff member to confirm, and handing complaints to a person
- A web app with a staff page — then testing and safety
Try it
- Think of a job at a café, shop or office. Which parts could an agent do with the right tools? Which should always need a person to say yes?
- Download the course files from this lesson.
Downloads
1 file to download once you enrol.
