Inspiration
It started with a question that kept us up at night:
What happens to the person in the wheelchair on the third floor when the fire alarm goes off?
They hear the same alarm everyone else hears. They feel the same panic. But when the crowd rushes toward the stairwell — the only exit most hotel evacuation maps show — they're left behind. Not because anyone wanted to leave them. Because the system was never built for them.
We looked at the state of hotel emergency technology and found something that shocked us: in 2025, the best guidance most hotels can offer a guest in a life-threatening emergency is a laminated paper map taped to the back of a door. Static. Unchanged since the building opened. Completely blind to the fire spreading down the north hallway right now.
300 guests. One building they've never been in before. Zero intelligent guidance.
We built Vanguard because we believe that in the age of AI, no one should die because a system wasn't smart enough to tell them which way to run.
What it does
Vanguard is an AI-powered, real-time hotel emergency response system that thinks, routes, and communicates faster than panic can spread.
The moment a guest triggers SOS — by holding a button, speaking a keyword, or through the Android app — Vanguard springs into action across the entire building simultaneously:
Google Gemini 1.5 Flash reads the emergency message and classifies it in natural language: "CRITICAL — heavy smoke detected, immediate evacuation required." Not a keyword match. Genuine AI understanding of what is happening and how dangerous it is.
The hotel's floor graph updates in real time. Fire in the North Hallway? That node is now blocked. Heavy smoke in the stairwell? It gets a penalty weight that steers every route away from it. Light congestion near the elevator? Factored in. The building is alive with information.
Hazard-aware Dijkstra pathfinding recomputes every active guest's safest route in under 2 milliseconds. The algorithm doesn't just find a path — it finds the optimal path through a dynamic, partially-blocked graph that reflects the building's actual state right now.
And for the guest in the wheelchair? Stairwells are excluded at the algorithm level — not filtered from results afterward, but removed from graph traversal entirely. The system doesn't compute a stairwell route and then catch it. It never considers one. Every path it produces for a mobility-impaired guest is physically accessible, with speed estimates adjusted to their pace and a safety buffer built in. It speaks the route aloud. It guides them home.
A Twilio SMS fires to emergency services the moment the alert is received — priority, room number, AI analysis — so responders are moving before any staff member has even looked at a screen.
Every staff dashboard updates simultaneously via Server-Sent Events. TARS — our Tactical Audio Response System — plays a severity-encoded tone: a gentle chime for low alerts, a tactical double-beep for medium, an oscillating siren for critical. Staff know the severity before they see the screen.
And if the internet goes down — because major emergencies often take the network with them — Vanguard's Android mesh network keeps working. Devices form a peer-to-peer cluster over Bluetooth and Wi-Fi Direct, propagating emergency packets hop by hop across the building until they reach safety.
How we built it
We built Vanguard in four layers, each designed to fail gracefully so the layer beneath it catches what falls.
The Java 21 Spring Boot edge server is the intelligence core. It receives emergency packets, calls Gemini for threat classification, manages the live hotel floor graph, runs the Dijkstra engine, dispatches Twilio SMS alerts, and broadcasts enriched packets to every connected dashboard via Server-Sent Events — all in a single request lifecycle. The EvacuationPathfinder implements hazard-aware Dijkstra with typed danger weights: fire and structural damage set a near-infinite blocking weight; gas leaks weight at 100; flooding at 200; heavy smoke at 50. The algorithm respects these weights in the priority queue so the computed path always reflects real danger, not a cached snapshot from 10 seconds ago.
The React 19 dashboard subscribes to the Java SSE stream and Firebase Firestore simultaneously — two independent real-time channels so the dashboard stays live even if one fails. TARS synthesizes three semantically distinct alert tones entirely in the browser using the Web Audio API oscillator graph. No audio files. No CDN. No dependencies. Just mathematics turned into urgency. The hotel floorplan renders hazard overlays and a live heading arrow that rotates to point toward safety the moment a route is computed.
The Android app runs a background NearbyMeshService as a START_STICKY service — the OS will restart it if it's killed. It forms a P2P_CLUSTER mesh using Google Nearby Connections, automatically advertising and discovering other Vanguard nodes. GeminiVoiceAssistant maintains a stateful Gemini chat session with emergency context injected at crisis onset, so a frightened guest can ask "where do I go?" and get a spoken, grounded answer. AccessibilityLayer orchestrates haptics, AR navigation arrows, voice guidance, and real-time translation in a single crisis response pipeline — so a deaf guest feels the evacuation pattern, a visually impaired guest hears their route, and a foreign-language speaker reads it in their own language.
The AI pipeline runs Gemini 1.5 Flash for cloud classification with a deterministic local keyword scanner as an instant fallback. If the network is gone, classification never stops. If the model is slow, the alert still broadcasts. Nothing in the critical path waits for a single point of failure.
Challenges we ran into
The hardest problem wasn't the AI. It was the graph.
Rebuilding a hotel's adjacency structure on every alert would add tens of milliseconds — an eternity in an emergency. We solved it by separating topology from state: the graph structure is initialized once at startup and never rebuilt. Hazard recalculation mutates node weights in place. Dijkstra traverses the existing structure with current weights. The result is sub-millisecond rerouting that reflects live building conditions without ever paying the cost of a full rebuild.
Accessibility nearly broke us in the right way. Every approach we tried first — filtering stairwells from results, tagging them post-computation, checking the final path — had edge cases where a partially accessible route could slip through. The only architecturally sound solution was embedding the exclusion inside the Dijkstra neighbor-expansion loop itself, so the algorithm never even considers a stairwell node for a mobility-impaired guest. It forced us to rethink the traversal from scratch. It was worth it.
Making Gemini non-blocking required careful pipeline ordering. A 300–800ms cloud API call cannot sit on the critical path of a life-safety system. We structured the pipeline so the alert is stored, the SSE broadcast fires, and the SMS dispatches — all before the AI call completes. The enriched packet with AI analysis arrives as a follow-up update. The system is fast because it never waits.
Mesh deduplication was a distributed systems problem hiding inside a mobile app. Without UUID-based deduplication in MessageRegistry, a single SOS in a 50-device mesh would generate thousands of rebroadcasts in seconds. Every node now checks a processed-ID set before forwarding. The mesh scales because it refuses to amplify noise.
Accomplishments that we're proud of
We are proud that a wheelchair user can trust this system with their life.
Not because we added an accessibility toggle. Because we rebuilt the pathfinding algorithm from scratch to guarantee — at a mathematical level — that every route it produces for a mobility-impaired guest is stairwell-free. We didn't filter. We didn't check. We made it structurally impossible for the algorithm to suggest an inaccessible path. That's the difference between a feature and a commitment.
We are proud of sub-2 millisecond rerouting — measured live, on a JVM, under real concurrent load. When a new hazard appears, every guest's route updates before a human can perceive the change.
We are proud of TARS — a sound engine that encodes meaning in audio. Three synthesized tones, generated in real time by the Web Audio API, that tell a staff member the severity of an emergency before they look at a screen. Gentle chime. Tactical beep. Oscillating siren. No files. No dependencies. Just math and urgency.
We are proud that the system we built fails gracefully in every direction. Gemini down? Local classifier activates. SSE disconnected? Firestore snapshot takes over. Internet down? The mesh keeps going. We designed Vanguard for the worst moments — the ones where everything that can go wrong does.
And we are proud that we built something real. A live API. Actual Twilio SMS delivery. Demonstrated sub-second end-to-end latency from SOS tap to staff dashboard alert with audio. Not a mockup. Not a demo with stubbed endpoints. A system that works.
What we learned
We learned that the most important engineering decision in a safety-critical system is what happens when it fails.
Every feature we built forced us to ask: what does this look like at 2am when the building is on fire and the network is down and the API is timing out? That question changed every design choice we made. It gave us the dual-AI pipeline. It gave us the dual real-time channel. It gave us the offline mesh. Resilience isn't a feature you add at the end. It's a philosophy you either start with or never have.
We learned that accessibility is an algorithmic problem, not a UX problem. The instinct is to solve it at the interface layer — add a toggle, show a different screen. The right solution is to solve it in the math. When accessibility lives inside the graph traversal, it cannot be bypassed, overridden, or forgotten in an edge case. It is simply true.
We learned that Gemini is a genuine engineering tool for real-time safety systems. Not a demo trick. The Flash model's instruction-following quality and latency profile make zero-shot severity classification reliable enough that we trust it with emergency triage. That trust was earned through testing, not assumed.
And we learned something quieter: that the people most underserved by emergency systems are often the ones most in danger. Mobility-impaired guests. Elderly guests. Non-English speakers. Deaf guests. Building a system that works for all of them isn't a stretch goal — it's the only definition of success that matters.
What's next for Vanguard
We want to put Vanguard in a real hotel. Not as a pilot. As the system.
The immediate step is replacing the demo graph with JSON-configurable multi-floor property maps, so any hotel can describe their building and Vanguard becomes theirs — no code changes required.
Next, we integrate the CCTV CNN module as a first-class alert source. Right now, a guest has to press SOS for Vanguard to respond. In the next version, Vanguard's cameras see the smoke before anyone smells it.
We're completing the WebRTC voice channel — so a frightened guest can speak directly to a responder through the same app that's routing them to safety.
We're deploying Gemma 2B locally on the edge server for fully air-gapped environments: hospitals, government buildings, anywhere that cannot send data to an external AI endpoint.
And we're building toward the enterprise vision: a single platform for hotel chains, with cross-property alert visibility, BMS integration, predictive evacuation modeling, and automated regulatory compliance reporting.
But underneath all of it — the roadmap, the enterprise features, the scaling architecture — there is one person we keep thinking about.
The guest in the wheelchair on the third floor.
The alarm is going off. The crowd is rushing toward the stairs. And Vanguard already knows: go south. The corridor is clear. The exit is 22 seconds away. You're going to make it.
That's what we're building toward. That's what's next. Project repository: https://github.com/sreejeetaroy2005-svg/Vanguard-total.git
Log in or sign up for Devpost to join the conversation.