Tour — Build a minimal agent loop in 90 minutes
By the end you should be able to whiteboard an agent loop without notes and explain every box to a teammate.
Pacing
| Block | Time |
|---|---|
| Read the four containers (concept page) | 15 min |
| Read NanoClaw’s drill-downs | 25 min |
| Read Kimi Code’s drill-downs | 15 min |
| Read tool-calling-formats concept | 10 min |
| Read streaming-early-stop insight | 5 min |
| Read streaming-tools concept | 10 min |
| Skim Mistral Vibe’s middleware | 10 min |
Output
After the tour, you should be able to defend three concrete decisions:
- Which container your agent uses (generator, while-loop, event log, graph) and why.
- Which tool format the agent and model agree on, with full understanding of cascading consequences.
- What your streaming parser shape looks like, including whether you can early-stop on the closing tag.
What to skip
Caching, compaction, multi-agent — all out of scope for this tour. Foundations only. The minute you have a loop you trust, then layer the rest.
Then
For Swisscheese / multi-agent work, follow with Multi-agent coordination. For governance / GRC work, follow with Guardrails and Memory deep dive.
Itinerary
-
Agent loop concept
The four containers (generator, while-loop, event-bus, graph). Read first; everything else attaches to one of these.
-
NanoClaw project
Smallest faithful Claude-shaped reproduction. Read its main loop end-to-end — ~200 lines of TypeScript, no production overhead.
-
Kimi Code project
OpenAI-style tool calling reference at minimal scale. Compare against NanoClaw to see how format choice shapes everything else.
-
Tool calling formats concept
Three formats with different tradeoffs. Decide which one your loop will speak; the parser shape falls out.
-
Streaming early stop on </function> insight
A free 10–20% cost reduction if you commit to one tool call per turn. Decide your stance now.
-
Streaming tool calls concept
Streaming earns three things at once — UI feedback, early dispatch, and (with the right format) the early-stop trick.
-
Mistral Vibe project
Middleware-based dispatch. See what an actively-extended loop looks like once you're past the prototype phase.