Skip to content

Tutorials

Four short, hands-on tutorials that build up the Python runtime piece by piece. Every code sample is real - copy it, run it, and you'll get exactly the output shown. None of them need an API key.

If you just want the fastest path to a scaffolded project, use the quickstart and the CLI instead - these tutorials are for understanding the runtime you're scaffolding.

  • 1. Your First Loop

    Build the smallest possible loop: one goal, one step, six components. See the state machine move through a full iteration.

  • 2. Recovery and Resilience

    Make a step fail on purpose. Watch the engine retry it, then see how AdaptiveRecovery chooses a different strategy per failure type.

  • 3. Deterministic Gates

    Reject bad input before it reaches a model call, following Stripe's "Minions" pattern - rule-bound checks stay out of the probabilistic model.

  • 4. Persistence and Human Checkpoints

    Survive a restart. Learn where the JSON round-trip is intentionally partial. Put a human at the one door that should stay open.

Prerequisites

git clone https://github.com/chillum-codeX/loop-engineering.git
cd loop-engineering
pip install -e .

Every snippet in this series uses plain Python components - no LLM client, no API key. When you're ready to put a real model behind a component, swap in LLMPlanner / LLMActor / LLMEvaluator from loop_engine.components, which follow the exact same interfaces you'll have already seen.

After the series