Replaying any step
Part 2’s eight steps are eight commits, and the code runs at every one of them. That is a deliberate constraint, and it makes the repository itself a teaching tool.
git clone https://github.com/nhial/building-ai-agentscd building-ai-agents
git log --oneline -- part2/ # the syllabus4d7b7d5 part 2 · step 1: the alert and the fixtures498a253 part 2 · step 2: the model call3291bed part 2 · step 3: the tools and their schemas3b34216 part 2 · step 4: the tool loop148436b part 2 · step 5: intake and enrichment5b1e8ca part 2 · step 6: deterministic risk scoring8bcfb29 part 2 · step 7: the case worker8c3b685 part 2 · step 7: the orchestrator and the human gate3082d1f part 2 · step 8: the audit trailJump to any of them and run it exactly as it was:
git switch --detach 3b34216 # step 4, the tool loopcd part2 && uv run --with ollama run.pycd .. && git switch main # come back--detach means you are looking at a commit rather than working on a branch —
exactly what you want for reading. git switch main returns you.
What this is good for
Section titled “What this is good for”Watching an idea arrive. The most useful thing in the history is the diff between two adjacent steps:
git diff 5b1e8ca 8bcfb29 -- part2/ # what the Case worker addedEvery step is small enough that its diff is readable in one screen. That is the constraint that shaped the commits: if a step needs a long explanation, it’s two steps.
Seeing a failure that no longer exists. Failure 1 — the invented merchant — only happens at step 2, before tools. You cannot reproduce it from the finished code. You can check out step 2 and watch it happen:
git switch --detach 498a253cd part2 && uv run --with ollama run.pyThe rule that makes it work
Section titled “The rule that makes it work”Every commit runs. No exceptions. A step that errors is not committed.
This costs something while building — sometimes an idea has to be split, or a stub written so the pipeline still completes. It buys a property nothing else gives you: you can never be reading code that doesn’t work. When a step behaves oddly, that is the lesson, not a bug in the course.
The two other rules that go with it:
- One step, one commit. Message format:
step N: what it adds. - Small. Each step adds one idea.
Doing this in your own work
Section titled “Doing this in your own work”You do not need a course to benefit from this. Any prototype someone else will have to understand is improved by commits that each add one thing and each run. The audience is usually you, four months later, trying to remember why a piece exists.
The version worth stealing: when you build something to learn it, commit at every point where it worked. Not at the end. The intermediate states are where the understanding actually lives, and they are gone forever if you squash them into “add fraud triage agent”.