Integrating an AI Agent into a Legacy Ruby on Rails Application with Sensitive Data
By
cionescu1
Slow-proofed and worth the wait. Worth its weight in flour.
Summary
A Director of Engineering at Mon Ami shares their experience integrating an AI agent into a 7-year-old Ruby on Rails monolith that handles sensitive aging and disability case worker data. The article details how they implemented the AI agent using RubyLLM, maintained existing Pundit authorization policies, and leveraged Algolia search without creating parallel systems or compromising security constraints. The solution focuses on improving client record lookup performance while preserving the multi-tenant architecture's data sensitivity requirements.
Key quotes
· 4 pulledI'm a Director of Engineering at Mon Ami, a US-based start-up building a SaaS solution for Aging and Disability Case Workers.
We built a large Ruby on Rails monolith over the last 7 years. It's a multi-tenant solution where data sensitivity is crucial.
Looking up clients' records is, in particular, an action that is just not performant enough with raw database operations.
I walk through how I added the first AI agent tool using RubyLLM, Pundit policies, and our existing Algolia search, without introducing a parallel system or loosening constraints.
You might also wanna read
AgentRail: Open-source local control plane for managing AI coding agent task lifecycles
AgentRail is an open-source, locally-run task lifecycle layer for AI coding agents. It solves the operational challenges beyond code writing
Scorecard: Platform for Evaluating and Optimizing AI Agents in High-Stakes Applications
The CEO of Scorecard shares a cautionary tale about nearly shipping a dangerous AI agent for doctors that confused pediatric and adult dosin
Scorecard CEO warns of AI agent dangers in high-stakes domains, offers evaluation platform
Darius, CEO of Scorecard, shares a cautionary tale about building AI agents in high-stakes domains. He describes how his EMR agent for docto
