A newer version of the Gradio SDK is available: 6.13.0
Microbiome-Immunotherapy Clinical Decision Support System
An Evidence-Based Clinical Decision Support Tool
This project provides a sophisticated clinical decision support system that optimizes immunotherapy (ICI/ACT) treatments based on a patient's gut microbiome profile. It leverages MedGemma 1.5 4B and a specialized RAG pipeline to generate evidence-based clinical reports.
Architecture Overview
The system processes patient data and clinical evidence through a modular pipeline to produce a 6-section clinical report:
- Microbiome Composition: Profile of diversity and key taxa.
- Metabolite Landscape: Analysis of SCFAs, bile acids, and tryptophan.
- Drug-Microbiome Interaction: Core interpretation of microbiome impact on drug efficacy.
- Confounding Factors: Impact of antibiotics, PPIs, and prior treatments.
- Intervention Considerations: Evidence-based dietary or probiotic suggestions.
- Data Quality & Limitations: Assessment of report confidence.
Each section is generated using targeted RAG retrieval from a database of peer-reviewed medical literature.
Key Features
- EHR Extraction: Automatically parses raw Electronic Health Records (EHR) text into structured patient data using MedGemma.
- Medical RAG: Domain-specific retrieval system using PubMedBERT embeddings and table-aware chunking.
- Multi-Model Support: Designed for MedGemma 1.5 but extensible to other LLMs.
Project Structure
βββ rag/ # RAG pipeline for indexing medical papers
βββ src/ # Core application logic (models, prompts, generators)
βββ data/ # Patient data and clinical inputs
βββ outputs/ # Generated clinical reports (Markdown)
βββ generate_report.py # Main CLI entry point
βββ requirements.txt # Project dependencies
Getting Started
Prerequisites
- First get the RAG ready. See
rag/README.mds - Python 3.10+
- CUDA-compatible GPU (recommended for MedGemma and PubMedBERT)
- HuggingFace access for
google/medgemma-1.5-4b-it
Installation
- Clone the repository.
- Install dependencies:
pip install -r requirements.txt pip install -r rag/requirements.txt
Usage
Generate a report from structured patient JSON (see data/template/patient_schema_template.json):
python generate_report.py data/patient_example.json
Generate a report from raw EHR text:
python generate_report.py data/patient_ehr.txt --save-ehr-json outputs/patient_profile.json
Examples
See data/sample_input for EHR examples and output for the corresponding output
Configuration
Settings for model IDs, device selection (CPU/GPU), and RAG parameters can be found in src/config.py.