ALAVIA AI - From Voice to Prevention

Inspiration

In Nigeria, health emergencies often begin with uncertainty.

Chest pain is dismissed as stress. Fever is self-medicated. Breathing difficulty is "waited out."

Many people do not know which hospital to go to , or whether their symptoms are urgent.

We were inspired by a simple question:

What if prevention started with your voice?

The hackathon theme "Data to Prevention: AI as Health Partner", challenged us to rethink AI in healthcare. Instead of building another chatbot, we wanted to build something responsible, preventive, and locally relevant.

That became ALAVIA AI.


What ALAVIA AI Does

ALAVIA AI is a voice-first, multilingual AI health partner designed for Nigeria.

Users can:

  • Speak symptoms in English, Pidgin, Yoruba, Hausa, or Igbo
  • Receive structured follow-up questions
  • Get severity classification (LOW, MEDIUM, HIGH, CRITICAL)
  • Receive first-aid guidance
  • View real Lagos hospitals on a map
  • See hospital facilities and specialties
  • Navigate directly to the most appropriate hospital

It is not a diagnostic AI. It is a prevention-first triage and routing system.


How We Built It

1. Voice to Structured Data

We integrated OpenAI for:

  • Speech-to-text (STT)
  • Text-to-speech (TTS)

The backend receives audio temporarily, transcribes it, deletes the raw file, and stores only encrypted transcript data.

We made a deliberate design decision:

AI assists with language understanding. Rules determine safety and severity.

2. Rule-Based Triage Engine

Instead of allowing AI to freely determine medical severity, we implemented deterministic red-flag logic.

For example, if a user reports chest pain and shortness of breath:

$$\text{Severity} = \textbf{CRITICAL}$$

This guarantees consistency, safety, and explainability. AI is used only to phrase responses and handle multilingual communication, it cannot override red-flag safety rules.

3. Real Lagos Hospital Routing

We used the OpenStreetMap Overpass API to fetch real hospitals in Lagos State. Hospitals are stored locally and ranked based on:

$$\text{Score} = w_d \cdot \text{Distance} + w_s \cdot \text{SpecialtyMatch} + w_f \cdot \text{FacilityMatch} + w_e \cdot \text{EmergencyBonus}$$

Where:

  • $\text{Distance}$ is computed using the Haversine formula
  • $\text{SpecialtyMatch}$ ensures the hospital can handle the condition
  • $\text{FacilityMatch}$ accounts for required infrastructure
  • $\text{EmergencyBonus}$ boosts emergency-ready hospitals

The Haversine distance formula used:

$$d = 2r \cdot \arcsin!\left(\sqrt{\sin^2!\left(\frac{\Delta\phi}{2}\right) + \cos(\phi_1)\cos(\phi_2)\sin^2!\left(\frac{\Delta\lambda}{2}\right)}\right)$$

This ensures users are routed to the most appropriate hospital, not just the nearest one.


Technical Stack

Layer Technology
Backend Laravel API
Frontend Voice interface with OpenStreetMap / Leaflet
AI Integration OpenAI (STT & TTS)
Hospital Data OpenStreetMap Overpass API
Security AES-encrypted transcripts, automatic audio deletion

Data Protection by Design

We made privacy central to the system:

  • Raw audio is deleted immediately after transcription
  • Transcripts are encrypted at rest
  • Minimal data retention
  • Users can delete their consultation history

AI in healthcare must be trustworthy, not just intelligent.


Challenges We Faced

Deployment Without SSH

Deploying Laravel on shared hosting required manual configuration, resolving environment issues, managing database credentials, and handling storage without command-line access. This forced us to deeply understand Laravel's deployment structure and environment management.

OpenStreetMap Data Handling

OpenStreetMap data varies in completeness. We implemented area-based and bounding-box fallback queries, caching mechanisms, and validation for missing coordinates or unnamed hospitals.

AI Safety

Allowing AI to fully determine medical severity could produce unsafe outcomes. We learned that deterministic guardrails are essential AI should assist human logic, not replace it.

Multilingual Speech Recognition

Speech recognition quality varies across Nigerian languages and accents. To mitigate this, users can confirm transcripts, structured follow-up questions reduce ambiguity, and rule-based logic ensures safety regardless of phrasing.


What We Learned

  • AI must be paired with responsibility
  • Prevention has more impact than reactive diagnosis
  • Voice significantly lowers healthcare access barriers
  • Local context improves system effectiveness
  • Intelligent systems require structured safety design

Why ALAVIA AI Matters

In many situations, the greatest health risk is not the illness itself , it is the delay.

ALAVIA AI reduces that delay by detecting red flags early, guiding users safely, routing intelligently, and making prevention accessible in local languages.

Prevention should not begin at the hospital door. It should begin at your voice.

Built With

Share this project:

Updates