Skip to content

indresh404/Swasthya-AI-Demo

Repository files navigation


🧠 Swasthya AI — Preventive Healthcare Intelligence Platform [DEMO-WEBAPP]

🚀 Overview

Swasthya AI is an AI-powered preventive healthcare platform designed to shift healthcare from reactive treatment to proactive monitoring.

It enables continuous health tracking through a memory-aware conversational AI, real-time risk analysis, and intelligent doctor support systems — ensuring early detection, improved outcomes, and safer medical decisions.


🎯 Core Idea

Swasthya AI builds a continuous health intelligence loop where:

  • Patients interact daily with an AI assistant
  • The system learns and tracks their health patterns over time
  • Risk scores are dynamically generated
  • Doctors are automatically notified when intervention is needed

This creates a data-driven, proactive healthcare ecosystem instead of episodic doctor visits.


🧩 Key Capabilities

  • 🧠 Memory-aware AI conversations
  • 📊 Continuous health monitoring
  • ⚠️ Early risk detection
  • 👨‍⚕️ Intelligent doctor insights
  • 💊 Medication safety checks
  • 👨‍👩‍👧‍👦 Family-level health intelligence

🔑 Features

🧍 Patient Application

🤖 Conversational AI Assistant

  • Natural chat-based interaction
  • Understands patient history and context
  • References past symptoms intelligently
  • Generates personalized follow-up questions

📅 Daily Health Check-In

  • AI-generated personalized questions

  • Based on:

    • Past symptoms
    • Medical conditions
    • Behavioral patterns
  • Captures daily health signals


🧠 Symptom Intelligence Engine

  • Converts natural language into structured medical data

  • Extracts:

    • Symptom type
    • Severity
    • Duration
    • Body location
  • Enables downstream analytics and tracking


📊 Dynamic Risk Scoring System

  • Combines multiple inputs:

    • Symptoms
    • Chronic conditions
    • Medication adherence
    • Family history
    • Behavioral signals
  • Outputs:

    • Risk score (0–100)
    • Risk category
    • Clinical reasoning
    • Confidence level

🧍‍♂️ Body Heatmap Visualization

  • Visual representation of health risks across body zones
  • Color-coded severity indicators
  • Real-time updates based on new data

💊 Medication Safety System

  • Detects potential drug interactions

  • Provides:

    • Severity classification
    • Plain-language explanation
    • Safety recommendations

⏱️ Adherence Tracking

  • Monitors medication intake patterns
  • Detects missed doses
  • Generates alerts for critical non-adherence
  • Adapts reminder timing based on behavior

🧬 Family Health Intelligence

  • Aggregates health trends across family members
  • Identifies shared symptom patterns
  • Detects potential environmental or infectious signals
  • Maintains strict individual data privacy

🏥 Scheme & Support Matching

  • Matches patients with relevant healthcare schemes

  • Based on:

    • Condition
    • Age
    • Socio-economic profile
  • Provides eligibility and benefit details



👨‍⚕️ Doctor Dashboard

🌅 Automated Patient Briefing

  • Prioritized list of patients needing attention

  • Generated based on:

    • Risk levels
    • Alerts
    • Behavioral anomalies

📊 Patient Health Analytics

  • Longitudinal health data view
  • Risk trends and event markers
  • Symptom timelines
  • Adherence insights

🧾 AI-Generated Clinical Summary

  • Consolidated patient overview

  • Includes:

    • Symptom progression
    • Risk evolution
    • Behavioral patterns

💬 Natural Language QnA Interface

  • Doctors can query patient data in plain language
  • Responses are generated strictly from available data
  • Includes source references for traceability

🔁 Async Patient Query Loop

  • If required data is missing:

    • System generates a question
    • Delivered to patient in next interaction
    • Response is captured and relayed back to doctor


🏗️ System Architecture

⚙️ Core Principle

Orchestration Layer → n8n  
Processing Layer → FastAPI  
AI Layer → LLM (Groq)  
Data Layer → Supabase (PostgreSQL)

🔄 Data Flow

  1. Patient sends message
  2. Orchestration layer triggers backend
  3. AI processes input and extracts structured data
  4. Data stored in database
  5. Session summary generated
  6. Risk score computed
  7. Alerts triggered if thresholds are exceeded
  8. Doctor dashboard updated

🧠 AI & NLP Pipeline

  • Context-aware conversation generation
  • Structured JSON output enforcement
  • Symptom extraction from natural language
  • Clinical summarization
  • Data-grounded QnA system

🧮 Risk Scoring Engine

Hybrid Approach

1. Deterministic Base Score

  • Rule-based scoring using:

    • Conditions
    • Symptoms
    • Adherence
    • Demographics

2. AI Adjustment Layer

  • Adjusts score within a bounded range
  • Uses contextual reasoning

3. Confidence Score

  • Based on:

    • Data availability
    • Interaction history
    • Profile completeness

🔍 RAG-Based Reasoning

  • Uses structured knowledge sources

  • Retrieves relevant medical guidelines

  • Enhances:

    • Risk explanations
    • Clinical summaries
  • Ensures explainability and grounding


🧩 Modular Backend Design

Core Services

  • Chat Processing Service
  • Symptom Extraction Service
  • Risk Calculation Engine
  • Doctor Query Engine
  • Safety Monitoring Service
  • Scheme Matching Engine

🔄 Event-Driven Workflow

  • Session-based triggers
  • Scheduled monitoring jobs
  • Real-time alert generation
  • Asynchronous data collection loops

🧾 Technology Stack

🖥️ Backend

  • Python (FastAPI)
  • Pydantic (data validation)
  • httpx (API communication)

⚙️ Orchestration

  • n8n (workflow automation)

🧠 AI Layer

  • Groq (LLaMA models)
  • LangChain (RAG pipeline)
  • Sentence Transformers (embeddings)

🗄️ Database

  • Supabase (PostgreSQL)
  • Real-time data sync

📱 Frontend

  • React Native (patient interface)
  • Next.js (doctor dashboard)

📊 Visualization

  • SVG / Three.js (body heatmap)

🔗 Integrations

  • OpenFDA (drug interaction data)
  • Firebase (authentication & notifications)
  • Wearable APIs (Google Fit, Apple Health)

🔐 System Reliability & Safety

  • Schema validation for all AI outputs
  • No unverified data stored
  • Deterministic decision layers for critical logic
  • Strict grounding for doctor-facing responses
  • Graceful fallback mechanisms

🚀 Future Enhancements

  • Advanced predictive analytics
  • Multi-language support
  • Real-time wearable integration
  • Personalized health recommendations
  • Hospital system integrations

📌 Conclusion

Swasthya AI transforms healthcare into a continuous, intelligent, and proactive system, enabling better decisions, early interventions, and improved patient outcomes through the integration of AI, data, and automation.


About

Swasthya AI is a demo AI-powered preventive healthcare platform for continuous monitoring, risk analysis, symptom tracking, and intelligent doctor support.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors