Anatomy of an agent · ReAct · Kaggle · build a working DataFetcher.
Shape: 30 min theory + 90 min practical · You'll need: the Week 2 Colab notebook + a free Gemini key
The shape of today
Theory, then a real build
2 halves
Theory (30 min): what makes something an agent + the Kaggle world.
Practical (90 min): build a DataFetcher agent, then touch real data.
Plus a 12–15 min energizer where you become the agent loop.
1
Part 1 · Theory
Anatomy of an AI agent
Concept · Four parts
Plan → Tools → Memory → Action
🧠 Planning
Break the goal into steps; decide what's next.
🛠️ Tools
Abilities it lacks: search, calculator, code, files.
📓 Memory
Hold what it found so steps build on each other.
⚡ Action
Call a tool, read the result, loop till done.
🕵️ Analogy: a detective
Theory (plan) → check records (tools) → case file (memory) → follow leads (action), looping until solved.
Concept · The loop
ReAct = Reason + Act
Thought → "I need today's AI-education headlines."
Action → search_web("AI in education 2026")
Observation → [3 articles]
Thought → "Now summarize into 3 bullets."
Action → summarize_text(articles)
🔑 Remember
Reason → Act → Observe → repeat. Every agent you build is a version of this loop.
Concept · Kaggle
Kaggle = your portfolio home
Competitions — real problems + leaderboards ("Getting Started" = beginner).
Datasets — thousands, free, one line to load.
Notebooks — publish your work as a shareable link.
💼 Why it matters
A public Kaggle notebook is a résumé/college-app link that proves you built something real. You'll publish one in Week 5.
⚡ Energizer · 12–15 min · on your feet
The Human ReAct Loop
Teams of 4: Brain (Thought+Action), Hands (tool), Memory (writes it), Narrator.
Round 1: answer with no tools → guess wrong. Round 2: loop with tool cards → find out.
Printable card in Coach HQ → Week 2 energizer
2
Part 2 · Practical
Build the DataFetcher
Build · Step 1
Tools are just functions
defsearch_web(query): # returns mock news (reliable)return MOCK_NEWS
defsummarize_text(text): # asks Gemini for 3 bulletsreturn gemini(f"Summarize in 3 bullets: {text}")
Note
Mock data keeps class reliable — swap in a real news API anytime.
Build · Step 2 — the agent
The loop is the agent
for step in range(6): # safety cap
resp = gemini(history, tools=[...])
if resp.wants_tool: # Thought → Action
out = run(resp.tool, resp.args)
history += observation(out) # → Memoryelse:
print(resp.text); break# goal reached
Build · Step 3
Point it at real data
import pandas as pd
df = pd.read_csv(TITANIC_URL) # one line
df.groupby("Sex")["Age"].mean() # avg age by gender
🔎 Preview
Next week you'll wrap queries like this in tools so an agent answers data questions on its own.
Week 2 · Wrap
You built an agent 🎉
Agent = Plan → Tools → Memory → Action, run as ReAct.
You gave an LLM tools and ran the loop.
You loaded real data and asked a question.
🏠 Homework
Explore one "Getting Started" Kaggle competition · jot a first project idea in the shared template.
Next week → Data-analysis agents (tools over the Titanic) + scope your own project.
AI Trailblazers · Week 2 — Building Agents · press S for coach notes