AI Trailblazers · Week 4 of 5
Independent project:
the hackathon
Debug agents like a pro, then build your own MVP in a structured, time-boxed sprint.
Shape: 20 min theory + 100 min practical · You'll need: the Week 4 Colab notebook + your project scaffold
The shape of today
A short clinic, then you build
2 halves
- Theory (20 min): how agents break, and how to see the break before it costs you an hour.
- Practical (100 min): a phased hackathon — build, check in, expand, debug together.
Short theory on purpose — today is about your hands on your keyboard.
1
Part 1 · Theory
Debugging agentic systems
Concept · Why agents break
Three failure patterns
🌀 Hallucination
The model invents a fact or a fake tool result instead of calling a tool.
🔧 Tool error
Wrong args, bad URL, empty return — the tool ran but gave garbage.
📝 Prompt issue
Vague instructions → the agent loops, quits early, or ignores its tools.
⚠️ The trapAll three look the same from the outside — "wrong answer." Naming which one is 80% of the fix.
Concept · See the break
Log every Thought → Action → Observation
You can't fix what you can't see. Print each step so the failure point is obvious.
for step in range(6):
print(f"🧠 Thought: {resp.thought}")
try:
out = run(resp.tool, resp.args)
print(f"🔧 Action: {resp.tool}({resp.args}) → {out}")
except Exception as e:
print(f"❌ Tool failed: {e}") # catch, log, keep going
out = f"ERROR: {e}" # feed error back to agent
🔑 RememberA logged loop turns "it doesn't work" into "it broke on line 3, tool error." Add prints before you ask a coach for help.
⚡ Energizer · 8–10 min · teams
Bug Hunt 🐛
- Each team gets a printed agent transcript with 3 planted bugs.
- Find each one, classify it: hallucination / tool error / prompt issue.
- Write a one-line fix for each. Fastest correct team wins.
Printable transcript in Coach HQ → Week 4 energizer
2
Part 2 · Practical
The structured hackathon
Practical · The plan
Four phases, two check-ins
- Phase 1 · Foundation — 30 min: core loop + first tool + data source.
- Check-in — 15 min: share progress, solve one common issue.
- Phase 2 · Expansion — 40 min: 2nd tool + error handling + end-to-end.
- Debugging Clinic — 15 min: submit blockers, vote, solve together.
🎯 TargetBy the end: a working MVP that uses 2 tools and answers a real question. Not polished — working.
Phase 1 · Foundation · 30 min
Get one thing working
- Wire the core ReAct loop from the scaffold — don't rebuild it, adapt it.
- Add your first tool (one function that returns something real).
- Connect one data source (a CSV, an API, or mock data).
✅ Phase-1 done =Agent runs the loop, calls your one tool, and prints an answer — even a rough one.
Check-in · 15 min · together
Share progress, unblock as one
- Each student/team: one sentence on what works + one thing that's stuck.
- Coach picks the most common blocker and solves it live for the room.
- Quick wins get a shout-out — momentum is contagious.
🗣 FormatRound-robin, 15–20 sec each. No debugging in the circle — just name it. Fixes happen live after.
Phase 2 · Expansion · 40 min
Second tool + make it robust
- Add a 2nd tool or data source so the agent can chain steps.
- Wrap tool calls in try/except and log — feed errors back to the agent.
- Run it end-to-end on a real question and read the full transcript.
def query_data(question):
try:
return df.query(question) # real work
except Exception as e:
return f"Couldn't run that: {e}" # graceful, agent recovers
Debugging Clinic · 15 min · together
Crowd-solve the hard bugs
- Everyone drops their #1 remaining blocker in the shared doc.
- Room votes — pick the top 2 most-shared or most-interesting.
- Solve each live, naming the pattern: hallucination / tool error / prompt issue.
🔑 Why publicOne student's bug is usually five students' bug. Solving it out loud teaches the debugging method, not just the fix.
Support · Meet everyone where they are
Stretch or scaffold
🚀 Advanced stretch
Add a simple UI (Gradio), or a multi-agent setup — one plans, one executes.
🧩 Extra support
Pre-built tool templates to drop in, plus pair programming with a coach or peer.
🎚️ Same finish line, different pathsEveryone leaves with a working 2-tool MVP. How far past that is up to them.
Week 4 · Wrap
You built your own agent 🎉
- You can name the 3 failure patterns: hallucination · tool error · prompt issue.
- You logged the loop and used try/except to see and survive bugs.
- You shipped an MVP with 2 tools that answers a real question.
🏠 HomeworkGet your MVP to a clean, runnable state — 2 tools working end-to-end. Jot 3 bullets: what it does, one thing you're proud of, one thing to improve.
Next week → Polish & present: publish your Kaggle notebook and demo your agent to the group.