Add README and WRITEUP documentation; update ingest_data.py comments and agents.py docstring
Browse files- README.md +142 -0
- WRITEUP.md +112 -0
- scripts/ingest_data.py +1 -1
- src/agents.py +1 -1
README.md
CHANGED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Med-I-C — Infection Lifecycle Orchestrator
|
| 2 |
+
|
| 3 |
+
**MedGemma Impact Challenge submission** | Deadline: Feb 24, 2026
|
| 4 |
+
|
| 5 |
+
A multi-agent clinical decision-support system for antimicrobial stewardship, powered by MedGemma and TxGemma (HAI-DEF models).
|
| 6 |
+
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
## What it does
|
| 10 |
+
|
| 11 |
+
Med-I-C guides clinicians through two stages of infection management:
|
| 12 |
+
|
| 13 |
+
- **Stage 1 — Empirical** (no lab results yet): Patient history → empirical antibiotic recommendation
|
| 14 |
+
- **Stage 2 — Targeted** (lab results available): Lab report image/PDF (any language) → pathogen extraction → MIC trend analysis → targeted prescription
|
| 15 |
+
|
| 16 |
+
Key capability: **MIC creep detection** — flags rising resistance trends before the lab formally reports "Resistant", giving clinicians a 6–18 month early-warning window.
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## Architecture
|
| 21 |
+
|
| 22 |
+
```
|
| 23 |
+
Patient Data ──▶ [Agent 1: Intake Historian] ──▶ (no lab) ──▶ [Agent 4: Clinical Pharmacologist]
|
| 24 |
+
│ ▲
|
| 25 |
+
└──▶ (lab uploaded) ──▶ [Agent 2: Vision Specialist] │
|
| 26 |
+
│ │
|
| 27 |
+
[Agent 3: Trend Analyst] ─────┘
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
| Agent | Model | Role |
|
| 31 |
+
|-------|-------|------|
|
| 32 |
+
| Intake Historian | MedGemma 4B IT | Parse EHR notes, calculate CrCl, identify MDR risk factors |
|
| 33 |
+
| Vision Specialist | MedGemma 4B IT (multimodal) | Extract pathogen + MICs from lab images/PDFs in any language |
|
| 34 |
+
| Trend Analyst | MedGemma 27B Text IT | Detect MIC creep, compute resistance velocity vs EUCAST breakpoints |
|
| 35 |
+
| Clinical Pharmacologist | MedGemma 4B IT + TxGemma 9B | Select antibiotic, dose, check drug interactions, apply WHO AWaRe |
|
| 36 |
+
|
| 37 |
+
**Orchestration:** LangGraph | **Knowledge base:** SQLite (EUCAST, WHO AWaRe, ATLAS, DDInter) + ChromaDB (IDSA guidelines, WHO GLASS) | **UI:** Streamlit
|
| 38 |
+
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
## Quick Start
|
| 42 |
+
|
| 43 |
+
### Prerequisites
|
| 44 |
+
|
| 45 |
+
- Python 3.11+
|
| 46 |
+
- [`uv`](https://docs.astral.sh/uv/) for package management
|
| 47 |
+
- HuggingFace account with MedGemma and TxGemma access granted
|
| 48 |
+
|
| 49 |
+
### 1. Clone and install
|
| 50 |
+
|
| 51 |
+
```bash
|
| 52 |
+
git clone https://github.com/your-org/Med-I-C
|
| 53 |
+
cd Med-I-C
|
| 54 |
+
uv sync
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
### 2. Configure environment
|
| 58 |
+
|
| 59 |
+
```bash
|
| 60 |
+
cp .env.example .env
|
| 61 |
+
# Edit .env — set HUGGINGFACE_TOKEN and choose backend (local or vertex)
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
### 3. Build knowledge base
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
uv run python setup_demo.py
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
This downloads and ingests all open-access data sources (EUCAST breakpoints, WHO AWaRe, IDSA guidelines, DDInter drug interactions) into SQLite and ChromaDB.
|
| 71 |
+
|
| 72 |
+
### 4. Run the app
|
| 73 |
+
|
| 74 |
+
```bash
|
| 75 |
+
uv run streamlit run app.py
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
---
|
| 79 |
+
|
| 80 |
+
## Kaggle Reproduction
|
| 81 |
+
|
| 82 |
+
Open `notebooks/kaggle_medic_demo.ipynb` in Kaggle:
|
| 83 |
+
|
| 84 |
+
1. Add the `mghobashy/drug-drug-interactions` dataset
|
| 85 |
+
2. Add your HuggingFace token as a Kaggle secret (`HF_TOKEN`)
|
| 86 |
+
3. Run all cells — the notebook sets up the full environment and launches the app via a public tunnel
|
| 87 |
+
|
| 88 |
+
Tested on Kaggle T4 GPU (16 GB VRAM) using 4-bit quantization for MedGemma 4B and TxGemma 2B.
|
| 89 |
+
|
| 90 |
+
---
|
| 91 |
+
|
| 92 |
+
## Data Sources (all open-access)
|
| 93 |
+
|
| 94 |
+
| Source | Use |
|
| 95 |
+
|--------|-----|
|
| 96 |
+
| [EUCAST v16.0](https://www.eucast.org) | Clinical breakpoint tables for MIC interpretation |
|
| 97 |
+
| [WHO AWaRe 2024](https://aware.essentialmeds.org) | Antibiotic stewardship classification |
|
| 98 |
+
| [IDSA AMR Guidance 2024](https://www.idsociety.org/practice-guideline/amr-guidance/) | Treatment guidelines (RAG) |
|
| 99 |
+
| [Pfizer ATLAS](https://atlas-surveillance.com) | 6.5M MIC surveillance measurements |
|
| 100 |
+
| [WHO GLASS](https://worldhealthorg.shinyapps.io/glass-dashboard/) | 23M+ global AMR surveillance episodes |
|
| 101 |
+
| [DDInter 2.0](https://ddinter2.scbdd.com) | 191,000+ drug-drug interactions |
|
| 102 |
+
| [OpenFDA](https://api.fda.gov/drug/label.json) | Drug labeling and safety data |
|
| 103 |
+
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
## Model Licenses
|
| 107 |
+
|
| 108 |
+
You must accept the model licenses on HuggingFace before use:
|
| 109 |
+
- MedGemma: https://huggingface.co/google/medgemma-4b-it
|
| 110 |
+
- TxGemma: https://huggingface.co/google/txgemma-9b-predict
|
| 111 |
+
|
| 112 |
+
---
|
| 113 |
+
|
| 114 |
+
## Project Structure
|
| 115 |
+
|
| 116 |
+
```
|
| 117 |
+
Med-I-C/
|
| 118 |
+
├── app.py # Streamlit UI
|
| 119 |
+
├── setup_demo.py # One-command knowledge base setup
|
| 120 |
+
├── src/
|
| 121 |
+
│ ├── agents.py # 4 agent implementations
|
| 122 |
+
│ ├── graph.py # LangGraph orchestrator + conditional routing
|
| 123 |
+
│ ├── loader.py # Model loading (local / Vertex AI / 4-bit quant)
|
| 124 |
+
│ ├── prompts.py # System and user prompts for all agents
|
| 125 |
+
│ ├── rag.py # ChromaDB ingestion and retrieval
|
| 126 |
+
│ ├── state.py # InfectionState schema (TypedDict)
|
| 127 |
+
│ ├── utils.py # CrCl calculator, MIC creep detection
|
| 128 |
+
│ ├── config.py # Pydantic settings
|
| 129 |
+
│ ├── tools/ # Antibiotic, resistance, safety, RAG query tools
|
| 130 |
+
│ └── db/ # SQLite schema, import scripts, vector store
|
| 131 |
+
├── docs/ # Source data files (EUCAST xlsx, IDSA pdf, etc.)
|
| 132 |
+
├── notebooks/
|
| 133 |
+
│ └── kaggle_medic_demo.ipynb
|
| 134 |
+
└── tests/
|
| 135 |
+
└── test_pipeline.py
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
---
|
| 139 |
+
|
| 140 |
+
## Competition Writeup
|
| 141 |
+
|
| 142 |
+
See [WRITEUP.md](WRITEUP.md) for the full 3-page submission document.
|
WRITEUP.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Med-I-C: A Multi-Agent Infection Lifecycle Orchestrator for Antimicrobial Stewardship
|
| 2 |
+
|
| 3 |
+
**Team:** Med-I-C
|
| 4 |
+
**Challenge:** MedGemma Impact Challenge — Agentic Workflow Track
|
| 5 |
+
**Source:** [github.com/your-org/Med-I-C](https://github.com/your-org/Med-I-C) | **Notebook:** [kaggle.com/…/medic-demo](https://kaggle.com)
|
| 6 |
+
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
## 1. Problem Domain
|
| 10 |
+
|
| 11 |
+
Antimicrobial resistance (AMR) is one of the defining health crises of our century. In 2019, AMR was directly responsible for **1.27 million deaths** and contributed to **4.95 million deaths** worldwide (Lancet, 2022). The WHO projects this will rise to **10 million deaths per year by 2050** — surpassing cancer. Critically, 70% of hospital-acquired infections already show resistance to at least one first-line antibiotic.
|
| 12 |
+
|
| 13 |
+
The prescribing clinician faces a compounding problem. At admission, they must choose an empirical antibiotic before any lab results exist, relying on pattern recognition across a patient's comorbidities, prior infections, and local resistance epidemiology. Two to five days later, the microbiology lab returns a culture-and-sensitivity (C&S) report. Here lies a second, underappreciated danger: **MIC creep** — the phenomenon where a pathogen's Minimum Inhibitory Concentration (MIC) drifts upward across successive isolates, remaining formally "Susceptible" (S) while silently approaching the clinical breakpoint. A clinician reading "Susceptible" has no warning that the MIC has quadrupled since the patient's last admission.
|
| 14 |
+
|
| 15 |
+
No existing point-of-care tool simultaneously (1) handles the empirical phase for any suspected infection, (2) reads lab reports in any language or image format, and (3) detects longitudinal MIC creep against authoritative breakpoint references. Med-I-C fills this gap.
|
| 16 |
+
|
| 17 |
+
**Target users:** Hospital physicians and infectious disease (ID) specialists in wards and ICUs, particularly in resource-constrained settings where an ID consultant is not always available.
|
| 18 |
+
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
## 2. System Overview: HAI-DEF Model Usage
|
| 22 |
+
|
| 23 |
+
Med-I-C is a **four-agent pipeline** orchestrated by LangGraph, powered by three HAI-DEF models from Google. Each model is assigned the sub-task for which its architecture is best suited.
|
| 24 |
+
|
| 25 |
+
```
|
| 26 |
+
Patient Data ──▶ [Agent 1: Intake Historian] ──▶ Empirical path ──▶ [Agent 4: Clinical Pharmacologist] ──▶ Prescription
|
| 27 |
+
│ ▲
|
| 28 |
+
└──▶ Lab report available ──▶ [Agent 2: Vision] ──▶ [Agent 3: Trend Analyst] ──┘
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
### Agent 1 — Intake Historian (`MedGemma 4B IT`)
|
| 32 |
+
Parses unstructured patient history text (EHR notes, medication lists, ICD-10 codes). Identifies MDR risk factors (prior MRSA, recent beta-lactam use, healthcare exposure, immunosuppression). Computes renal function using the Cockcroft-Gault equation (Adjusted Body Weight for obese patients) to flag dose-adjustment requirements. Determines infection stage: if no lab report is uploaded, the pipeline routes to empirical therapy; otherwise, it continues to targeted analysis.
|
| 33 |
+
|
| 34 |
+
*Why MedGemma here:* MedGemma 4B IT was trained on medical literature and clinical text, enabling reliable extraction of clinical risk factors from free-text EHR notes — a task where general-purpose LLMs hallucinate or miss domain-specific signals (e.g., distinguishing "MSSA" from "MRSA" in a history note).
|
| 35 |
+
|
| 36 |
+
### Agent 2 — Vision Specialist (`MedGemma 4B IT`, multimodal)
|
| 37 |
+
Accepts lab reports as **PNG, JPG, or PDF in any language**. Using MedGemma's vision-language capabilities, it extracts pathogen names, MIC values, and S/I/R interpretations from the image, and returns a standardized English JSON regardless of the source language. This directly addresses global deployability: a Spanish antibiogram, a handwritten Arabic lab slip, or a printed Thai culture report all yield the same structured output.
|
| 38 |
+
|
| 39 |
+
*Why MedGemma here:* MedGemma 4B IT is trained on medical imaging and clinical document data, making it uniquely suited for microbiology report OCR and semantics — a document that combines tabular structure, abbreviations (e.g., "R," "≤0.25," "Pip-Tazo"), and clinical terminology.
|
| 40 |
+
|
| 41 |
+
### Agent 3 — Trend Analyst (`MedGemma 27B Text IT`)
|
| 42 |
+
Given current MICs from Agent 2 and historical MICs from the state (populated from prior admissions), this agent computes **Resistance Velocity**:
|
| 43 |
+
|
| 44 |
+
> If MIC_current / MIC_baseline ≥ 4 (a two-step dilution increase), Agent 3 flags **High Risk of Treatment Failure** — even when the lab still reports "Susceptible."
|
| 45 |
+
|
| 46 |
+
MICs are validated against EUCAST v16.0 clinical breakpoint tables (local SQLite). Risk stratification outputs: LOW / MODERATE / HIGH / CRITICAL, with actionable escalation guidance.
|
| 47 |
+
|
| 48 |
+
*Why MedGemma 27B here:* The larger model provides stronger multi-step clinical reasoning for the nuanced task of synthesizing resistance trajectory, breakpoint context, and treatment urgency into a coherent risk narrative.
|
| 49 |
+
|
| 50 |
+
### Agent 4 — Clinical Pharmacologist (`MedGemma 4B IT` + `TxGemma 9B`)
|
| 51 |
+
Selects the final antibiotic: molecule, dose, route, frequency, and duration. Applies WHO AWaRe stewardship (preferring ACCESS-tier antibiotics, escalating to WATCH/RESERVE only when justified). Adjusts dose for renal impairment. Screens the full medication list against DDInter 2.0 (191,000+ drug-drug interactions). TxGemma 9B is invoked **solely as a safety checker** for molecular toxicity signals, augmenting MedGemma's clinical reasoning with drug-discovery-level pharmacological knowledge.
|
| 52 |
+
|
| 53 |
+
### Knowledge Base (RAG + SQL)
|
| 54 |
+
A hybrid retrieval system grounds every agent response in authoritative evidence:
|
| 55 |
+
|
| 56 |
+
| Store | Source | Records |
|
| 57 |
+
|-------|--------|---------|
|
| 58 |
+
| SQLite — `eml_antibiotics` | WHO AWaRe v2024 | 264 antibiotics |
|
| 59 |
+
| SQLite — `atlas_susceptibility` | Pfizer ATLAS surveillance | 6.5M MIC measurements |
|
| 60 |
+
| SQLite — `mic_breakpoints` | EUCAST v16.0 (2026) | Clinical breakpoint tables |
|
| 61 |
+
| SQLite — `drug_interactions` | DDInter 2.0 | 191,000+ DDIs |
|
| 62 |
+
| ChromaDB — `idsa_treatment_guidelines` | IDSA AMR Guidance 2024 (PDF) | Semantic chunks |
|
| 63 |
+
| ChromaDB — `pathogen_resistance` | WHO GLASS, CARD | 23M+ surveillance episodes |
|
| 64 |
+
| ChromaDB — `drug_safety` | OpenFDA, DailyMed | Drug labeling |
|
| 65 |
+
|
| 66 |
+
All data sources are **open-access and freely downloadable** (no registration barriers). The `setup_demo.py` script ingests everything from scratch in a single command.
|
| 67 |
+
|
| 68 |
+
---
|
| 69 |
+
|
| 70 |
+
## 3. Impact Potential
|
| 71 |
+
|
| 72 |
+
**Quantified opportunity:** The WHO estimates that up to **50% of antibiotic prescriptions in hospitals are inappropriate** — wrong drug, wrong dose, or unnecessary. Globally, this represents approximately 350 million hospital antibiotic courses per year. If Med-I-C reduces inappropriate prescribing by even **10% among its users**, the downstream effect on resistance selection pressure is substantial.
|
| 73 |
+
|
| 74 |
+
**MIC creep detection:** The clinical window for acting on MIC creep — between when a pathogen's MIC doubles and when it crosses the formal resistance breakpoint — is estimated at **6–18 months**. An alert at that inflection point allows de-escalation, combination therapy, or drug cycling before treatment failure. Currently, no routine workflow captures this: the C&S lab reports a point-in-time result, and longitudinal MIC trend analysis requires manual chart review that clinicians rarely have time for.
|
| 75 |
+
|
| 76 |
+
**Global equity:** Agent 2's multilingual lab report reading means a physician in Dakar receiving a French-language lab report, or a clinician in Jakarta with a handwritten Indonesian antibiogram, gets the same quality of AI-assisted interpretation as a major US academic medical center. This is significant: AMR disproportionately kills in low- and middle-income countries where ID consultation is scarce.
|
| 77 |
+
|
| 78 |
+
**Stewardship alignment:** Every recommendation cites its AWaRe tier. The system defaults to ACCESS-class antibiotics and requires explicit justification for WATCH/RESERVE escalation — directly supporting national antimicrobial stewardship programs.
|
| 79 |
+
|
| 80 |
+
---
|
| 81 |
+
|
| 82 |
+
## 4. Product Feasibility
|
| 83 |
+
|
| 84 |
+
### Performance Analysis
|
| 85 |
+
The pipeline was validated against 10 synthetic clinical vignettes covering: UTI (community vs. hospital-acquired), pneumonia (CAP vs. HAP), MRSA bacteremia, CRE (carbapenem-resistant Enterobacteriaceae), and a warfarin drug interaction case. Agent 2 correctly extracted pathogen + MIC values from all 8 English-language test images and 2 multilingual samples (French, Arabic). Agent 3 correctly flagged MIC creep in 3/3 creep-positive cases; 0 false positives in 7 creep-negative cases. Agent 4 adhered to IDSA empiric therapy guidelines in 9/10 cases (one case required a knowledge base update for a rare pathogen).
|
| 86 |
+
|
| 87 |
+
### Deployment Architecture
|
| 88 |
+
- **Local/GPU:** MedGemma 4B and TxGemma 2B with 4-bit quantization (bitsandbytes); runs on a single 16 GB VRAM GPU (tested on Kaggle T4)
|
| 89 |
+
- **Cloud:** Google Vertex AI endpoints for MedGemma 27B and production scaling
|
| 90 |
+
- **Frontend:** Streamlit — a one-command UI that mirrors the clinical workflow (admit patient → upload lab → receive recommendation)
|
| 91 |
+
|
| 92 |
+
### Challenges and Mitigations
|
| 93 |
+
|
| 94 |
+
| Challenge | Mitigation |
|
| 95 |
+
|-----------|-----------|
|
| 96 |
+
| MedGemma 27B VRAM (54 GB FP16) | Vertex AI API; automatic fallback to 4B with extended prompts |
|
| 97 |
+
| Lab report parsing reliability | Few-shot prompting; PDF text pre-extraction; manual JSON entry fallback in UI |
|
| 98 |
+
| Real-world data freshness | EUCAST updates annually (Excel URL pinned); WHO GLASS API for current surveillance |
|
| 99 |
+
| Kaggle reproducibility | Pinned dependency versions; `kaggle_medic_demo.ipynb` tested on fresh kernel |
|
| 100 |
+
|
| 101 |
+
### Path to Clinical Use
|
| 102 |
+
Med-I-C is designed as a **decision-support tool**, not an autonomous prescriber. Every recommendation includes the evidence chain (which guideline, which breakpoint table, which interaction database) so the clinician can verify and override. Integration into existing EHR systems via FHIR R4 (patient data as HL7 FHIR resources) is the natural next step.
|
| 103 |
+
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
## 5. Conclusion
|
| 107 |
+
|
| 108 |
+
Med-I-C demonstrates that HAI-DEF models — specifically MedGemma and TxGemma — can power a clinically grounded, end-to-end antimicrobial stewardship assistant. By using MedGemma's medical domain knowledge for structured data extraction, clinical risk reasoning, and resistance trend analysis, and TxGemma for molecular safety checks, the system addresses a problem where other solutions (general-purpose LLMs without medical training, rule-based alert systems, standalone lab viewers) are demonstrably less effective. The pipeline is reproducible, deployable, and tackles one of the most urgent and tractable global health challenges of our time.
|
| 109 |
+
|
| 110 |
+
---
|
| 111 |
+
|
| 112 |
+
*All data sources are open-access. Setup, model weights, and full source code are available in the linked Kaggle notebook and GitHub repository.*
|
scripts/ingest_data.py
CHANGED
|
@@ -12,7 +12,7 @@ def ingest_medical_data():
|
|
| 12 |
# Persistent client for the competition (Kaggle/Local)
|
| 13 |
client = chromadb.PersistentClient(path=CHROMA_PATH)
|
| 14 |
|
| 15 |
-
#
|
| 16 |
model_name = "all-MiniLM-L6-v2"
|
| 17 |
ef = embedding_functions.SentenceTransformerEmbeddingFunction(model_name=model_name)
|
| 18 |
|
|
|
|
| 12 |
# Persistent client for the competition (Kaggle/Local)
|
| 13 |
client = chromadb.PersistentClient(path=CHROMA_PATH)
|
| 14 |
|
| 15 |
+
# Define the embedding model
|
| 16 |
model_name = "all-MiniLM-L6-v2"
|
| 17 |
ef = embedding_functions.SentenceTransformerEmbeddingFunction(model_name=model_name)
|
| 18 |
|
src/agents.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
"""
|
| 2 |
-
|
| 3 |
|
| 4 |
Implements the 4 specialized agents for the infection lifecycle workflow:
|
| 5 |
- Agent 1: Intake Historian - Parse patient data, risk factors, calculate CrCl
|
|
|
|
| 1 |
"""
|
| 2 |
+
Multi-Agent System.
|
| 3 |
|
| 4 |
Implements the 4 specialized agents for the infection lifecycle workflow:
|
| 5 |
- Agent 1: Intake Historian - Parse patient data, risk factors, calculate CrCl
|