Hayaat AI: Intelligent Emergency Blood Routing Network

Inspiration: Crushing the "Zombie Forward" Crisis

Every single day across Pakistan, human lives are lost not because our citizens don't want to help, but because our critical communication lines are fundamentally broken.

In a medical crisis, families panic. They draft a desperate message and blast it on WhatsApp. That message goes viral, mutating across hundreds of group chats. Days—sometimes weeks—after the patient has safely recovered, well-meaning citizens are still forwarding that old appeal, driving through gridlock traffic to hospitals, only to find the crisis was resolved long ago. Meanwhile, a fresh, life-or-death emergency at Jinnah Postgraduate Medical Centre (JPMC) or Mayo Hospital Lahore is happening right now, but its message is buried under the outdated noise.

We call this the "Zombie Forward" phenomenon. It causes severe donor fatigue and wastes precious time. We built Hayaat AI (meaning Life in Urdu) to replace this chaotic, reactive panic with a calm, organized, and location-aware digital routing network.

What It Does

Hayaat AI is an end-to-end civic emergency command dashboard for hospitals, paired with an intelligent, conversational interface for citizens.

Active Crisis Grid: Instead of managing flat, static donor lists, hospitals can input active deficits. Our engine dynamically calculates the exact match.

Hyper-Local Proximity Routing: The system calculates the true transit delay rather than straight-line distance. The AI ranks donors based on actual traffic congestion parameters:

$$ T_{arrival} = T_{base} \times F_{traffic} $$

where $$ T_{arrival} $$ is the True Arrival Time in minutes, $$ T_{base} $$ is the baseline routing distance, and \( F_{\text{traffic}} \) is the localized congestion multiplier (e.g., \( 3.48 \times \) Saddar rush-hour traffic).

Bilingual Pre-Screening Chatbot: Donors text a simulated WhatsApp profile. The chatbot automatically tracks conversation states in English, Urdu (اردو), or Roman Urdu to verify crucial medical eligibility metrics (Weight $$ \ge 50 $$ kg, a safe $$ 90 $$-day donation interval, and high-risk health condition checks) before they leave their homes.

Data Privacy & Compliance ("Right to be Forgotten"): If a donor wants to leave the network, they simply text "UNSUBSCRIBE". The system verifies their parameters (Name, Phone, City, Area) and permanently scrubs their row from the storage database, respecting user data privacy.

How We Built It

Hayaat AI is engineered entirely on a lightweight, highly responsive, and scalable Python stack:

Core UI & Theme Logic: Built using Gradio Blocks, completely overridden with custom cascading stylesheets (CSS) to establish a premium dark slate and clinical crimson medical aesthetic with high contrast readability.

Data Wrangling & Pipeline: Pandas and NumPy power the backend to parse, split, and sort geographic clusters on the fly.

Database Infrastructure: A secure, persistent local CSV-file architecture (donor_registry.csv) with automatic file-writing safeguards to guarantee permanent storage without heavy operational overhead.

Cloud Deployment: Hosted and compiled live on Hugging Face Spaces.

Challenges We Ran Into

Our biggest challenge was visual rendering and accessibility constraints inside Gradio's dark-mode framework. Forcing a global stylesheet caused several internal components—such as unselected navigation tabs, markdown instructional text, and dropdown action menus inside the interactive dataframes—to display white text on a white background, making them invisible.

We had to surgically analyze the document object model (DOM) tree and inject highly specific CSS rules using parents, hover selectors, and custom class targets with !important flags to restore crisp, high-contrast visibility. Additionally, designing a state machine in Python that dynamically transitions between language tracks and medical screening steps without dropping session parameters was an intense logic puzzle.

What We Learned

This hackathon was an incredible learning curve. We didn't just learn how to write cleaner Python code; we learned how to design software with empathy. We learned that:

Meet users where they are: Designing a standalone mobile app fails because users won't download it until it is too late. Leveraging existing communication loops (like WhatsApp) is the only way to scale civic tech.

Privacy is a feature, not an afterthought: Building a robust unsubscription mechanism to protect citizen data is just as important as matching donors.

What's Next for Hayaat AI

We are committed to bringing Hayaat AI into the real world. Our future expansion roadmap is split into three concrete phases:

Phase 1 (Production Engine): Transition our local chatbot simulator to the official Meta Cloud WhatsApp API gateway, storing user data in secure, cloud-hosted PostgreSQL tables.

Phase 2 (B2B Hospital Portal): Deploy restricted dashboard views for verified blood banks across Pakistan (e.g., Fatimid Foundation, Indus Hospital) to trigger automated localized ping dispatches instantly.

Phase 3 (Predictive Analytics): Build forecasting models to predict seasonal supply deficits (such as Ramadan donation drops or Dengue outbreak spikes) to proactively organize neighborhood donation drives before the crisis hits.

Built With

Share this project:

Updates