Master the three core loop engineering patterns—Retry, Reflect, Escalate—that make AI agents reliable in production. Step-by-step guide with pro tips for AI