- Overview
- Key Feature
- Expected Impact
- How It Works
- Architecture
- Data Model
- Installation Guide
- Notable Implementation Details
- Known Limitations
- Future Roadmap
Emergency response teams are true heroes — but the navigation tools they rely on often aren’t. In Lombardy, Italy, emergency response teams use traditional systems like Google Maps or Waze which are optimized for everyday drivers, not emergency vehicles. During critical missions, these systems can suggest routes congested by the very incidents they’re responding to, or fail to consider that emergency vehicles with sirens can bypass certain traffic rules.
HERO (Hybrid Emergency Route Optimizer) leverages Microsoft Fabric and real-time data intelligence to provide AI-driven route recommendations tailored for emergency missions. It ingests live traffic data, mission dispatch feeds, and vehicle telemetry into Fabric’s Real-Time Intelligence Hub, continuously comparing standard navigation routes with AI-adjusted emergency alternatives.
An embedded AI model learns how siren-equipped vehicles perform under different traffic and incident conditions — estimating the “siren advantage” dynamically. HERO then generates real-time alerts and dashboards for both dispatch control centers and field units, showing the optimal route, expected arrival time, and estimated time saved.
⚡ Real-Time Fabric Integration: Streams traffic and mission data through Fabric Real-Time Hub and Eventhouse.
🧠 AI-Enhanced Routing: Dynamically adjusts travel times using congestion data and emergency-vehicle performance profiles.
🛰️ Adaptive Rerouting: Responds instantly to changing traffic conditions or new incidents.
📊 Control-Center Dashboard: Built in Power BI on Fabric — live map, mission tracker, ETA savings, congestion hotspots.
🔔 Automated Notifications: Sends updates to mobile teams or dispatchers when route decisions change.
HERO aims to reduce emergency response times by 10–20%, helping first responders reach critical locations faster and more safely. Beyond routing, the system’s data foundation can support predictive dispatching, fleet optimization, emergency analytics, and cross-agency coordination.
By combining AI, real-time intelligence, and Microsoft Fabric’s unified analytics platform, HERO demonstrates how technology can empower the people who save lives with great scalability.
- 🚑 Picks the fastest emergency route right now:
- Compares Google TRAFFIC_AWARE_OPTIMAL vs TRAFFIC_UNAWARE
- 🧠 Applies siren advantage:
- AutoML regression (trained in Fabric with historical telemetry and route decision data) or heuristic fallback
- 📡 Chooses the faster option and Streams everything into Microsoft Fabric for real-time decision-making:
- Route analysis, decoded polyline segments, and vehicle telemetry paced by ETA
- 🗺️ Shows the route + moving vehicle in Power BI:
- LINESTRING for the route + an icon for the vehicle
- 📲 Sends SMS with a Google Static Map link via Twilio
Bronze (ingest mirrors)
tb_route_analysis— decision rowstb_route_segments— chosen route decoded to points (route_id,sequence,latitude,longitude)tb_vehicles_telemetry— stream of positions for each vehicle
Silver (cleaned & typed)
- Add
processed_timestamp = now() - Cast
latitude/longitudetoreal,sequencetoint, etc. - Correct
status - Helper tables like
tb_routes_wkt(route_id, wkt)with derived columns needed to handle geometries
Gold (view/function for Power BI)
- Materialized View to get latest position by vehicle
mv_latest_telem - Function
routes_latest_vehicles_goldwhich is the union of:- Vehicle icon rows (with
icon_mapURL, real lat/lon) frommv_latest_telem - tb_routes_wkt (with
icon_map = wkt, lat/lon set tonull) fromtb_routes_wkt_silver
- Vehicle icon rows (with
- Function
vehicle_telemetry_goldfor telemetry analysis
To set up HERO end-to-end:
Make sure to configure and get Google API key and Twilio SID, Token, Virtual Number from and Virtual Number To.
Run the 3 SQL files in sql/ against your SQL database in this order:
01_create_tables.sql02_enable_cdc.sql03_create_dispatches_simulation_sp.sql
This table + CDC are the upstream source that Fabric ingests and that activates the core of the solution: the
hero_route_decision.ipynbnotebook
Use a workspace with capacity that can safely run Notebooks and Real-time intelligence.
Fork or import this GitHub repo so you can link it to Fabric.
Linking the fabric/ folder will auto-hydrate the Fabric artifacts in your workspace
(Eventhouse, KQL Database, Notebooks, Data Functions, etc).
Confirm the default Eventhouse and its KQL database were created. These host the bronze/silver tables and gold functions/views.
Ensure these EventStreams exist and configure the connections:
dispatchfor dispatches coming from SQL DB — configure Azure SQL Database CDC connection using Azure Key Vaultroutes_analysisfor route decision output —> copy custom point Event Hub SAS Key Authentication Conn Strg and create secret in Azure Key Vaultroutes_segmentsfor chosen route points (polyline decoded) —> copy custom point Event Hub SAS Key Authentication Conn Strg and create secret in Azure Key Vaultvehicles_telemetryfor simulated vehicle telemetry —> copy custom point Event Hub SAS Key Authentication Conn Strg and create secret in Azure Key Vault
In Azure Key Vault, create/update:
google-maps-api-keyconn-str-route-analysisconn-str-route-segmentsconn-str-vehicles-telemetrytwilio-sidtwilio-tokentwilio-from-numbertwilio-to-number
grant workspace MI access to Azure Key Vault with Key Vault Reader and Key Vault Secret User roles.
-
In Fabric → Variables, create/update:
-
siren-model -
azure-key-vault
- run the ml_data_prep to prepare data for ML model. Schedule the pipeline to update table in batch at least once per day and in any case according to your EventHouse data retention rules.
- Open the AutoML_siren_advantage notebook from the workspace.
- Ensure training data table (
ml_siren_advantage_regression) was created and correctly populated - Run the notebook to create experiments and register the model in the Fabric Model Registry.
- Update model version in variables (see step above)
- EXEC stored procedure created in step 1.3 to simulate dispatches
[hero].[RunFakeDispatchStream] - Confirm dispatch inserts are flowing and that Dispatch EvenStream is correctly mirroring sql dispatched via CDC
- Check the Activator starts triggering mail alert and
hero_route_decision.ipynbnotebook correctly passing parameters. The notebook:- Reads incoming dispatches (CDC) and calls Google Routes twice:
TRAFFIC_AWARE_OPTIMAL(withextraComputations=TRAFFIC_ON_POLYLINE)TRAFFIC_UNAWARE
- Computes congestion score from speed intervals on the polyline.
- Applies ML siren advantage (falls back to heuristic if the model isn’t available).
- Publishes:
- Route analysis (decision, ETAs, congestion) →
tb_route_analysis - Chosen route segments (decoded points) →
tb_route_segments - Starts ETA-paced telemetry →
tb_vehicles_telemetry - Sends SMS with Google Static Map to the configured number.
- Route analysis (decision, ETAs, congestion) →
- Reads incoming dispatches (CDC) and calls Google Routes twice:
- Watch:
- Eventhouse tables fill (analysis, segments, telemetry).
- Power BI map shows route + moving vehicle.
- SMS map link opens the correct static map.
- Open the report from the workspace and ensure the semantic model connects to the gold function/view.
- Icon map setup:
- Layer 1 (Line) → bind the WKT
LINESTRINGcolumn (route). - Layer 2 (Icon) → bind latitude/longitude (vehicle) and icon URL (ambulance).
- Layer 1 (Line) → bind the WKT
- Filter by
route_id/vehicle_idto demo a mission.
- Verify Twilio receiver (a virtual number is fine).
- Confirm the SMS arrives with a clickable map URL.
After these steps, your HERO system should be operational. 🎉
- The repo includes silver transforms and gold functions to power the report.
- If you change EventStream names or table names, update the variable wiring and sinks accordingly.
- For production, schedule the ML data prep notebook (daily) and re-train periodically if desired;
- Congestion extraction requires adding this to the request body:
{ "extraComputations": "TRAFFIC_ON_POLYLINE" } - And field mask includes:
{ POST https://routes.googleapis.com/directions/v2:computeRoutes Headers: Content-Type: application/json X-Goog-Api-Key: <YOUR_API_KEY> X-Goog-FieldMask: routes.duration, routes.distanceMeters, routes.polyline.encodedPolyline, routes.legs.travelAdvisory.speedReadingIntervals.startPolylinePointIndex, routes.legs.travelAdvisory.speedReadingIntervals.endPolylinePointIndex, routes.legs.travelAdvisory.speedReadingIntervals.speed } - ML live scoring:
- Loads the latest registered model via MLflow
- Input schema: [congestion_score, eta_theoretical_min, distance_m_theoretical, hour_of_day, dow, avg_speed_kmh, telemetry_points]
- If validation/predict fails → heuristic fallback
- Telemetry:
- Currently simulated, with intervals derived from chosen ETA
- Emits progress_pct and status (arrived on last point)
- Machine Learning model: currently trained on dummy data for this POC. The solution will improve as real ambulance telemetry is collected over time.
- Telemetry simulation: vehicle telemetry is simulated; future versions will connect to real fleet tracking or IoT systems.
- Average speed input: avg_speed_kmh is a fixed placeholder (50 km/h). Future releases will derive it from TomTom APIs or historical segment data.
- Notebook & UDFs: assume polyline decoding and ETA fields are always available. Production deployments must handle Google API quotas and errors.
- KQL materialization: materialized views have functional limits; some aggregations are implemented as functions with update policies instead.
- Real telemetry integration connect directly to live ambulance GPS and IoT data streams.
- Enhanced ML model: retrain continuously on real missions to improve siren advantage accuracy.
- Traffic intelligence: integrate TomTom data for real-time speed estimation and congestion prediction.
- Predictive dispatching: use historical response data to anticipate optimal vehicle allocation before incidents occur.
- Mobile integration: deliver route guidance and alerts directly to drivers’ tablets or onboard systems.
- Mid-route rerouting: dynamically adjust paths based on evolving traffic and mission priorities.
- Helicopter & multi-mode support: extend routing to include air ambulances and hybrid transport chains.
- Weather awareness: incorporate live weather conditions to adjust ETA predictions and routing safety specially for helicopters.
