← Back to all projects
Knowledge GraphsProbabilistic MLMedical AINumPyroDoctronic, Inc.November 2026

MedKG: Probabilistic Clinical Factor Graph & NumPyro VOI Engine

Live Link / Code ↗
MedKG: Probabilistic Clinical Factor Graph & NumPyro VOI Engine

Architecture Overview

MedKG is a probabilistic medical knowledge graph engineered to provide mathematically principled clinical reasoning for AI-assisted medical consultations. Instead of relying solely on parametric LLM weights (which can hallucinate diagnostic probabilities), MedKG represents symptoms, lab tests, medications, and disease conditions as a grounded probabilistic factor graph.

Technical Pillars

  • Factor Graph Compilation to NumPyro: Formulated a compiler that translates clinical factor families, symptom frequencies, and epidemiological priors into NumPyro probabilistic models for exact Bayesian posterior estimation.
  • Value of Information (VOI) Engine: Implemented information-theoretic VOI algorithms that rank potential diagnostic questions and lab tests, selecting the single most entropy-reducing clinical action for any given patient presentation.
  • Ontological Grounding: Mapped medical concepts to standard clinical vocabularies including SNOMED CT, UMLS, RxNorm, LOINC, and Human Phenotype Ontology (HPO). Ingested First Databank (FDB) exports for medication constraints, drug-drug interactions, and contraindications.
  • Graph-Grounded LLM Judge (ADR-034): Replaced brittle text-rendered prompt evaluation with an in-process GraphFacts engine that inspects graph links, exclusions, and active rules directly in Python. Cut guideline evaluation latency by ~60% (39s vs. 94s) with zero hallucinated guideline violations.
Share this piece
PostLinkedIn