Skip to content

HeinThuAung-11/AI-Health-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏥 AI Health Navigator - Project Summary


📊 Project Overview

AI Health Navigator is an intelligent web application that helps patients understand their medical lab reports by translating complex medical terminology into simple, easy-to-understand language using artificial intelligence.


🧠 Authorship Notice:

  • This project, AI Health Assistant, is a collaborative work jointly developed and co-owned by Su Phyu Sin Htet and Hein Thu Aung.
  • The GitHub repository is hosted under HeinThuAung-11 for version control purposes, but all intellectual property, code, and assets are equally shared between both authors.

🎯 What It Does

Core Features:

  1. 📄 PDF Upload & Processing

    • Users upload health report PDFs (blood tests, metabolic panels, etc.)
    • Automatically extracts text, tables, and medical values
    • Handles multi-page reports and complex layouts
  2. 🤖 AI-Powered Analysis

    • Analyzes medical test results using large language models
    • Explains findings in plain English
    • Identifies abnormal values and their significance
    • Assesses urgency level (routine, moderate, urgent)
  3. 💬 Intelligent Q&A

    • Answer specific questions about the report
    • Context-aware responses using semantic search
    • Conversational interface with memory
  4. 📋 Personalized Recommendations

    • Provides actionable next steps
    • Suggests when to follow up with healthcare providers
    • Tailored guidance based on specific results

🛠️ Technologies & Tools Used

Frontend Stack:

  • React.js - User interface framework
  • TailwindCSS - Styling and responsive design
  • Lucide React - Icon library
  • Vercel - Deployment platform (FREE tier)

Backend Stack:

  • Python 3.11 - Programming language
  • FastAPI - High-performance web framework for REST API
  • Uvicorn - ASGI server
  • Pydantic - Data validation and settings management
  • Render - Backend deployment platform (FREE tier)

AI & Machine Learning:

  • Groq API - Ultra-fast LLM inference (FREE tier)
    • Model: Llama 3.3 70B Versatile
    • Used for medical report interpretation and Q&A
  • FAISS (Facebook AI Similarity Search) - Vector database
    • Enables semantic search through reports
    • Powers context-aware Q&A system

PDF Processing:

  • PDFPlumber - Primary PDF text extraction
    • Excellent for structured documents with tables
    • Extracts text and tabular data accurately
  • Unstructured.io (optional fallback) - Complex PDF handling
    • For scanned documents and complex layouts

Data Storage:

  • In-memory storage (current MVP) - Report data during session
  • FAISS local files - Vector embeddings for search
  • Supabase (configured, optional) - PostgreSQL + file storage

Development Tools:

  • Git & GitHub - Version control and collaboration
  • Conda/venv - Python environment management
  • npm - Frontend package management

🏗️ Architecture & Design Patterns

System Architecture:

┌─────────────────────────────────────────┐
│  Frontend (React + Vercel)              │
│  - User Interface                        │
│  - File Upload                           │
│  - Results Display                       │
│  - Chat Interface                        │
└──────────────┬──────────────────────────┘
               │ REST API (HTTPS)
               ▼
┌─────────────────────────────────────────┐
│  Backend (FastAPI + Render)             │
│  ┌─────────────────────────────────┐   │
│  │  API Layer (FastAPI Routes)      │   │
│  │  - /api/upload                    │   │
│  │  - /api/analyze                   │   │
│  │  - /api/ask                       │   │
│  └───────────┬─────────────────────┘   │
│              ▼                           │
│  ┌─────────────────────────────────┐   │
│  │  Service Layer                   │   │
│  │  - PDF Processor                 │   │
│  │  - AI Analyzer (Groq)            │   │
│  │  - Vector Store Manager (FAISS)  │   │
│  └─────────────────────────────────┘   │
└─────────────────────────────────────────┘

Key Techniques:

  1. RESTful API Design

    • Clean, resource-based endpoints
    • Proper HTTP methods (GET, POST, DELETE)
    • Structured JSON responses
  2. Asynchronous Processing

    • FastAPI async/await for non-blocking operations
    • Background tasks for cleanup
  3. Semantic Search

    • Text chunking with overlap
    • Vector embeddings for similarity search
    • Context retrieval for accurate Q&A
  4. Error Handling & Validation

    • Pydantic models for request/response validation
    • Comprehensive error messages
    • Graceful degradation
  5. Security Best Practices

    • Environment variables for API keys
    • CORS configuration
    • File type and size validation
    • Private storage buckets
  6. Cold Start Optimization

    • Health check endpoints
    • User feedback for startup delays
    • Efficient dependency loading

💡 AI Techniques Implemented

1. Prompt Engineering

  • Structured prompts for consistent JSON responses
  • Clear instructions for medical context
  • Role-based system messages
  • Few-shot learning patterns

2. Natural Language Processing

  • Text extraction from semi-structured documents
  • Medical terminology recognition
  • Named entity extraction (test names, values, ranges)

3. Retrieval-Augmented Generation (RAG)

  • Document chunking (500 tokens with 100 token overlap)
  • Vector embeddings for semantic search
  • Context injection into prompts
  • Source attribution

