How Do AI Agents Work? The Agent Loop, Explained

A mechanical walkthrough of how AI agents actually work: the goal-plan-act-review loop, how tool calling functions, and why agents still fail on long tasks.