From multimodal patient evidence to ranked rare-disease hypothesesβand clinically actionable next steps
RareMind is a locally deployable, multi-agent rare-disease reasoning pipeline grounded in RareGraph, the structured knowledge graph developed for this project. It integrates clinical notes, phenotype terms, images, and genomic evidence; retrieves and adjudicates disease candidates; produces an auditable final ranking; and now converts its leading diagnostic hypotheses into normalized next-test and next-step recommendations.
RareMind turns multimodal clinical evidence into an auditable rare-disease differentialβand turns that differential into a normalized, traceable plan for what clinicians might evaluate next.
Pipeline name: RareMind
Knowledge graph: RareGraph
Default final output: ranked diagnoses plus ten normalized clinical actions
- π Extracts phenotypes, demographics, family history, prior testing, and gene mentions from clinical notes
- πΌοΈ Incorporates phenotype evidence from medical images when available
- 𧬠Accepts structured HPO terms and external genomic-ranking results
- π Grounds retrieval and reasoning in RareGraph, HPO, MONDO, OMIM, Orphanet, and GeneReviews-derived knowledge
- π€ Uses complementary agents for evidence auditing, pairwise adjudication, and group/subtype reconciliation
- π Preserves every major rank transition in an auditable trajectory
- π©Ί Converts the final Top-10 disease groups into normalized next tests, referrals, and initial evaluations
RareMind is designed to move beyond a single Top-K accuracy number. The accompanying clinical-impact analyses evaluate:
- β±οΈ Diagnostic lead time and healthcare utilization
- π€ Alignment with clinician differential diagnoses
- π Recovery when the clinician differential misses the eventual diagnosis
- π« Deprioritization of diagnoses explicitly ruled out in the evaluated note
- π§ͺ Concordance between recommended and subsequently documented tests
| Stage | Purpose | Principal output |
|---|---|---|
| 1 | Multimodal clinical extraction | Phenotypes, demographics, family history, testing, genes, and image evidence |
| 2 | Ontology normalization and post-processing | Normalized HPO evidence, temporal context, inheritance, incongruity |
| 3 | Candidate retrieval and composite scoring | Broad RareGraph-grounded disease ranking |
| 4 | Conditional frontier consultation | Targeted review of ambiguous, incongruous, or under-supported cases |
| 5 | Evidence audit | Supporting, contradicting, and missing expected evidence |
| 6 | Pairwise adjudication | Subtype- and group-level candidate comparisons |
| 7 | Rank aggregation | Aggregated subtype and disease-group rankings |
| 8 | Group/subtype reconciliation and final fusion | Calibrated global final_rank |
| 9 | Clinical scorecard | Human-readable evidence cards for the leading diagnoses |
| 10 | Next-test and next-step synthesis | Ten normalized, cross-diagnosis clinical actions with provenance |
Submitting a patient through scripts/run_pipeline.py runs the complete sequence from Stage 1 through Stage 10. Stage 10 is enabled by default.
Stage 10 applies the same action-normalization strategy used in the retrospective next-test concordance analysis:
Global final ranking
β
Disease groups represented within final ranks 1β10
β
RareGraph: testing + initial_evaluations
β
Lexical canonicalization
β
BioLORD semantic clustering (cosine similarity β₯ 0.90)
β
Rank by number of supporting disease groups
β
Top 10 next tests / evaluations / referrals
Examples of deterministic normalization include:
echo/echocardiographyβechocardiogram6MWTβsix minute walk testwhole-exome sequencingβexome sequencingbrain natriuretic peptideβBNP
Semantically similar actions that remain lexically different are clustered with the already loaded BioLORD model. Each recommendation retains:
- its normalized label and observed aliases;
- the number of distinct disease groups supporting it;
- the best final rank among its supporting groups;
- the RareGraph field(s) that supplied it;
- the supporting group and representative disease IDs and names.
This stage generates recommendations from the model output alone. Reference future tests are used only for retrospective evaluationβnot during patient inference.
next_steps:
enabled: true
disease_top_k: 10
action_top_k: 10
action_fields:
- testing
- initial_evaluations
cluster_similarity_threshold: 0.90At least one supported modality must be present. Clinical text is the usual starting point.
inputs/
βββ demo/
βββ text/
β βββ PATIENT_001.txt
βββ free_hpo/
β βββ PATIENT_001.txt # optional
βββ image/
β βββ PATIENT_001.png # optional
βββ vcf/
βββ PATIENT_001.vcf # optional
The filename stem is the case identifier shared across modalities.
Edit configs/default.yaml to point to:
- the RareGraph JSON;
- the MONDO hierarchy and cross-mappings;
- the HPO ontology;
- local text and vision models;
- cache and output locations.
The default BioLORD model is FremyCompany/BioLORD-2023.
python scripts/run_pipeline.py \
--config configs/default.yaml \
--dataset demo \
--case_id PATIENT_001python scripts/run_pipeline.py \
--config configs/default.yaml \
--dataset demoOn a SLURM cluster, the supplied wrapper submits the same complete Stage 1β10 workflow; no separate next-step command is required:
sbatch -p gpuq --gres=gpu:a100:1 \
--wrap="bash scripts/run_agents.sh --dataset demo --input_dir inputs --output_dir outputs"Useful overrides:
# Test a different local text model
python scripts/run_pipeline.py --dataset demo --text_model Qwen/Qwen3-8B
# Process only the first ten discovered cases
python scripts/run_pipeline.py --dataset demo --limit 10
# Recompute Stage 1 caches
python scripts/run_pipeline.py --dataset demo --overwrite_stage1_cacheA Linux environment with an NVIDIA GPU is recommended for the local vLLM stages. BioLORD action normalization uses
sentence-transformersand reuses the embedder already loaded for ontology normalization.
outputs/<dataset>/<case_id>/
βββ stage1_extraction.json
βββ stage2_patient_evidence.json
βββ stage3_composite_ranking.tsv
βββ stage5_audit_results.json
βββ stage5_ranking_after_audit.tsv
βββ stage6_pairwise_results_subtype.json
βββ stage6_pairwise_results_group.json
βββ stage7_reranked_subtype.tsv
βββ stage7_reranked_group.tsv
βββ stage8_reconciled_ranking.tsv
βββ stage8_final_fusion.tsv
βββ stage8_reconciled.json
βββ stage9_scorecard.json
βββ stage9_scorecard.txt
βββ stage10_next_steps.tsv
βββ rank_trajectory.tsv
The dataset-level summary.tsv includes the leading diagnosis, its final rank, the highest-ranked next step, and the complete Top-10 action list.
stage10_next_steps.tsv is the single canonical Stage 10 artifact. It
contains the normalized Top-10 actions, aliases, supporting disease groups and
diseases, source RareGraph fields, ranking support, normalization metadata, and
the selected source disease groups.
The clinical_impact_analyses workspace contains the retrospective evaluation notebooks and reusable functions for:
- earliest computationally recoverable diagnostic signal;
- utilization accumulated before formal genetic-testing recommendation;
- clinician-differential alignment and missed-diagnosis recovery;
- note-aligned ruled-out negative controls;
- next-test lexical and BioLORD semantic concordance;
- publication-ready figures and review tables.
These analyses are intentionally separated from patient inference. Cohort labels and future documented tests never enter the RareMind ranking or Stage 10 recommendation process.
src/raremind/ Canonical RareMind implementation
βββ agents/ Extraction agents
βββ normalize/ HPO, MONDO, temporal, and BioLORD normalization
βββ kg/ RareGraph loading and indexing
βββ retrieval/ Candidate-generation channels
βββ scoring/ Deterministic composite scoring
βββ reasoning/ Audit, adjudication, fusion, scorecard, Stage 10
βββ orchestration/ End-to-end patient runner
scripts/run_pipeline.py Main 10-stage command-line entry point
configs/default.yaml Runtime and Stage 10 configuration
clinical_impact_analyses/ Retrospective clinical-impact evaluations
New code should import the pipeline from raremind. A minimal historical
raregraph compatibility namespace is retained to avoid abruptly breaking
existing environments; RareGraph otherwise refers only to the knowledge
graph.
RareMind is a research decision-support system. Its rankings and suggested actions are not medical advice, are not a substitute for clinical judgment, and require review in the context of the complete patient record, prior testing, local practice, and test availability.
For protected health information, use only approved infrastructure and follow institutional privacy, security, and data-governance requirements.
The full RareMind manuscript is currently in preparation. Until it becomes available, if you use or reference RareMind, RareGraph, or this repository, please cite our published work:
Nguyen QM, Wang K.
RareGraph-AgenticAI: A Multimodal Knowledge Graph and Multi-agent LLM Framework for Rare Disease Evaluation and Gene Prioritization.
In: Artificial Intelligence in Medicine. Springer Nature Switzerland; 2026:445β450.
https://doi.org/10.1007/978-3-032-30813-9_82
@inproceedings{nguyen2026raregraph,
author = {Nguyen, Quan M. and Wang, Kai},
title = {RareGraph-AgenticAI: A Multimodal Knowledge Graph and Multi-agent LLM Framework for Rare Disease Evaluation and Gene Prioritization},
booktitle = {Artificial Intelligence in Medicine},
year = {2026},
pages = {445--450},
publisher = {Springer Nature Switzerland},
doi = {10.1007/978-3-032-30813-9_82}
}