← Course Home
Phase 1 · Week 1
10 minutes
Lesson 1.2a
Lesson 1.2a

From Prompts to Pipelines: The Anatomy of an AI Agent

Slide 1

What You Will Learn

Three goals. First, you will be able to explain clearly why an AI agent is fundamentally different from a chatbot. Second, you will know the names and definitions of the five components every agent is built from. Third, you will apply that framework to a real-world scenario and see how it maps onto something concrete.

Slide 2

The Answer vs The Worker

What a chatbot does

A chatbot operates on a simple loop: one question in, one answer out, done. Ask it what time it is in Tokyo and it tells you. Each exchange is independent. It has no memory of what was said before unless explicitly shown the history. It does not take action in the world. It does not call APIs. It responds and stops.

What an agent does

Give an agent a goal — 'Book me a flight to Milan next Tuesday. Hotel near the centre under 150 euros. Add both to my calendar and send me a summary' — and something fundamentally different happens. The agent does not produce one response. It executes a sequence of actions: searching a flight booking site, searching hotel sites, writing to a calendar API, drafting and sending a summary email.

The One-Sentence Test
The chatbot answers. One prompt → one response.
The agent works. One goal → many actions. Autonomous.

The Five Components of Every AI Agent

Slide 3

Every agent — simple or complex, no-code or full-code — is built from exactly five components.

Slide 4
#ComponentDefinition
01PerceptionHow the agent receives information. Text, documents, API responses, live web feeds. If it is not in the perception layer, the agent is blind to it.
02PlanningHow the agent decides what to do. The LLM reasons through what actions are needed, in what order, and what to do if something fails.
03Tool UseThe agent's hands. Web search, calculators, database queries, email APIs, code executors. The agent calls these tools and uses their results to take action in the world.
04MemoryShort-term: the current session context. Long-term: a database the agent reads and writes across sessions, enabling it to remember over time.
05Feedback LoopThe agent checks its own output before considering the task complete. This is what prevents silent failures.
Slide 5
Watch: Andrew Ng on AI Agents — BUILD 2024 Keynote (20 min)

Worked Example: The School Flu Sentinel

Slide 3
Scenario
An agent monitors a public health data feed every morning. When flu cases in the local region cross a threshold, it emails a bulletin to school administrators with recommended actions.
Perception
Reads the public health feed every morning — today's local flu case count.
Planning
Compares today's count vs last week's. Decides whether the threshold is crossed and action is needed.
Tool Use
Calls an email API to send the administrator bulletin.
Memory
Stores last week's count to calculate the change. Without memory, it cannot detect trends.
Feedback Loop
Before sending, checks the feed was updated today — not stale. Prevents false alarms.
Slide 7
Key Insight
Five components. One agent. A task that used to require a human to check a website every morning now runs automatically, reliably, and without being prompted.

White Box vs Black Box Agents

Not all agents work the same way under the hood. One of the most important distinctions in agent design — especially in scientific and medical domains — is whether the agent's reasoning is transparent and inspectable, or opaque and probabilistic.

Black Box Agents (LLM-based)

Most modern agents are built on large language models. When you ask the agent why it made a decision, it can explain its reasoning in natural language — but that explanation is itself generated by the model, not extracted from a verifiable internal process. You cannot trace the exact path from input to output. This makes LLM-based agents powerful but difficult to audit in safety-critical settings.

White Box Agents (Rule-based or Algorithmic)

A white box agent is one whose decision-making is fully transparent and inspectable. Every step of the reasoning can be traced, verified, and explained. Guido Putignano, bioERGOtech's director, described a real example from biomedical engineering research:

White Box Agent Example — Biomedical Research
Perception
The agent reads microscopy images of cells and extracts quantitative measurements — size, shape, intensity, and spatial distribution.
Planning
It runs a defined algorithm — a sequence of mathematical operations with no probabilistic guessing. Every decision point follows an explicit rule.
Tool Use
It calculates shear stress — the mechanical force exerted on cells — using established fluid dynamics equations applied to the extracted measurements.
Memory
It retains the previous state: what the measurements were in the last frame, so it can track changes over time and detect anomalies.

In this agent, you can audit every step. If the shear stress calculation is wrong, you can trace exactly which measurement was off, which formula was applied, and where the error occurred. This matters enormously in research and clinical contexts where results feed into publications or patient decisions.

Key Insight
White box agents are preferred when auditability, regulatory compliance, or scientific reproducibility is required. Black box LLM agents are preferred when the task involves natural language, ambiguous inputs, or requires flexible reasoning. The best systems often combine both — an LLM for language understanding, and a deterministic algorithm for the critical calculation.
✏️ Student Reflection
Pick one repetitive task from your week. Describe how an agent could handle it using all five components: What would it perceive? What would it plan? What tools would it use? What would it need to remember? How would it check its own work? Write one paragraph, 4–6 sentences. Be specific.

📝 Your Lesson Submission

Share your reflection, ask a question, or leave a comment. Your mentor will respond.

🔐

You need to be logged in to submit your reflection.

← Previous1.1What Is AI, and What Is Generative AI?
Next →1.2bInside the Machine: How LLMs Work and How to Host Them🔒 Submit reflection to unlock
🔐

Create a Free Account to Continue

Lesson 1.1 and beyond are available to enrolled members. Join the program for free to access all 21+ lessons, mentor sessions, and your completion certificate.

🎓 Join the Program — It's FreeAlready a member? Log in