How I built a production-ready AI agent with PHP, MySQL, Gemini Flash, and cPanel—covering architecture, tools, memory, and deployment.