Statistical Mechanics of AI Agents