Inspiration
If a geneticist wants help reading a five-page referral PDF, they run into two problems fast. Most AI tools want you to ship patient notes to an external API, which violates clinic privacy rules before you even start. Even when an LLM gives you a list of candidate syndromes, a probability without receipts is hard to trust when a real patient is sitting in front of you.
I wanted to see how far you could get by cutting the pipeline in half. Let local extraction read the messy text in RAM, make a human check every finding first, and hand only clean standardized codes to transparent math.
What Phenora does
You paste a clinical note or drop a PDF (up to 25 MB and 100 pages, read strictly in memory without saving files to disk). Phenora extracts candidate phenotypes and links each one back to its exact character span in your text alongside 19,894 Human Phenotype Ontology (HPO) terms.
Then it stops. Before any disease ranking runs, you review the extracted findings in a confirmation gate. You can toggle whether a symptom is present or negated, switch whether it belongs to the patient or a family member, or mark it historical. Negated and family-history terms stay visible on screen for context, so nothing disappears silently, though only confirmed present findings for the patient go into the matcher.
Once confirmed, Phenora ranks 7,338 rare diseases from Orphadata and WHO ICD-11 using 181,091 curated HPO annotations. Clicking a candidate in the interactive graph opens its medical overview, a plain-language summary for families, cross-references to WHO ICD-11, OMIM, and Orphanet, and the exact ancestor paths connecting the patient's symptoms to the condition.
How I built it
The backend runs on Python and FastAPI backed by a read-only SQLite knowledge pack (phenora-who-icd11-v1). For extraction, there is an air-gapped full-HPO n-gram matcher that runs with zero GPU setup, plus optional connectors for local Ollama or LM Studio servers if you want an LLM running locally on your own machine.
For ranking, matching uses bidirectional Information Content (IC)-weighted Lin similarity across the HPO directed acyclic graph. Given a patient observation $q$ and a disease annotation $a$ sharing a Most Informative Common Ancestor $\text{MICA}(q, a)$:
$$\text{sim}_{\text{Lin}}(q, a) = \frac{2 \cdot \text{IC}(\text{MICA}(q, a))}{\text{IC}(q) + \text{IC}(a)}$$
Annotations are weighted by how frequently a feature appears in that condition ($w_{\text{freq}}(a) \in [0, 1]$), yielding $s(q, a) = \text{sim}{\text{Lin}}(q, a) \cdot (0.85 + 0.15 \, w{\text{freq}}(a))$. Query coverage and disease profile coverage are then combined into a bounded ordinal score:
$$Q_{\text{cov}} = \frac{\sum_{q} \text{IC}(q) \cdot \max_{a} s(q, a)}{\sum_{q} \text{IC}(q)}, \quad D_{\text{cov}} = \frac{\sum_{a} \text{IC}(a) \cdot \max_{q} \text{sim}{\text{Lin}}(q, a)}{\sum{a} \text{IC}(a)}$$
$$\text{Score}(Q, D) = \min!\left(1.0,\; 0.85\, Q_{\text{cov}} + 0.15\, D_{\text{cov}}\right)$$
The frontend is React 19, TypeScript, and React Flow for the evidence graph, with GSAP and Lenis handling the landing page transitions. To let people test the app online without installing Python, I also ported the SQLite ontology graph traversal and Lin scorer into a standalone TypeScript Netlify Function (v1.mts).
Challenges
The Netlify deploy broke the first time because static hosting obviously had no FastAPI server behind /v1/*. Porting the ancestor closure lookup and bidirectional Lin scoring into TypeScript, while keeping the exact same JSON schemas, strict extra-field rejection (blocking raw_note from ever reaching /v1/matches), and HMAC-SHA256 bearer JWT checks, took almost as much care as the Python backend itself.
UI layout on smaller laptops and phones caught me off guard too. On 1024px screens and compact laptops around 600px tall, the pinned workflow section stopped scrolling properly, candidate names got crushed down to four letters next to ICD-11 badges, and the floating summary panel covered over half of the graph canvas. Changing disease inspection from hover-plus-click to click-only and docking the inspector below the canvas on narrower widths made it much calmer to use.
What I learned
Separating language extraction from matching makes debugging way less mysterious. If a rare disease ranks #1 instead of #3, you do not have to guess why a neural network picked it; you can click the node and read the shared MICA term and frequency weight directly.
Mirroring security rules across local Python and serverless TypeScript also taught me not to trust client validation alone. Testing malformed request IDs, alg: none JWT bypass attempts, oversized PDF uploads, and SQL LIKE wildcard inputs ended up catching real edge cases on both sides (all 52 backend tests and the zero-egress air-gap check currently pass).
Where this goes next depends mostly on evaluation. The n-gram extractor is fast and works offline anywhere, though local Ollama models still handle messy phrasing and negations better when hardware allows, so benchmarking both against more synthetic pediatric referrals is probably the next step.