Skip to content

Anandprafull/RegRadar

Repository files navigation

RegRadar - AI Regulatory Intelligence Agent

An AI-powered compliance automation platform that monitors regulatory updates, extracts rules from legal documents, maps them to cloud infrastructure, detects violations, and generates actionable fixes with GitHub PR automation.

Now powered by CrewAI multi-agent system!

Features

  • Multi-Agent Architecture: 5 specialized AI agents working together via CrewAI
  • Multi-Framework Compliance: GDPR, HIPAA, SOC2, PCI-DSS, FedRAMP
  • AI-Powered Rule Extraction: Uses Amazon Bedrock (Claude 3) to extract structured rules from regulatory PDFs
  • Infrastructure Scanning: Parses Terraform and Kubernetes configurations
  • Violation Detection: Maps regulatory requirements to infrastructure resources
  • Blast Radius Analysis: Visualizes impact of violations across dependent resources
  • Automated Remediation: AI-generated fixes with code diffs
  • GitHub Integration: Creates pull requests for approved fixes
  • Human-in-the-Loop: Approval workflow for remediation actions
  • Real-time Progress: WebSocket-based live updates as agents work

Multi-Agent System

RegRadar uses a CrewAI-powered multi-agent system with 5 specialized agents:

Agent Role Capabilities
Regulatory Analyst Extract rules from documents PDF parsing, rule extraction, categorization
Infrastructure Scanner Analyze IaC configurations Terraform/K8s parsing, security analysis
Compliance Mapper Map rules to resources Violation detection, risk scoring
Risk Assessor Analyze blast radius Impact assessment, prioritization
Remediation Engineer Generate fixes Code generation, PR creation

How It Works

Regulatory Documents → [Regulatory Analyst] → Extracted Rules
                                                    ↓
Infrastructure Code → [Infrastructure Scanner] → Resource Inventory
                                                    ↓
                      [Compliance Mapper] ← Rules + Resources
                              ↓
                         Violations
                              ↓
                      [Risk Assessor]
                              ↓
                    Prioritized Violations
                              ↓
                   [Remediation Engineer]
                              ↓
                     GitHub Pull Requests

Architecture

                    ┌─────────────────────────────────────────────────────────────┐
                    │                      RegRadar Platform                        │
                    └─────────────────────────────────────────────────────────────┘
                                                    │
                    ┌───────────────────────────────┼───────────────────────────────┐
                    │                               │                               │
            ┌───────▼───────┐              ┌───────▼───────┐              ┌────────▼───────┐
            │   Frontend    │              │    Backend    │              │  Infrastructure │
            │   (Next.js)   │◄────────────►│   (FastAPI)   │◄────────────►│   (Terraform)   │
            └───────────────┘              └───────┬───────┘              └────────────────┘
                                                   │
                    ┌──────────────────────────────┼──────────────────────────────┐
                    │                              │                              │
            ┌───────▼───────┐              ┌───────▼───────┐              ┌───────▼───────┐
            │ Amazon Bedrock│              │  OpenSearch   │              │      S3       │
            │  (Claude 3)   │              │   (Indexing)  │              │   (Storage)   │
            └───────────────┘              └───────────────┘              └───────────────┘

Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • Docker & Docker Compose
  • AWS CLI configured (for production)

Development Setup

  1. Clone and setup
git clone https://github.com/your-org/regRadar.git
cd regRadar
cp .env.example .env
  1. Start services with Docker
make dev
# Or manually:
docker-compose up -d
  1. Start backend
cd backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn src.api.main:app --reload --port 8000
  1. Start frontend
cd frontend
npm install
npm run dev
  1. Access the application

Project Structure

regRadar/
├── backend/                 # FastAPI backend
│   └── src/
│       ├── api/            # REST API routes
│       ├── agents/         # CrewAI agent definitions
│       ├── crews/          # Crew orchestration
│       ├── tools/          # CrewAI tools
│       ├── models/         # Pydantic models
│       ├── services/       # Business logic
│       ├── llm/            # LLM integration (Bedrock, LangChain)
│       ├── parsers/        # Terraform, K8s, PDF parsers
│       └── storage/        # S3, OpenSearch clients
│   └── demo/               # Demo data
│       ├── regulations/    # Sample regulatory documents
│       ├── terraform/      # Sample Terraform with violations
│       └── kubernetes/     # Sample K8s with violations
├── frontend/               # Next.js frontend
│   └── src/
│       ├── app/           # Next.js pages
│       │   └── agents/    # AI Agents dashboard
│       ├── components/    # React components
│       │   └── agents/    # Agent UI components
│       ├── hooks/         # Custom hooks
│       └── lib/           # Utilities
├── infrastructure/         # Terraform IaC
│   └── terraform/
│       ├── modules/       # Reusable modules
│       └── environments/  # Dev/Prod configs
├── samples/               # Demo data
│   ├── terraform/        # Sample TF configs
│   └── kubernetes/       # Sample K8s manifests
└── docs/                  # Documentation

API Endpoints

Documents

  • POST /documents/upload - Upload regulatory document
  • GET /documents - List all documents
  • POST /documents/{id}/extract - Extract rules from document

Compliance

  • POST /compliance/scan - Scan infrastructure
  • GET /compliance/overview - Get compliance dashboard data
  • POST /compliance/check - Run compliance check

Violations

  • GET /violations - List violations
  • GET /violations/{id}/blast-radius - Get blast radius analysis
  • GET /violations/{id}/explain - Get AI explanation

Remediation

  • POST /remediation/generate/{violation_id} - Generate fix
  • POST /remediation/{id}/approve - Approve remediation
  • POST /remediation/create-pr - Create GitHub PR

AI Agents (CrewAI)

  • GET /agents - List all agents and their capabilities
  • GET /agents/{role} - Get specific agent details
  • POST /agents/crew/run - Start compliance analysis crew
  • GET /agents/crew/executions - List all crew executions
  • GET /agents/crew/executions/{id} - Get execution details
  • POST /agents/crew/executions/{id}/approve - Approve/reject PRs
  • DELETE /agents/crew/executions/{id} - Cancel execution
  • WS /agents/crew/ws/{id} - WebSocket for real-time progress
  • POST /agents/demo/run - Run demo with sample data
  • GET /agents/status - Get crew system status

Configuration

Environment Variables

# AWS
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret

# Bedrock
BEDROCK_MODEL_ID=anthropic.claude-3-sonnet-20240229-v1:0

# GitHub
GITHUB_TOKEN=ghp_xxxx
GITHUB_OWNER=your-org
GITHUB_REPO=your-repo

# OpenSearch
OPENSEARCH_ENDPOINT=https://search-xxx.us-east-1.es.amazonaws.com
OPENSEARCH_USERNAME=admin
OPENSEARCH_PASSWORD=xxx

# S3
S3_BUCKET_NAME=regRadar-documents

Deployment

AWS Deployment

cd infrastructure/terraform
terraform init
terraform plan -var-file=environments/prod.tfvars
terraform apply -var-file=environments/prod.tfvars

See DEPLOYMENT.md for detailed instructions.

Demo

For hackathon demo, run with mock data:

make demo

This starts the application with pre-seeded violations and demo data.

See DEMO_SCRIPT.md for presentation walkthrough.

Tech Stack

  • Backend: Python, FastAPI, CrewAI, LangChain, Pydantic
  • Frontend: Next.js 14, React, TailwindCSS, Recharts
  • AI/ML: Amazon Bedrock (Claude 3), CrewAI, LangChain
  • Infrastructure: Terraform, AWS (Lambda, S3, OpenSearch, EventBridge)
  • DevOps: Docker, GitHub Actions

License

MIT License - See LICENSE

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors