autonomous optimization loop

Extracted from: teaching-your-ai-agent-to-learn-from-its-mistakes/index.md