A practical breakdown of the execution loop, tool calls, state management, and stop conditions behind modern AI agents.