4. Conversation Memory

  • Conversation history tracking
  • Context-aware follow-up responses
  • Multi-turn dialogue support

📈 Technical Achievements

Performance:

  • ⚡ Analysis: 20-30 seconds per report
  • ⚡ Q&A Response: 5-10 seconds
  • ⚡ Cold Start: 30-60 seconds (free tier limitation)

Scalability:

  • 🔄 Stateless API design (easy horizontal scaling)
  • 🔄 Vector store per report (isolated data)
  • 🔄 Background task processing

Reliability:

  • ✅ Comprehensive error handling
  • ✅ Input validation at multiple layers
  • ✅ Fallback responses for AI failures
  • ✅ Health check monitoring

🎓 Skills Demonstrated

Full-Stack Development:

  • Frontend UI/UX design with React
  • Backend API development with Python
  • Database design and data modeling
  • Cloud deployment and DevOps

AI/ML Engineering:

  • LLM integration and prompt engineering
  • Vector database implementation
  • Semantic search and RAG patterns
  • Model selection and optimization

Software Engineering:

  • Clean code architecture
  • RESTful API design
  • Version control with Git
  • CI/CD with automated deployments
  • Documentation and testing

Problem-Solving:

  • PDF parsing challenges
  • Cold start optimization
  • CORS and deployment issues
  • Real-time user feedback

💰 Cost Efficiency

Total Monthly Cost: $0 (MVP on free tiers)

Service Tier Limitation
Vercel Free 100GB bandwidth/month
Render Free 750 hours/month, cold starts
Groq API Free Rate limits, sufficient for MVP
Supabase Free 500MB DB, 1GB storage

🚀 Deployment Pipeline

Local Development
    ↓
Git Commit & Push
    ↓
GitHub Repository
    ├─→ Vercel (Frontend auto-deploy)
    └─→ Render (Backend auto-deploy)
    ↓
Live Production App

Continuous Deployment:

  • Automatic deployments on git push
  • Environment-specific configurations
  • Zero-downtime updates

🎯 Use Cases

  1. Patient Education

    • Understand lab results before doctor visit
    • Learn about specific health metrics
    • Reduce medical anxiety through clarity
  2. Health Literacy

    • Bridge gap between medical jargon and plain English
    • Empower patients with knowledge
    • Encourage informed healthcare decisions
  3. Preliminary Assessment

    • Quick overview of results
    • Urgency determination
    • Guidance on next steps

🔐 Security & Compliance Considerations

  • ✅ API keys stored in environment variables
  • ✅ Private file storage (Supabase)
  • ✅ No persistent storage of PHI (MVP)
  • ✅ HTTPS encryption for all data transfer
  • ⚠️ Disclaimer: Educational purposes only
  • ⚠️ Not HIPAA compliant (MVP stage)

📚 Learning Outcomes

  1. Integrated modern AI APIs into production applications
  2. Implemented RAG architecture for accurate, contextual responses
  3. Deployed full-stack application on cloud platforms
  4. Handled real-world challenges (cold starts, CORS, PDF parsing)
  5. Managed project lifecycle from concept to deployment
  6. Collaborated using Git with version control best practices

🌟 Innovation & Impact

Problem Solved: Medical reports are often confusing and anxiety-inducing for patients. This tool democratizes health literacy by making medical information accessible and understandable.

Technical Innovation:

  • Combined traditional PDF processing with modern LLMs
  • Implemented semantic search for medical context
  • Optimized for cost-effective deployment
  • Created seamless UX despite backend limitations

Potential Impact:

  • Improved patient-doctor communication
  • Reduced healthcare anxiety
  • Better-informed health decisions
  • Accessible healthcare information

🔮 Future Enhancements

  • 👤 User authentication and account system
  • 💾 Persistent report history
  • 📊 Trend analysis across multiple reports
  • 📧 Email report summaries
  • 🌍 Multi-language support
  • 📱 Mobile app (React Native)
  • 🏥 Integration with EHR systems
  • 🔐 HIPAA compliance for production use

📝 Technologies Summary

Languages: Python, JavaScript (React)
Frameworks: FastAPI, React.js
AI/ML: Groq API (Llama 3.3 70B), FAISS
Cloud: Vercel, Render, Supabase
Tools: Git, npm, Conda, PDFPlumber
Architecture: RESTful API, RAG, Microservices


📜 License & Usage

© 2025 Su Phyu Sin Htet and Hein Thu Aung. All Rights Reserved.

This AI Health Assistant project was collaboratively developed by Su Phyu Sin Htet and Hein Thu Aung.
It is protected as original intellectual property.

You may view, read, and cite this repository for educational or research purposes only.
Any reproduction, redistribution, modification, or commercial use of this project, its source code, trained models, or design assets without prior written consent from both authors is strictly prohibited.

For collaboration or licensing discussions, please contact the authors directly.


This project demonstrates proficiency in modern full-stack development, AI/ML integration, cloud deployment, and solving real-world healthcare challenges with technology. 🏆

About

AI Health Navigator is an intelligent web application that helps patients understand their medical lab reports by translating complex medical terminology into simple, easy-to-understand language using artificial intelligence.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors