The AI That Runs Compliance for the World
RegulationOS is a demo-ready web application that uses agentic AI to read regulatory documents, analyze operational data (e.g. cargo manifests), detect compliance risks, and generate actionable remediation plans. The primary demo vertical is Shipping and Transportation: upload a regulation PDF and a cargo manifest CSV to get a compliance score, risk list, and recommended actions.
- Frontend: Next.js 14, TypeScript, Tailwind CSS
- Backend: FastAPI, Python 3.11
- AI: Amazon Nova–ready multi-agent architecture with a mock adapter for offline/demo use (no API key required).
┌─────────────────────────────────────────────────────────────────┐
│ FRONTEND (Next.js 14) │
│ Home │ Upload (PDF + CSV) │ Dashboard (score, risks, Q&A) │
│ lib/api.ts → REST │
└────────────────────────────┬────────────────────────────────────┘
│ HTTP
┌────────────────────────────▼────────────────────────────────────┐
│ BACKEND (FastAPI) │
│ GET /health POST /analyze POST /analyze-demo POST /ask │
│ │ │
│ SupervisorAgent → RegulationAgent → CargoAgent → RiskAgent │
│ → WorkflowAgent VoiceAgent (/ask) │
│ NovaClient / MockNovaClient StorageService (JSON reports) │
└─────────────────────────────────────────────────────────────────┘
Agents
| Agent | Role |
|---|---|
| SupervisorAgent | Runs the pipeline: regulation → cargo → risk → workflow; returns one ComplianceReport. |
| RegulationAgent | Extracts obligations, prohibited actions, required docs, safety risks from regulation text. |
| CargoAgent | Parses cargo CSV and flags hazardous items (e.g. lithium, solvent). |
| RiskAgent | Compares cargo to obligations, produces risks and a 0–100 compliance score. |
| WorkflowAgent | Builds recommended actions and workflow automations (e.g. “Generate declaration form”). |
| VoiceAgent | Answers natural-language questions about the report (used by /ask). |
-
Clone and enter the project
cd regulation-os -
Environment
cp .env.example .env
Edit
.envif you want to use the live Nova API; for demo,USE_MOCK_NOVA=trueis enough. -
Backend (from project root
regulation-os/)python -m venv .venv .venv\Scripts\activate # Windows # source .venv/bin/activate # macOS/Linux pip install -r backend/requirements.txt set PYTHONPATH=%CD% # Windows uvicorn backend.main:app --reload --port 8000
-
Frontend
cd frontend npm install npm run devOpen http://localhost:3000.
| Variable | Description | Default |
|---|---|---|
USE_MOCK_NOVA |
Use mock AI (no API key) | true |
NOVA_API_KEY |
Amazon Nova API key (when not using mock) | — |
NOVA_MODEL_LITE |
Nova model for completions | nova-2-lite |
NOVA_EMBEDDING_MODEL |
Nova embedding model | nova-multimodal-embedding |
NOVA_SONIC_MODEL |
Nova Sonic model | nova-2-sonic |
BACKEND_URL |
Backend base URL (server-side) | http://localhost:8000 |
NEXT_PUBLIC_BACKEND_URL |
Backend URL for browser | http://localhost:8000 |
From the regulation-os directory:
cp .env.example .env
docker-compose up --build- Backend: http://localhost:8000
- Frontend: http://localhost:3000
- API docs: http://localhost:8000/docs
- With
USE_MOCK_NOVA=true(default), the app usesMockNovaClient: deterministic, offline, no API key. - To use the live Nova API, set
USE_MOCK_NOVA=falseandNOVA_API_KEYin.env. The same agent code then calls the real API.
- Open http://localhost:3000.
- Click “Launch Demo” (or go to Upload).
- Click “Load Demo Data” to load the sample regulation and cargo manifest.
- Click “Analyze”. Wait for the run to finish.
- You are redirected to the Dashboard: compliance score, risk list, recommended actions, workflow automations.
- In Ask RegulationOS, type a question (e.g. “What is the main compliance risk?”) and click Ask to see the Q&A response.
- Backend: From
regulation-os, withPYTHONPATHset to the project root:pytest backend -v
- Frontend: From
regulation-os/frontend:npm run test
- Persist report IDs and support “load report by ID” from the dashboard.
- Add more sectors (Healthcare, Finance, Energy) with sector-specific regulations and schemas.
- Replace mock with full Nova integration (embeddings, Sonic) for production.
- Optional auth and tenant isolation for multi-tenant deployments.