Skip to content

rounak890/medfusion

Repository files navigation

🧠 AI Healthcare Multi-Agent System

A modular AI-powered healthcare assistant built using LLMs + LangChain, designed to provide structured, personalized insights based on disease detection and patient data.


🚀 Overview

This project is not a general chatbot. It is a multi-agent system that:

  • Takes structured medical JSON input
  • Uses specialized AI agents for different tasks
  • Produces schema-constrained outputs
  • Integrates ML disease detection + LLM reasoning

🧩 System Architecture

User Input (Medical JSON / Image)
↓
Disease Detection Models
↓
Structured JSON Output
↓
LangChain Agent Router
├── Lifestyle Suggestor Agent
├── Hospital Finder Agent (with external API)
├── Cost Estimator Agent
└── Diet Planner Agent
↓
Response Aggregator
↓
Final Structured Output

🤖 AI Agents

1. 🧘 Lifestyle Suggestor Agent

  • Generates personalized lifestyle recommendations
  • Focus: habits, sleep, exercise, stress

2. 🏥 Hospital Finder Agent

  • Finds relevant hospitals based on disease & location
  • Can integrate with APIs (Google Maps / SerpAPI)

3. 💰 Cost Estimator Agent

  • Provides approximate treatment cost (INR)
  • Includes cost breakdown and influencing factors

4. 🥗 Diet Planner Agent

  • Generates disease-specific diet plans
  • Supports Indian food context and dietary preferences

🧪 Disease Detection Models

The system integrates pretrained deep learning models for automated disease prediction:

🫁 Pneumonia Detection

👁️ Diabetic Retinopathy (DR)

🧠 Alzheimer Detection


⚙️ Tech Stack

  • LLM: Gemini API
  • Framework: LangChain
  • Backend: Node.js / Python (extensible)
  • ML Models: HuggingFace Transformers
  • Data Format: Structured JSON

📦 Input Format

All agents consume a standardized JSON input:

{
  "patient": {
    "age": 45,
    "gender": "male"
  },
  "disease": {
    "name": "Type 2 Diabetes",
    "severity": "moderate"
  },
  "location": {
    "city": "Chandigarh"
  },
  "preferences": {
    "diet_type": "vegetarian",
    "budget": "medium"
  }
}

▶️ Run Locally

Prerequisites

  • Node.js
  • Gemini API Key

Steps

  1. Install dependencies:

    npm install
  2. Set your API key in .env.local:

    GEMINI_API_KEY=your_api_key_here
    
  3. Run the app:

    npm run dev

🎯 Key Features

  • ✅ Multi-agent architecture (not a chatbot)
  • ✅ Structured medical reasoning
  • ✅ Modular and scalable design
  • ✅ Integration of ML + LLM
  • ✅ Real-world healthcare use-case

🧠 How This Differs from ChatGPT

Feature ChatGPT This System
Input Type Unstructured text Structured JSON
Output Free-form Schema-constrained
Architecture Single model Multi-agent system
External Tools Limited Integrated APIs
Domain Focus General Healthcare-specific

🔮 Future Improvements

Real-time hospital API integration

Patient history tracking

Risk prediction models

Doctor recommendation ranking system

⚠️ Disclaimer This system is for educational and assistive purposes only and does not replace professional medical advice.

📌 Author Developed as part of an AI healthcare system project using modern LLM orchestration techniques.

Releases

No releases published

Packages

 
 
 

Contributors