The Agentic Loop: Three Loops in a Trench Coat

I argue that agentic systems aren't just a single cycle but three distinct loops working together. The Inference Loop handles LLM chat completions, the Tool Loop executes functions, and the crucial Human Loop ensures safety by requiring approval before actions occur. Understanding this structure is essential for building robust AI agents that truly benefit users.
The human loop is necessary, because it's the only thing stopping Tom from actually sending that message to Laney.
- philipwhiuk
Aren't the loops the wrong way round in the diagram. The tightest loop is the inference loop, then the tool loop and then human loop?
- tptacek
You can always find more loops if you want to write the next version of this post. Anything that runs software is a loop of instruction execution.
- swyx
there are more than 3: https://www.latent.space/p/loopcraft
- otekengineering
those are rookie numbers, my agent harness goes way more than 3 loops deep, and the depth dynamically ebbs and flows throughout the development process. like most brags, i'm being defensive over a personal tool that i know has ballooned way too big, but building a token-fueled katamari ball that rolls itself uphill has been a fun way to imagine Sisyphus happy.
a harness is a chain connecting two other chains, the LLM and the human are themselves made up of loops within loops within loops.
- bicepjai
I like how you found the pattern of 3 loops. I am working on a similar blog where I had human loop outside the inference loop :) human -> llm-> tool