PDF · Free download
Keep this guide as a PDF
Loop Engineering — The Complete Guide, as one file you can read offline and share with your team.
Sign in with Google or GitHub to download.
What this course is
This is the complete written course behind the video "The Inner Loop, the Outer Loop, and the Gate." The video is the tour; this is the whole machine, one part at a time. It takes you from "I prompt my agent" to "I can look at any agent system, name its two loops, name its runner, and say exactly what makes its loop safe to leave running."
Most explanations of loop engineering fail for the same reason: they are built on a vocabulary you were never given. Words like agent, tool, context, memory, and hook get used as if everyone already shares a precise definition. This course refuses to do that. It installs ten words first, then builds every chapter out of exactly those ten and nothing else.
What's inside the 57-page PDF
Part I — What a loop actually is
- The ten words you must own — the vocabulary the rest of the field skips, with an example and a common misconception for each.
- An agent is already a loop — the one idea the whole course turns on.
- The two loops — the inner turn your agent already has, and the outer one that decides to run it again.
- The missing machine: the runner — the non-intelligent part that re-summons the model, and the five runners every agent loop in the wild is built from.
- The full chain — spec → runner → agent → tools → gate, and why the loop itself never runs a single command.
Part II — What makes a loop worth running
- Memory: the loop's spine — the one property that separates a loop that learns from a loop that only repeats.
- The gate — why an agent will tell you it's done when it isn't, and how a real stop-condition catches it.
- Loops you can trust — the one universal move, the line between a demo and production, and a checklist that would have prevented most of the public agent failures of the past two years.
- A real, running example — a four-line shell runner, a
PROMPT.mdspec, and apytestgate you can build with your own hands.
Use it this week
Read it once, then build the running example against a real task you actually ship. Bounding the loop — making non-deterministic software safe enough to act in the real world — is the whole of what we mean by AI Reliability Engineering.
This is Volume 1 of 3. Volume 2 picks up at the gate and memory in depth — what happens when the loop trusts the agent's word instead of a fact.