Skip to content

Moeed-Chughtai/HackJunction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Migraine Risk Analysis - Early Warning System 🧠

An AI-powered application that predicts migraine risk 6-24 hours ahead by analyzing your sleep patterns, vital signs, calendar events, and weather conditions.

The Problem

Migraines are unpredictable and debilitating. People need:

  • Early warnings to take preventive action before an attack
  • Understanding of what triggers their migraines and why
  • Personalized insights based on their unique health patterns
  • Actionable recommendations to reduce risk

Current solutions don't intelligently combine multiple data sources or explain the physiological mechanisms behind risk predictions.

What This Application Does

This system uses specialized AI agents to analyze your health data and provide:

  1. Risk Prediction - A 0-100 risk score with low/medium/high classification
  2. Multi-Domain Analysis - Combines sleep, vitals, calendar, and weather data
  3. Scientific Explanations - Explains WHY you might get a migraine (not just that you might)
  4. Personalized Recommendations - Actionable advice tailored to your profile and triggers
  5. Early Warning System - Watchdog alerts when risk factors are detected
  6. AI Assistant During Migraines - When you have a migraine, an AI agent calls you to help with tasks you can't do yourself

Features

Multi-Agent Analysis System

  • Sleep Agent: Analyzes sleep duration, efficiency, stages, and awakenings
  • Vitals Agent: Monitors heart rate, HRV, blood pressure, and SpO2
  • Calendar Agent: Identifies stressful events and busy periods
  • Weather Agent: Assesses environmental factors (barometric pressure, etc.)
  • Coordinator Agent: Synthesizes all insights into a holistic risk assessment

Personalization

  • User Profiles: Default, sensitive, and resilient profiles with different risk thresholds
  • Baseline Learning: Learns your personal baselines from historical data
  • Trigger Tracking: Remembers your known migraine triggers
  • Adaptive Thresholds: Adjusts warnings based on your sensitivity level

Features

  • Real-time Risk Dashboard: Live risk score with agent-by-agent breakdown
  • Calendar Warnings: Upcoming stressful events with risk explanations
  • Health Chatbot: Ask questions about your health data and get personalized answers
  • Voice Onboarding: ElevenLabs-powered conversational setup
  • History Dashboard: View trends and patterns over time with interactive charts
  • Watchdog Status: Alert system (OK, Alert, Happening, Passed) with popup controls
  • Email to GP: Pre-drafted email to share your risk assessment with healthcare providers
  • Migraine Feedback: Log actual migraine events to improve predictions

AI Assistant Call Feature

When you have a migraine, the AI calls you to help with tasks you can't do yourself:

When a migraine strikes, you're often unable to handle everyday tasks. The AI assistant will call you and help with:

  • Cancelling or rescheduling events - Meetings, appointments, social plans
  • Ordering comfort food - Food delivery, groceries, or medications
  • Messaging contacts - Quick texts to let people know you're unavailable
  • Calling loved ones - Reaching out to family or friends for support
  • Arranging transportation - Getting rides if needed
  • Any other assistance - Whatever you need help with during the attack

No more struggling to cancel meetings or order food while dealing with a migraine. The AI handles it for you.

Scientific Foundation

  • Research-Backed: Analysis based on peer-reviewed migraine research
  • Mechanistic Explanations: Explains physiological pathways (neurochemistry, vascular reactivity)
  • Compound Risk Modeling: Understands that multiple factors multiply risk (not just add)
  • Prodromal Recognition: Identifies 24-72 hour warning signs before attacks

Quick Start

Backend Setup

# Install dependencies
cd backend
pip install -r requirements.txt

# Create .env file
echo "OPENAI_API_KEY=your_key_here" > .env

# Run the server
python app.py

Backend runs on http://localhost:5001

Frontend Setup

# Install dependencies
cd frontend
npm install

# Create .env.local file
echo "NEXT_PUBLIC_API_URL=http://localhost:5001" > .env.local
echo "NEXT_PUBLIC_ELEVENLABS_AGENT_ID=your_agent_id" >> .env.local

# Run the development server
npm run dev

Frontend runs on http://localhost:3000

Tech Stack

  • Backend: Python 3.11+, Flask, LangChain, OpenAI GPT-4o-mini
  • Frontend: Next.js, React, TypeScript, Tailwind CSS
  • Voice: ElevenLabs Conversational AI
  • Storage: Local JSON files (easily migratable to database)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •