Rwanda CDSS Pilot (Malaria + HIV)
# Malaria & HIV Clinical Decision Support System
A multi-agent CDSS that answers clinical queries using Rwanda national guidelines for **Malaria** (2024) and **HIV**. An LLM-powered orchestrator routes queries to the appropriate specialist agent(s) and synthesizes responses — including drug interaction warnings for coinfection scenarios.
> For full engineering details, architecture diagrams, API reference, and deployment guide, see ENGINEERING_HANDOFF.md.
---
## Architecture
```
User / REST API
↓
CDSSOrchestrator
├── QueryRouter (GPT-4o) → MALARIA | HIV | BOTH | UNCLEAR
├── clinical_map.json → coinfection triggers, drug interaction flags
│ ↓ ↓
│ MalariaAgent HIVAgent
│ (malaria KB) (hiv KB)
└── ResponseSynthesizer → merged answer + interaction warnings
```
Each guideline agent uses a 6-stage PDF processing pipeline:
```
Raw PDF
├─ Stage 1: PDF Parser (pdfplumber / Claude Vision for image-based PDFs)
├─ Stage 2: Section Builder (rule-based heading detection)
├─ Stage 3: Figure Extractor (Claude Vision — flowcharts, decision trees)
├─ Stage 4: Table Structurer (Claude Vision — dosage tables, regimen matrices)
├─ Stage 5: Prose Chunker (Claude Sonnet — atomic clinical fact chunks)
└─ Stage 6: KB Assembler (drug normalization, eligibility matrix)
```
---
## Quick Start
### 1. Prerequisites
```bash
# Python 3.10+
pip install -r requirements.txt
# macOS (for HIV pipeline image rendering)
brew install poppler
# Linux
apt-get install poppler-utils
```
### 2. Environment
```bash
cp .env.example .env
# Edit .env and fill in your API keys:
# OPENAI_API_KEY=sk-...
# ANTHROPIC_API_KEY=sk-ant-...
```
### 3. Set Up the Malaria Knowledge Base
The malaria KB was generated by the existing pipeline. Copy it to the new location:
```bash
mkdir -p guidelines/malaria/output
cp output/*.json guidelines/malaria/output/
```
### 4. Run the HIV Pipeline (one-time setup)
> **Cost wa …