Inspiration

The inspiration for HorizonFlow came from hearing about problems faced by cruise lines that I work with. A large cruise is a constrained space with a lot of vacationers, trying to engage in a lot of activities. The on-board guest experience on a cruise can be affected by so many problems such as the 20-minute wait for the buffet, the overcrowded pool deck, and the struggle to find a quiet corner.

To address this problem at scale, looking at the ship from a different perspective helps. A modern cruise ship isn't just a hotel; it's a massive, floating IoT device generating terabytes of data every second from wearables, Wi-Fi access points, and door sensors. At present, all this data is "at rest" in dashboards that are reviewed too late to matter.

Was inspired by the "AI on Data in Motion" theme to ask: What if the ship could think? What if it could use streaming data to detect a crowd forming and use AI to gently disperse it before guests get frustrated? The objective is to move from reactive reporting to proactive, real-time crowd orchestration.

What it does

HorizonFlow is a real-time crowd optimization agent. It ingests live sensor data to visualize passenger density across the ship. When a zone reaches critical capacity, it doesn't just sound an alarm. It uses Google Gemini to analyze the context—weather, time of day, and open venues—and automatically pushes personalized, incentives to guests' mobile apps (e.g., "The pool is busy, but the Jazz Lounge has open seats and a 2-for-1 special right now") to naturally redistribute the flow of people.

How was it built

HorizonFlow was built by creating a "nervous system" with Confluent and a "brain" with Google Cloud Vertex AI.

  1. The Nervous System (Sense & Detect): Mock IoT data was generated simulating thousands of guest wearables. The data was streamed into Confluent Cloud Kafka topics. Then used Flink SQL on Confluent to perform stateful processing, aggregating these individual signals into 60-second tumbling windows to calculate real-time density scores for different ship zones. Flink is configured to emit a Bottleneck Alert event when density exceeds a defined threshold.

  2. The Brain (Reason & Act) Used Google Vertex AI (Gemini 1.5 Pro) as the reasoning agent. To connect the streaming world to the AI world, utilized the Gemini APIs.

When Flink detects a bottleneck, Gemini receives the alert. Gemini then outputs a structured recommendation, which is published back to a Kafka topic to trigger a mobile push notification.

Challenges we faced

This was the first time that I was working with a messaging system. Had to brush up on concepts quick. Struggled a bit to transition from relational data thinking to stream thinking. Spent a lot of time on Confluent YouTube playlists.

Making AI Actionable: didn't want to build a chatbot experience that you have to talk to. Instead wanted to build an agent that acts on its own. Learning how to constrain Gemini's output into structured JSON that downstream systems could programmatically act upon (sending a specific push notification) took a little bit of trial and error. So far, getting very deterministic structured outputs (which was very surprising, coming from an LLM). Need to do huge volume testing to test the reliability of the solution.

Learnings

There is incredible power in combining a streaming system's ability to provide the "now" with an LLM's ability to provide the "why" and "what next." Data in motion tells you what is happening, but AI tells you what to do about it. The future of consumer experience isn't just about analyzing past behavior—it's about reacting in the present moment, in the best way.

Built With

Share this project:

Updates