Inspiration
CAG Report No. 22 of 2022 exposed a brutal truth about Indian Railways: maintenance departments operate in complete silos. Civil Engineering books a track block from 02:00–04:00. Electrical TRD books the same stretch from 02:30–04:30. Signaling & Telecom shows up at 03:00. Three departments. One track. Three disconnected shutdowns — instead of one coordinated, bundled block.
The result? 34% of sanctioned maintenance blocks are deficit — meaning the work doesn't even finish before trains resume. Trains run over partially maintained track. Speed restrictions stay in place for days. And locomotive pilots get TSR updates via radio call, not their onboard Kavach TCAS system.
We read that report and couldn't unsee it. IRIS AI is our answer.
What it does
IRIS AI (Intelligent Railway Inspection and Restoration AI) is an AI-powered corridor command center that solves three interconnected problems on Indian Railways:
1. Joint Shadow Block Optimization Instead of three departments booking three overlapping blocks, IRIS AI ingests live maintenance demands from Civil TMS, Electrical TDMS, and Signaling SMMS, then uses a Google OR-Tools CP-SAT disjunctive interval scheduler to bundle co-located demands into a single joint shadow block — one coordinated possession window that serves all departments simultaneously. Downtime drops by up to 34%.
2. Dynamic ETA Forecasting The system continuously forecasts train arrival times using a spatio-temporal delay propagation model across the CSMT–Kalyan quadrupled corridor (54 km, 4 tracks). Speed restrictions triggered by block possessions are factored into every ETA recalculation in real time.
3. Kavach TCAS Broadcast Once a block is sanctioned, the SanctionGate agent auto-broadcasts the Temporary Speed Restriction (TSR) directly to Kavach TCAS units inside locomotive cabs — before the train enters the block boundary. No radio call needed.
Everything the system decides is sealed with a SHA-256 cryptographic hash and logged as a 4-step explainable decision dossier, fully compatible with RDSO Form 14B for CRS statutory auditing.
The dashboard includes:
- 3D WebGL corridor twin with live train simulation (React Three Fiber)
- Section interlocking schematic with 4-aspect LED signal heads
- Defect vision console with Kavach EBD speedometer and weather friction simulator
- Statutory auditor workspace with tamper verification and RDSO Form 14B export
- GPS + YOLOv11 PPE ground crew check-in portal
How we built it
Frontend: Next.js 16 (App Router) + React 19 + TypeScript, styled with Tailwind CSS v4 using a dual-mode luxury design system (Mintlify Clean light / Slash Obsidian dark). 3D components built with React Three Fiber, Three.js, and GSAP scroll storytelling.
AI & Physics Engine: Pure TypeScript agents running in-browser. The Kavach braking agent implements the RDSO emergency braking distance formula: D_stop = V² / 2g(μ + G) + V·t_reaction with real friction coefficients from RDSO/SPN/196/2020 benchmarks — including monsoon, winter fog, and night-IR track conditions.
Optimizer: Python FastAPI backend wrapping Google OR-Tools CP-SAT with disjunctive interval scheduling, 15-minute train clearance headways, 10-minute OHE earthing buffers, and 30 km/h emergency TSR fallback. Non-blocking asyncio.to_thread dispatch prevents solver latency from blocking API responses.
Data: We grounded every dataset in primary government sources — data.gov.in Central Railway schedules, CAG Report No. 22 track deficit metrics, RDSO Kavach braking benchmarks, and station footfall crowd thresholds. No made-up numbers.
Auth & RBAC: React 19 useSyncExternalStore auth engine with 6 pre-seeded officer personas (Planner, Controller, Loco Pilot, Auditor, Field SSE, Admin), each gated to their statutory screen.
Testing: 173+ unit and integration tests across Vitest, covering contracts, physics, RBAC, interlocking, and API fallback logic.
Challenges we ran into
Regulatory Accuracy Without Domain Access Implementing real RDSO and G&SR compliance without access to internal Railway systems meant sourcing every parameter from published manuals — IRPWM, ACTM, IRSEM, CAG reports, and RDSO specification PDFs. Every friction coefficient, headway buffer, and form reference had to be cross-verified against multiple sources.
CP-SAT Solver Latency in a Live Dashboard
The OR-Tools CP-SAT solver can take 400–900ms for complex multi-department corridor schedules. Running this synchronously inside a Next.js API route froze the dashboard. The fix was asyncio.to_thread with a 1500ms timeout and an instant mock fallback — the UI always responds in under 200ms.
SHA-256 Audit Integrity Across Distributed State
Making the cryptographic decision log tamper-evident while keeping it reproducible across browser sessions required implementing RFC 8785 canonical JSON serialization (blockId|sanctionedBy|timestamp|sortedDemands|tsr|policy) to ensure hash stability regardless of key insertion order.
3D Performance on Mid-Range Devices The WebGL corridor twin (4 tracks, multiple animated train capsules, floating HUD badges) was initially dropping to 18fps on integrated GPUs. We solved this with instanced mesh rendering, LOD switching at camera distance > 200m, and disposing of Three.js geometries on component unmount.
RBAC Without a Real Backend
Building six genuinely role-differentiated personas — each with a different screen, different data scope, and different action permissions — without a real auth server meant the useSyncExternalStore RBAC engine had to be airtight on the client side with no privilege escalation paths.
Accomplishments that we're proud of
The CP-SAT optimizer actually works — it correctly bundles overlapping multi-department maintenance demands into non-conflicting joint blocks, respects all headway constraints, and produces human-readable block schedules. This is a real constraint programming solution, not a greedy heuristic.
173 tests passing, zero skipped — every physics formula, every RBAC guard, every API contract, and every cryptographic hash is verified. We didn't cut corners on correctness to ship features faster.
SHA-256 explainable audit trail — a judge can open any sanctioned block, hit "Verify Integrity," and the system recalculates the hash from the raw payload live. If anyone tampered with the log, it breaks. This is production-grade statutory compliance, not a UI decoration.
Grounded on real Indian Railways data — CAG Report No. 22, Central Railway CSMT–Kalyan schedules, RDSO braking benchmarks. Every number on the dashboard is defensible in a real divisional control office.
We shipped a complete system — landing page, auth, 5 role-gated operational screens, 3D WebGL twins, a FastAPI backend, a CP-SAT optimizer, a cryptographic audit engine, and a printable RDSO Form 14B. In 36 hours.
What we learned
Constraints are the product. The regulatory constraints — G&SR Chapter 15 forms, RDSO headway buffers, OHE earthing windows — aren't bureaucratic overhead. They're the domain model. Understanding them deeply is what separates a toy from a deployable system.
Mock data is a first-class design decision. Building realistic, deterministic mock datasets from CAG and RDSO sources meant our demo always shows plausible railway operations. Judges who know railways noticed. That detail matters.
Explainability beats accuracy in high-stakes domains. A 99.9% accurate AI that can't explain its decision to a CRS auditor won't be trusted. A 95% accurate AI with a cryptographic, step-by-step decision log will get deployed. We built for trust, not just performance.
Three.js WebGL and Next.js App Router need careful SSR guards. Every R3F component needed dynamic(() => import(...), { ssr: false }) wrapping, or the server-side render would crash on window access. We hit this four times before systemizing it.
What's next for IRIS AI
Live CRIS API Integration
Replace mock adapters with real CRIS TMS/TDMS/SMMS ingestion via the IIngestionAdapter interface we've already built. The hexagonal architecture means zero changes to the optimizer or UI — just swap the adapter.
Rolling Horizon Framework (RHF) Production Deployment Expand from 24-hour tactical planning to the full 3-horizon stack: 24h (tactical), 7-day (operational), 30-day (strategic). The CP-SAT solver already supports this — it needs live schedule feeds to populate the longer horizons.
Multi-Corridor Scale
Extend from CSMT–Kalyan to all 12 divisions of Central Railway, then Western, Northern, and South Central. The divisional policy profile system (DivisionalPolicyProfile) is already designed to externalize per-division parameters without code changes.
Kavach TCAS Hardware Integration Partner with RDSO to test direct TSR broadcast to Kavach onboard units via the existing ETCS Level 2 communication stack. Our SanctionGate agent already produces the right payload format.
Field Crew Mobile App Evolve the GPS geofence + YOLOv11 PPE portal into a standalone Android app for SSE field officers, with offline capability for sections with poor GSM coverage.
Built With
- audio
- canonical
- cp-sat
- css
- drei
- fastapi
- fiber
- gsap
- next.js
- or-tools
- python
- react
- recharts
- sha-256
- tailwind
- three
- typescript
- vitest
Log in or sign up for Devpost to join the conversation.