AI agent loops that finish, verify, and stop.
The code behind the daily Loop Engineering video series: reliability patterns for AI agents — implemented, commented for adaptation, and tested. Not a framework. Small, readable modules you copy into your project and own.
A new episode airs daily; its code lands in the library. The price rises as the collection grows — early buyers keep every update free.
Watch free. Run instantly. Own forever.
Watch
A new Loop Engineering episode airs daily on the AIS YouTube channel — one reliability pattern per day, free. The videos teach the why.
Run
Unzip the library and run any pattern instantly: pure Python 3.10+, zero dependencies, no API key. A deterministic mock model is included; every example ships with its tests.
Own
Plug your real LLM client into one file, copy the patterns into your project, and keep them forever. As episodes air, their code lands in your library at no extra cost.
What’s in the library
Thirteen patterns today — one new pattern with every episode of the series, from foundations through hardening to fleet-scale orchestration. Season 1 is 77 episodes.
Every example runs out of the box and ships with its own checks. The library about verification is itself verified — we run every test before every release.
# no install, no dependencies, no API key cd ep01-stop-conditions python stop_contract.py # watch the pattern run python test_stop_contract.py # prove it works on your machine # then plug YOUR model into one file (core/model.py) # and copy the pattern into your project
Stop contracts
The four-part contract (success check, retry budget, escalation, evidence) and a bounded runner that can never run forever or fail silently.
Maker / Checker
The producer never grades its own work; a separate checker returns evidence-anchored verdicts and focused repair packets.
State, not transcript
Truth lives on disk; kill the loop any time and resume from state, never from zero.
Worktree per agent
Parallel agents in isolated git worktrees: attributable, scope-checked, merge-gated.
The minimal agent loop
The smallest correct loop: the model is rented, the loop is owned, every exit bounded and evidenced.
Structured output
Schema-validated model output with precise, bounded repair when it doesn't conform.
Retry budgets
Three ceilings (attempts, tokens, seconds), checked before spending, with itemized bills on exhaustion.
Idempotent steps
Every side effect keyed and ledgered: run the whole job twice, nothing happens twice.
Smallest viable step
Stepwise loops that localize failure, keep progress, and make replanning free.
Failure classification
Five failure classes routed to five different recoveries with separate budgets; repeat wounds force a replan.
Idempotent tool calls
Operation keys embedded in the created object, read-act-verify against the remote system, duplicates escalated — a timeout is never proof the write failed.
Shadow mode
The L0-L4 autonomy ladder: decide everything, execute nothing, promote on arithmetic, and a kill switch that outranks the ladder.
Budget controller
Cheapest-capable model routing, progress signals per iteration, stop at the quality threshold even with budget left, replan on diminishing returns.
Where it sits
Free demos & tutorials
- · Happy-path only — no stop conditions
- · No tests, no failure paths
- · Break the moment reality shows up
Loop Engineering Code Library
from $49 · one-time- · Reliability patterns, implemented + tested
- · Runs offline — no API key, no dependencies
- · Grows with the daily series; updates free
- · Model-agnostic: works with any LLM
Agent frameworks
- · Heavy abstractions you don’t control
- · Framework churn every quarter
- · The reliability layer is still on you
Get the library
$49 one-time · no subscription · covers your whole team
- ✓ Every pattern from the series, implemented + tested
- ✓ Pure Python 3.10+ · zero dependencies · no API key
- ✓ Mock model included — swap in your real client in one file
- ✓ Free updates as new episodes air — buy once
- ✓ Email support at support@aislabs.ai
The honest deal: the price steps up as the library reaches milestones (15, 32, and all 77 patterns). Whatever you pay, you keep every future update free. Buying early is the discount. Digital downloads are final sale — watch any episode and run the free snippets first; what you see is exactly what you get.