← Tours

Build a minimal agent loop in 90 minutes

Engineers who want to internalize the irreducible structure before reaching for a framework.

90 minutes · 7 stops

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

BlockTime
Read the four containers (concept page)15 min
Read NanoClaw’s drill-downs25 min
Read Kimi Code’s drill-downs15 min
Read tool-calling-formats concept10 min
Read streaming-early-stop insight5 min
Read streaming-tools concept10 min
Skim Mistral Vibe’s middleware10 min

Output

After the tour, you should be able to defend three concrete decisions:

  1. Which container your agent uses (generator, while-loop, event log, graph) and why.
  2. Which tool format the agent and model agree on, with full understanding of cascading consequences.
  3. 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

  1. Agent loop concept

    The four containers (generator, while-loop, event-bus, graph). Read first; everything else attaches to one of these.

  2. NanoClaw project

    Smallest faithful Claude-shaped reproduction. Read its main loop end-to-end — ~200 lines of TypeScript, no production overhead.

  3. Kimi Code project

    OpenAI-style tool calling reference at minimal scale. Compare against NanoClaw to see how format choice shapes everything else.

  4. Tool calling formats concept

    Three formats with different tradeoffs. Decide which one your loop will speak; the parser shape falls out.

  5. 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.

  6. Streaming tool calls concept

    Streaming earns three things at once — UI feedback, early dispatch, and (with the right format) the early-stop trick.

  7. Mistral Vibe project

    Middleware-based dispatch. See what an actively-extended loop looks like once you're past the prototype phase.