Back to AI projects
Self-Developed Project · Aug 2025

Compliance

A RAG-Powered AI Agent for Regulatory Compliance — From Weeks to Minutes

Architecture Retrieval-Augmented Generation (RAG)
Tools evaluated Gemini CLI · ChatGPT Pro · Grok 4
Outcome 1–2 weeks → under 5 minutes
The story

Financial institutions live and die by their ability to respond to regulatory change, yet the process of doing so is almost entirely manual. Compliance and Finance teams scan regulator websites, interpret hundred-page legal texts, summarize obligations, email stakeholders, and chase down owners in spreadsheets. It's slow, error-prone, and expensive.

I designed an autonomous AI agent that automates the regulatory change lifecycle. The agent is built on Retrieval-Augmented Generation (RAG), grounding every output in the firm's own authoritative documents (regulations, 10-Ks, 8-Ks, internal policies, charters). To validate the approach, I ran a head-to-head bake-off against the two leading general-purpose alternatives, then implemented the winner across three real-world regulatory use cases.

The impact
Analysis time
5 min vs. 1–2 weeks
A single regulatory change, summarized and gap-analyzed end-to-end
Data culture
Centralized from scattered silos
The backbone any RAG agent needs
Comprehension
Plain English from legalese
Legal terms explained on demand, for any team
The tool bake-off
Chosen
Gemini CLI + RAG
Context-grounded integrator
Accuracy
High. Deep, context-aware analysis across all 10-Ks, 8-Ks, stress test reports, and internal policies.
Manual operation
None. Daily automated monitoring and assessment.
Reactive time
Within one day of regulatory publication.
ChatGPT Pro
High-performance generalist
Accuracy
Inconsistent. Initially misidentified the rule's subject matter. After clarification, missed board oversight and risk management requirements.
Manual operation
High. Requires manually assigned source documents per request.
Reactive time
Bottlenecked by human throughput.
Grok 4
Real-time analyst
Accuracy
Inconsistent. Initially misidentified subject matter. Detailed but redundant after clarification; still missed key requirements.
Manual operation
High. Same constraint as ChatGPT Pro.
Reactive time
Bottlenecked by human throughput.
The 5-stage compliance workflow

From monitoring to reporting, end-to-end

Pilot implemented in Stage 2; remaining stages designed for follow-on automation

Stage 1
Monitor
Scrape regulator sites and parse newsletters daily
Stage 2 · Pilot
Impact & Comms
Summarize changes, identify implications, draft stakeholder notifications
Gemini + RAG
Stage 3
Action Plan
Generate checklists, assign owners, track progress
Stage 4
Implement
System updates, policy adjustments, execution tracking
Stage 5
Report
Status dashboards, compliance documentation, lessons learned

The real win wasn't the AI. It was discovering that full automation looks nothing like semi-automation. The moment a human has to manually assign source documents, the time savings collapse.

What I learned
01

RAG is the foundation of trust in high-stakes compliance

Standalone LLMs hallucinate. In a compliance context, a confident-sounding wrong answer is worse than no answer at all. RAG grounds every output in authoritative source documents, so every summary, checklist, and gap analysis is auditable back to a specific regulation or policy line. That auditability is non-negotiable for financial regulators.

02

Prompt engineering is domain-oriented, backed by strong metadata

Version 1 produced vague, generic summaries. The prompt didn't know how regulatory obligations are structured. Version 2 fixed that with section-by-section, mandate-by-mandate granularity. But the agent was still silently skipping 75% of internal documents, judging relevance from filenames alone. Version 3 forced it to read every file's contents and pushed the organization to adopt descriptive file naming and structured metadata. Coverage jumped from 20–25% to 100%.

03

Data culture is the real barrier, not the technology

The Gemini CLI + RAG stack is the easy part. The hard part is moving an organization from "documents scattered across emails, shared drives, and spreadsheets" to "a single, version-controlled, machine-readable knowledge hub." Without that shift, the AI agent has nothing reliable to retrieve from. The tool became a forcing function for modernizing how compliance treats its own data.

04

Full automation is categorically different from semi-automation

ChatGPT Pro and Grok 4 both required a human to identify and upload the relevant internal documents before each analysis. That step is exactly where the manual process bleeds time and misses gaps. An automated daily monitor + RAG pipeline doesn't just speed up the manual process. It changes the topology of the work.

05

Domain experts get more valuable, not less

The agent could draft an impact assessment in five minutes. But it took a human compliance analyst to know that the assessment was missing board oversight implications, or that "physical risk" and "transition risk" needed to be distinguished. AI handles the drudgery of comprehension. Domain experts handle the judgment of what matters. Their time gets reallocated up the value chain, not eliminated.

Use cases tested
Use case 01
SEC Climate-Related Disclosure (Rule 33-11275)
Gap analysis against the firm's 10-K, 8-K, stress test reports, and five internal governance policies. Identified disclosure obligations the manual process had missed.
Use case 02
Basel III Reform
Mapped capital and liquidity requirements against existing risk policies, surfacing implementation gaps across multiple business units.
Use case 03
Cybersecurity Risk Management
Generated a section-by-section obligation table against incident reporting, board oversight, and third-party risk policies.
Agentic AI RAG Prompt Engineering Regulatory Compliance