By the end of this week you can
- Place automation, machine learning, generative AI, and agents on one map
- Tell a tool, a workflow, and an agent apart with one question
- Trace a real agent's Think → Act → Observe loop step by step
- Name an agent's five parts and choose a sensible level of autonomy
Part 1
The AI family, in one picture
"AI" gets used for everything, so start with precise terms. They nest inside each other:
A rule that emails a reminder every Friday is automation. A spam filter that learned from millions of examples is machine learning. A chatbot that drafts an essay is generative AI. A system that takes a goal, decides its own steps, uses tools, checks results, and keeps going is an agent.
Part 2
Tool, workflow, or agent? One question decides
Who decides what happens next? Nobody (it answers once and stops) → a tool. The developer, in advance → a workflow. The AI itself, as it goes → an agent.
| Tool / chatbot | Workflow | Agent | |
|---|---|---|---|
| Who picks the steps? | No steps | The developer | The AI, at run time |
| Takes actions? | Rarely | Yes, in a fixed order | Yes, chosen as it goes |
| Adapts to results? | No | Only planned branches | Yes |
| Example | "What's the capital of Kenya?" | Every new form is summarised and emailed to a teacher | "Find out why club sign-ups dropped and draft a plan" |
Workflows are predictable and cheap; agents are flexible but cost more and are harder to test. Good builders use the simplest option that works.
Part 3
The loop every agent runs
Here is a real trace of an agent asked to plan a study schedule:
Notice the last step: adding to your calendar changes something outside the conversation, so a well-designed agent asks first.
Part 4
Five parts of every agent
The language model that reasons and decides the next step.
The system prompt: role, goal, rules, boundaries.
Search, calculators, calendars, databases, email — ways to act.
What it can see now, plus what it saved from before.
The code that runs the loop, enforces limits, and asks for approval.
Only the orchestration code actually runs a tool — that's where safety lives.
Autonomy is a dial, not a switch
| Level | What it does | Example |
|---|---|---|
| 1 · Assistant | Suggests; you do everything | Autocomplete in a document |
| 2 · Copilot | Drafts actions; you approve each one | Drafts an email you review and send |
| 3 · Supervised agent | Acts alone on low-risk steps, asks before risky ones | Books a study slot, asks before inviting others |
| 4 · Autonomous agent | Works end to end inside set boundaries, monitored | Tidies your files every night, with a log |
Lab A · No code
Watch a real agent work
Trace an AI assistant's loop on a real task
Use any AI assistant that can search the web and shows its steps — for example ChatGPT with search, Gemini, Perplexity, or Claude with web search. Use the one your school or workplace allows.
- Ask a one-shot question
Type:
What is the capital of Kenya?Notice it answers once and stops — tool behaviour. - Give it a goal instead
Paste the goal below. Open any "searching" or "thinking" panel it shows.
Plan a 3-day study schedule for a biology test next Friday on cell transport and genetics. Find two reliable sources to study from, and list each source with its link.Expect: several searches, pages opened, and a plan with links — multiple steps chosen by the AI. - Write the trace
For each step you can see, note THINK (what it was trying to find), ACT (what it searched or opened), OBSERVE (what it learned). Use the activity form below.
- Verify one claim
Open one of its links. Does the page actually support what the assistant said? Note any mismatch.
- Find the approval point
Ask:
Add this plan to my calendar and invite my study group.Does it ask first, refuse, or do it? Which of those is right, and why?
Lab B · For developers
Build the agent loop in Python
Agent Fundamentals: from API call to agent loop
Write the tool-calling loop from scratch with real weather and Wikipedia APIs, measure agent vs workflow cost, then rebuild it in Pydantic AI and the OpenAI Agents SDK.
- Metered model calls: tokens, latency, cost
- Hand-written tool schemas and the loop in ~40 lines
- Typed output, usage limits, approval-gated tools
- Exercises with automatic checks
Needs Python and your own OpenAI or Anthropic API key (about US$0.05 for this lab). Start with the environment check.
Who owns this agent's decisions?
When an agent gets something wrong, "the AI did it" is never the answer. Responsibility sits with people: whoever built it, whoever deployed it, and whoever relied on its output. That's why good agents ask before actions that can't be undone or that affect other people.
The apps you map in this week's activity also collect data about you to make their decisions. Look at what they collect — you usually have a say in it.
Map an agent you use
Choose the assistant from Lab A, or any "smart" product you use (recommendations, navigation, a tutoring app). Map its loop.