Systems Design · AI
Agentic Loops
How an AI tries, learns from mistakes, and keeps going until done.
1. Asking vs Doing
A simple chatbot waits for you to type every move; a loop keeps working toward the goal on its own.
Why is a loop better?
Complex jobs like fixing broken software require many tiny steps. If you had to approve every line read, you would do all the work yourself.
2. Learning from the error message
A real loop looks at why an attempt failed and uses that clue to change its next move.
What if it just repeats the mistake?
If the AI repeats the exact same mistake without changing anything, that is a broken retry. A true loop feeds the error back into its thinking context.
3. The finish line rule
The loop stops only when real tests pass, not when the AI claims it is done.
Why trust tests over words?
AI models can sound completely convincing while writing broken code. Testing the actual output with a computer compiler prevents hallucinated completions.
Longer version: Reference Entry on Agentic Loops
Sources: Addy Osmani (2026); Lilian Weng (2023); Anthropic Research (2024).