What makes an AI agent
'Agent' is the most hyped word in AI. This module gives you precise definitions — and the judgement to know when an agent is the right tool.
Learning objectives
- Define workflows and agents
- Describe the augmented LLM building block
- Decide when an agent is justified
- Place systems on an autonomy spectrum
Examples are Python and run in a free notebook such as Google Colab. They use Anthropic's Python SDK because its tool-use format is compact; OpenAI, Google and Microsoft SDKs follow the same pattern with slightly different field names. You'll need your own API key, and you should replace YOUR-MODEL-NAME with a current model from your provider's documentation.
1.1 From chatbots to agents
A chatbot answers. An agent pursues a goal: it decides what to do next, uses tools — search, code, files, APIs — observes the results, and keeps going until the job is done or it needs help.
Anthropic's widely cited guide Building effective agents (December 2024) draws a useful line between two kinds of "agentic system":
Workflows
LLMs and tools orchestrated through predefined code paths. You decide the steps; the LLM does the work inside each step. Predictable and easier to test.
Agents
LLMs that dynamically direct their own processes and tool usage, typically in a loop guided by feedback from the environment. Flexible, but less predictable and more expensive.
1.2 The building block: an augmented LLM
Every agentic system starts with an LLM augmented with three capabilities:
- Tools — functions it can call to fetch information or take actions (Module 2).
- Retrieval — access to knowledge, for example through RAG (see the RAG course).
- Memory — information carried across steps or sessions (Module 4).
1.3 When to use an agent — and when not to
The most important design advice from practitioners is: start with the simplest thing that works. Often that's a single well-prompted LLM call with retrieval. Add workflows when a task splits naturally into fixed steps. Reach for an autonomous agent only when:
- the steps can't be predicted in advance (open-ended problems);
- the task benefits from trying, observing and adjusting;
- success can be checked (tests pass, data reconciles, the user confirms);
- the extra cost, latency and risk are worth it.
Coding agents are a strong fit: the steps are open-ended, but tests give clear feedback. A refund-approval process with fixed rules is a poor fit: a workflow is safer and cheaper.
1.4 The autonomy spectrum
| Level | What the AI does | Example |
|---|---|---|
| 1. Assistant | Suggests; a human does everything | Drafts an email reply |
| 2. Workflow | Executes fixed steps you designed | Classify ticket → retrieve policy → draft reply |
| 3. Supervised agent | Plans and acts; a human approves key actions | Researches and prepares a refund, waits for approval |
| 4. Autonomous agent | Plans and acts within boundaries, reports back | Fixes failing tests in a sandbox and opens a pull request |
Move up the ladder only as far as the task needs and your safeguards allow.
Key takeaways
- Workflows follow predefined code paths; agents direct their own steps and tool use.
- Agents are built from an LLM augmented with tools, retrieval and memory.
- Start simple; use agents for open-ended tasks with checkable success.
- Move up the autonomy ladder only as far as needed and as safeguards allow.