// loop_engineering

🍦

Loop & Scoop: Four Loops, One Till

Loop engineering taught on the smallest reconciliation in the world: an ice cream shop whose drawer is 125.30 short. Four loops, one cone, and an agent that ends up editing its own harness with the owner holding the pen.

deepagentsLangChainLoop EngineeringSelf-Improving AgentsHITLReconciliation

125.30

the gap to explain

till 1,412.50 vs drawer 1,287.20

6

scoops on the cone

4 on the card, 2 nobody wrote down

40→3

minutes of Marco

and the last three are the point

1 of 2

harness edits approved

the void check stays, by rule

loading visualisation...

// key_findings

  1. 01.

    Loop 1 is the one everyone builds and the one that quietly lies. Automating the four reasons on the laminated card clears 62.70 and leaves 62.60 unexplained, faster than before and no more correct.

  2. 02.

    Loop 2 is four lines of Python, not a model. The cone has to add up to the gap and every void has to be labelled 'ask Marco'. A deterministic checker that returns jump_to: model is cheaper and stricter than any LLM judge.

  3. 03.

    Loop 3 removes the human who starts the run, not the human who thinks. Thirty unattended nights is the win. Thirty nights of asking the same two questions is the tell that something upstream never learned.

  4. 04.

    Loop 4 is the loop nobody ships: the agent proposes a patch to its own memory and prompt, an eval suite scores it against a held-out split, and an acceptance gate rejects anything that is not a strict improvement.

  5. 05.

    The acceptance gate matters more than the optimiser. Disable it and the score wanders. Drop the generalise constraint and the training set hits 100% while held-out never moves, which is overfitting made visible rather than assumed.

  6. 06.

    Some minutes are waste and some are the job. The over/short habit gets learned once. The void run stays in front of a person forever, because a shop where nobody looks at the till voids is not efficient, it just has a problem it has not found yet.

// built_with

deepagents 0.6.12LangChain 1.3.14Python 3.12JupyterVanilla JS + CSS (zero-dependency demo page)

// methodology_note

The companion notebook runs all four loops against a live model. The demo page is self-contained and computes every figure in the browser from the same six scoops, so the numbers on screen are worked out rather than typed in.