Building AI Agents in a 7-Year-Old Rails Monolith: A Deep Dive