Clinical differential diagnosis tool combining HPO phenotype profiles and PrimeKG knowledge graph for symptom-driven disease scoring.
uv run python main.pyType a patient case, then use the commands below in order.
Chat → /summarise_chat → /ddx → /extract_symptoms → /score → /ask
→ /rare_disease_scan → /score_rare
| Command | What it does |
|---|---|
/patient <name> [symptoms] |
Set patient name and initial symptoms |
/summarise_chat |
Summarise conversation |
/ddx |
Generate differential diagnosis |
/extract_symptoms |
Extract symptoms → HPO IDs (present + absent) |
/score |
Score DDx diseases (4 scores per disease) |
/ask |
Ranked clarifying questions |
/rare_disease_scan |
FAISS-based rare disease search |
/score_rare |
Score rare disease candidates through matrix pipeline |
/graph |
Render clinical topology graph |
/check [field] |
Show current state |
Each /score run shows 4 scores per disease:
| Column | Type | Range | What it measures |
|---|---|---|---|
HPO_m |
Matrix | [-1, 1] | Full HPO profile fit (penalises contradictions) |
KG_m |
Matrix | [-1, 1] | PrimeKG fit (penalises contradictions from patient side) |
HPO_h |
Hybrid | [0, 1] | HPO explanation of present symptoms only |
KG_h |
Hybrid | [0, 1] | KG explanation of present symptoms only |
| File | Contents |
|---|---|
docs/scoring_mechanisms.md |
Matrix and hybrid scoring formulas with worked example |
docs/graph_rendering.md |
Clinical topology graph structure and rendering |
docs/system_architecture.md |
Data sources, pipelines, and module dependencies |
scoring_documentation.typ |
Full mathematical specification (Typst) |
PRIMEKG_DATA_QUALITY.md |
PrimeKG data quality notes |
- HPO: 19,944 symptoms, 12,974 diseases (curated profiles with present + absent)
- PrimeKG: 8.1M edges, ~17,000 diseases with phenotype data
- MedEmbed:
abhinand/MedEmbed-large-v0.1for semantic search and fuzzy matching