This project is a health data management and AI-assisted analysis platform. It combines personal health record management with advanced AI capabilities for data analysis and medical information retrieval using RAG.
Health assistant powered by a RAG pipeline using Langchain.
Video assistant powered by HeyGen.
Overview of your health metrics, vitals, and analytics in one unified interface.
Secure storage and vectorization of your medical records with automatic transcription.
Track vital signs in real-time and monitor your daily activities and fitness progress.
Monitor your nutrition and generate comprehensive health reports for healthcare providers.
- Integration with Arduino sensors for vital signs monitoring and live dashboard updates
- Structured data collection and analysis for health trends via ESP8266 and Supabase
- Multi-modal interaction with voice, text, and video interfaces using Gemini 2.0 and HeyGen AI
- RAG pipeline powered by Langchain for personalized health insights
- Medical knowledge search and verification using Tavily API
- Secure storage and automatic transcription of medical records
- Document vectorization with Cohere embeddings for semantic search
- Health reports generation combining structured sensor data and unstructured medical records
- Frontend: Next.js with TypeScript
- Backend: FastAPI (Python)
- Database: Supabase (PostgreSQL with pgvector extension)
- AI/ML: Langchain, OpenAI API, Cohere embeddings
- External APIs: Tavily for medical web search
- Node.js (v14 or later)
- Python (v3.8 or later)
- Supabase account
- OpenAI API key
- Gemini API key
- Tavily API key
- Cohere API key
- Resend API key
- Nutritionix API key
-
Clone the frontend repository:
git clone https://github.com/CubeStar1/health-monitor-next.git cd health-monitor-next
-
Install frontend dependencies:
npm install
-
Clone the Python backend repository:
git clone https://github.com/CubeStar1/health-monitor-api.git cd healthhub-backend
-
Set up the Python backend:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate` pip install -r requirements.txt
-
Set up environment variables: Create a
.env
file in the frontend root directory and a.env
file in the backend directory with the following contents:# Frontend .env (in health-monitor-next directory) # Supabase NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABAE_ADMIN=your_supabase_service_role_key # FastAPI NEXT_PUBLIC_API_URL=http://localhost:8000 API_URL=http://localhost:8000 # Resend RESEND_API_KEY=your_resend_api_key RESEND_DOMAIN=your_resend_domain # Nutritionix API NUTRITIONIX_API_URL=https://trackapi.nutritionix.com/v2 NUTRITIONIX_APP_ID=your_nutritionix_app_id NUTRITIONIX_API_KEY=your_nutritionix_api_key # DB Credentials NEXT_PUBLIC_DB_USER=<your_db_user> NEXT_PUBLIC_DB_PASSWORD=<your_db_password> NEXT_PUBLIC_DB_HOST=<your_db_host> NEXT_PUBLIC_DB_PORT=<your_db_port> NEXT_PUBLIC_DB_NAME=<your_db_name>
# Backend .env (in health-monitor-api directory) OPENAI_API_KEY=<your_openai_api_key> LOCAL_LLM_URL=<your_local_llm_url> GOOGLE_API_KEY=<your_google_api_key> COHERE_API_KEY=<your_cohere_api_key> TAVILY_API_KEY=<your_tavily_api_key> SUPABASE_URL=<your_supabase_project_url> SUPABASE_KEY=<your_supabase_service_role_key>
-
Start the development servers:
# In the frontend directory cd health-monitor-next npm run dev # In a new terminal, navigate to the backend directory cd path/to/health-monitor-api uvicorn main:app --reload
When a medical record is uploaded:
- The file is sent to the backend for processing.
- If it's a PDF, it's converted to text using PyPDF2. If it's an image, OCR is performed using Tesseract.
- The extracted text is then sent to Cohere to generate embeddings.
- The embeddings, along with the original text and metadata, are stored in the Supabase vector database.
This process allows for efficient semantic search and retrieval of relevant information during chat interactions