X-RAIL
A multi-agent insurance AI platform built with Google Cloud + ADK
๐ง Inspiration
Insurance actuary and underwriting often hides behind blackโbox models. Underwriters and customers alike deserve transparency โ especially when risk decisions affect customer pricing, future claims, and trust. The global insurance industry wrote approximately $7โฏtrillion in premiums in 2023, and with growing regulatory pressure for AI transparency, the need for explainable solutions has never been greater.
Inspired by the power of multi-agent AI orchestration using Googleโs Agent Development Kit (ADK), we built X-RAIL: a fully explainable, modular, and interactive risk analytics engine for insurers.
X-RAIL stands for:
Xplainable Risk Assessment & Insights Loop โ reflecting a platform where data, models, explainability, and simulations form a closed, intelligent decision-making system.
But beyond insight, X-RAIL delivers automation. It simulates how real-world insurers operate: cross-functional teams pulling queries, building models, explaining risks, generating reports, and running scenario tests. We transformed this traditionally manual, siloed pipeline into an intelligent, coordinated system of agents โ each focused, explainable, and orchestrated โ to automate a complex business process end-to-end.
Along the way, X-RAIL also delivers powerful data analysis and actionable insights, surfacing patterns, risk factors, and predictive indicators through transparent dashboards and scenario simulations.
๐ง What It Does
X-RAIL is a multi-agent autonomous system that can process incoming insurance claims โ whether structured or unstructured โ to compute risk scores, generate regulatory-aligned explanations, and simulate "what-if" scenarios in real-time.
X-RAIL can streamline underwriting workflows, reduce manual review time by 60- 70%, and produce transparent, auditable outputs for every prediction.
๐งฑ Agent Architecture
๐ง Conductor Agent (ADK Root Agent)
Routes tasks to specialized agents based on input type and user intent. Manages session context and workflow loops with persistent state management.๐ข Risk Agent
Predicts a calibrated risk score using self-trained XGBoost with isotonic calibration and returns confidence scores. Hosted on Vertex AI and fully SHAP-explainable and auditable.๐ Explainability Agent
Uses SHAP to provide regulatory-aligned insight into the top features contributing to a userโs risk score. Includes both audit trail and plain-language summary options.๐ Dashboard Agent
Renders metadata facilitating Streamlit-based dashboards showing risk gauges, SHAP plots, simulation deltas, and compliance metadata.๐ Impact Simulator Agent
Supports "what-if" edits (e.g., income change, car type) to see updated risk scores, premium impact calculations, and automated recommendations. Includes multi-scenario comparison capabilities.๐ BQML Agent
Trains and evaluates BigQuery ML models on user request with RAG integration for documentation. Supports feature selection, model comparison, threshold tuning, and multiple model types.๐งฎ BigQuery Agent
Converts natural language queries into SQL using ChaseSQL and retrieves real-time claim history, location risk, or policy info with comprehensive error handling.๐ Analytics Agent
Runs Python-based analysis (via Vertex AI Code Executor) to provide data summaries, charts, statistical analysis, correlation detection, and policy insights.
๐ Key Features
| Capability | Description |
|---|---|
| โ Risk Scoring | Calibrated risk predictions with confidence intervals |
| โ Explainability | SHAP-based explanations of the scoring with regulatory compliance |
| โ What-If Analysis | Interactive scenario simulation and impact assessment |
| โ Dashboard | Streamlit-based risk visualizations and plots |
| โ PDF Reports | Auto-generated, branded risk assessment reports |
| โ NL-to-SQL | Natural language to BigQuery queries for insurance data |
| โ NL-to-Analytics | Natural language to Python based analytics for claims, policies and customer analysis |
| โ BQML Training | Custom BigQuery ML model training and evaluation |
| โ Comprehensive Audit | Input hashing, audit IDs, conversation history, and complete decision traceability |
๐๏ธ How We Built It
Architecture

โ๏ธ Tech Stack
๐ง Core Orchestration & AI
- Google ADK (Agent Development Kit) โ Multi-agent system orchestration
- Vertex AI โ Model hosting and online inference
- Gemini 2.0 Flash โ LLM for task routing and natural language handling
- Vertex AI RAG Engine โ Retrieval-Augmented Generation for querying BQML docs
๐ Data, Deployment & Storage
- BigQuery โ Scalable data warehouse for structured insurance data
- Google Cloud Storage โ Storage for SHAP plots, PDFs, and model artifacts
- BigQuery ML (BQML) โ On-demand ML model training and evaluation
- Docker - OS-level virtualization to deliver software in packages called containers
- Cloud Run - Fully managed platform that enables you to run your code
๐ค Modeling & Explainability
- XGBoost โ Risk scoring via gradient boosting
- Scikit-learn โ Preprocessing and model calibration
- SHAP โ Feature attribution and model interpretability
- Matplotlib โ Visualization of SHAP outputs
๐ UI & Reporting
- Streamlit โ Real-time dashboards and simulation interface
- FPDF โ Automated PDF report generation with risk + compliance info
๐งฎ Data & Development
- Pandas, NumPy โ Data transformation and numerical analysis with statistical validation
- ChaseSQL โ Converts natural language to optimized SQL with error handling
- Pydantic โ Data validation across agents with comprehensive input sanitization
- Poetry โ Dependency and environment management with isolated environments
๐งช Testing & Debugging
- Pytest, Pytest-asyncio โ Unit and async testing for agents
- IPython, IPykernel โ Notebook development and debugging with stateful execution
๐ Security & Compliance
- Google Cloud IAM โ Role-based access control with granular permissions
- Audit Logging โ Decision traceability for regulators with input hashing and audit IDs
- EU AI Act Ready โ Aligned with transparency and explainability standards
- Input Validation โ Comprehensive input sanitization and error handling
๐ Agent Interactions
- LLM-Powered Routing: Gemini handles user input classification and workflow control with context awareness.
- ToolContext Sharing: All agents share input, risk output, explanation, and dashboard state via ADK context with persistent session management.
- Cloud Integration: Agents communicate with BigQuery, Vertex AI, and GCS seamlessly for real-time data and compute.
๐ง Challenges We Faced
๐ Multi-Agent Coordination
Designing and orchestrating interactions between independent agents while preserving shared memory (tool_context.state) was both conceptually and technically complex. We solved this by implementing a state management system using ADK's callback context and designing clear agent interfaces with standardized input/output formats.
๐ Data Availability & Generation
Insurance datasets are typically private, regulated, and hard to access. To overcome this, we built a Python-based data generation engine that created three domain-specific datasets:
- 100,000 synthetic customer records
- ~50,000 synthetic claims
- 100,000 synthetic policy entries
These datasets follow realistic statistical distributions (e.g., Gaussian for income, categorical for coverage type) and include controlled noise and outliers to mimic real-world behavior as close as possible.
๐ Deployment Complexity
Deploying a distributed, dependency-heavy agent system to Cloud Run was non-trivial. Sparse documentation, complex image builds, and inter-agent dependencies made deployment debugging time-intensive. We ultimately containerized agents using Docker and configured environment isolation through Poetry.
๐ Explainability Integration
Translating SHAP outputs into clear, human-readable insight โ while maintaining regulatory standards โ required model calibration, feature pruning, and interpretability-first design.
๐ Cloud Service Integration
Handling authentication and seamless operation across BigQuery, Vertex AI, and ADK required careful permissioning and modular design.
๐ก๏ธ Advanced Simulation Complexity
Developing core idea for Implementing multi-scenario comparison with premium impact calculations required sophisticated state management, error handling for edge cases, and automated recommendation generation based on simulation results.
๐ Accomplishments
- โ Delivered a full-stack insurance analytics engine with modular, explainable agents and comprehensive audit trails.
- โ Successfully orchestrated complex agent interactions via ADKโs multi-agent architecture.
- โ Enabled both expert (underwriter) and non-technical (customer) users through NL input, visual dashboards, and downloadable reports.
- โ Created an extensible platform โ from solo claims to portfolio-level simulation.
๐ง What We Learned
- Multi-agent systems demand thoughtful task decomposition and agent granularity with robust state management.
- Explainability isn't a nice-to-have โ it's foundational in regulated industries and requires comprehensive audit trails.
- Google's ADK provides a powerful backbone for LLM-driven orchestration and context-aware decisioning with persistent state.
- Designing for auditability and transparency unlocks business trust and adoption while ensuring regulatory compliance.
- Robust error handling and fallback mechanisms are critical for production-grade multi-agent systems.
๐ฎ Whatโs Next
- ๐ก๏ธ Fraud Detection Agent โ anomaly detection on claim patterns
- ๐ฑ Mobile App โ for field agents and mobile-first customers
- ๐งพ Regulatory Compliance Agent โ maps decisions to legal requirements
- ๐ฆ Portfolio Simulator โ simulate multiple claims, assess book-wide risk
- ๐ง Counterfactual Reasoning โ โHow could this risk score have improved?โ
- ๐ Telematics Integration โ Incorporate real-time vehicle data for dynamic, usage-based risk assessment.
- ๐ Advanced Analytics โ Enhanced statistical modeling and predictive analytics capabilities
๐ก Why X-RAIL Stands Out
โA claim comes in. Multiple AI agents collaborate, reason, explain, and simulate outcomes โ all within seconds. The underwriter sees a full dashboard. The customer gets an understandable explanation. And regulators see a compliant audit trail.โ
- Multi-agent intelligence: orchestrated via ADK with persistent state management
- Fully explainable: SHAP, NLP, and visual insight with top 4 factors and directional impact
- Real-time simulation: change inputs, re-score live with premium impact calculations
- Built on Google Cloud: scalable, secure, production-ready
- Comprehensive audit trails: input hashing, audit IDs, and complete decision traceability
๐ฏ Real-World Impact
X-RAIL helps insurers:
- Reduce manual review time by 60โ70%
- Build customer trust through transparency
- Satisfy compliance laws like the EU AI Act
- Support underwriters with real-time simulations, premium impact calculations, and recommendations.
Built With
- bucket
- cloudrun
- cursor
- docker
- fpdf
- gcp
- git
- github
- google-bigquery
- poetry
- python
- vscode
- xgboost
Log in or sign up for Devpost to join the conversation.