An evidence-first knowledge graph of rare diseases. Search one disease, gene or symptom: RareVerse puts it at the center,
ranks what shares its biology, shows the source of every claim, and finds the researcher to contact next.
Quick start Β· How it works Β· Grading engine Β· AI contact finder Β· Contributing
263β446 million people live with a rare disease (Nguengang Wakap et al., European Journal of Human Genetics, 2020), and about 95% of rare diseases have no FDA-approved treatment (NIH NCATS).
For most of these diseases, the person pushing research forward is a parent. They know the name of their child's disease, and maybe the gene. What they cannot see is which other diseases break the same biology. A mouse model, a natural-history study, a registry design or a gene-therapy approach built for one of those diseases could serve theirs. A disease with 200 known patients can borrow momentum from one with 2,000. The knowledge exists, but it is scattered across a dozen databases built for specialists.
RareVerse joins seven of those databases into one map and answers three questions in plain language, with a source behind every answer:
| Question | What RareVerse shows | |
|---|---|---|
| 𧬠| Who shares our biology? | Diseases ranked by shared genes, shared Reactome pathways and similar gene changes, not by name. Distance on the map is that score. |
| π | What already exists? | Patient groups, papers and research grants linked to the disease and to its biological relatives, each tagged stated by a curated database or inferred. |
| π€ | Who do we call next? | A sourced next step (or an honest "nothing yet"), and an AI contact finder that turns the papers behind a disease into verified researcher contacts. |
Important
RareVerse never invents a link. Every number is computed by deterministic, tested code from public records, every claim on screen carries a numbered citation, and the AI layer can only lower a grade or find people. It can never raise a grade or add a fact.
Everything else in the box
| Feature | Details | |
|---|---|---|
| π | The RareVerse universe | The start screen draws all 93 diseases as constellations: colored groups that share a gene or a pathway, with every other disease as a faint star. Click any star to map it. |
| π | A citation on every claim | Every sentence in the side panel ends with numbered chips like [1]. Hovering one opens a source card (database, claim, date, record link), and a full Sources list closes each view. |
| βοΈ | Honest scores | Biology sets the distance on the map. Clinical resemblance (symptoms, onset, inheritance) is shown beside it and never moves a disease, and neither does shared research. Thin or one-sided evidence comes with a plain-language caveat. |
| π§ | A next step | Built only from sourced items: a group that already serves both diseases, a registry, a grant, a paper. When nothing supports a step, RareVerse says so and offers the contact finder. |
| ποΈ | Relevance filter | The map opens on the top five related diseases. Lower the slider to bring weaker and indirect links in; items just under the filter stay faintly visible. |
| π§© | Type and link filters | Show only genes, only symptoms, only research. The researcher view adds a Links menu that hides whole relation types. |
| π©βπ¬ | Researcher mode | Dimension-by-dimension score tables, the engine's own note, node ids linked to their databases, and the "How we score" explainer. |
| π | Shareable views | The whole state lives in the URL (?d=MONDO:0010100&sel=MONDO:0010006&r=40&view=3d), so any view can be linked or bookmarked. |
| π | List view | The same neighborhood as a ranked, readable list. |
| π π± βΏ | Dark mode, phones, accessibility | A designed dark theme, a phone layout, keyboard navigation, focus rings, screen-reader labels and reduced-motion support. |
A parent whose child has Tay-Sachs disease opens RareVerse. Everything below is real output from the current atlas:
flowchart TB
TS(["π΅ Tay-Sachs disease<br/>gene HEXA"])
SD(["π΅ Sandhoff disease<br/>gene HEXB"])
PW["𧬠Reactome pathway<br/>Hyaluronan degradation<br/>(only 2 of 81 diseases)"]
HH["π€ Hand in Hand gegen Tay-Sachs<br/>und Sandhoff in Deutschland e.V."]
PP["π PubMed, 2022<br/>AAV gene therapy for Tay-Sachs"]
RS["π©βπ¬ Senior author<br/>UMass Chan Medical School"]
TS -->|"Moderate Β· 62%<br/>5 shared pathways"| SD
TS --- PW
SD --- PW
HH -.->|"serves both"| TS
HH -.-> SD
TS --> PP -->|"π€ contact finder<br/>verified on PubMed"| RS
classDef disease fill:#E8F1FF,stroke:#2A78D6,color:#0B2E59,stroke-width:2px
classDef bio fill:#EEEBFA,stroke:#5B4BB7,color:#2B2266
classDef group fill:#E6F4EC,stroke:#2B7A4B,color:#0F3D22
classDef research fill:#FBF1DF,stroke:#8F5A00,color:#4A2E00
classDef ai fill:#F3E8FF,stroke:#7C3AED,color:#3B0764
class TS,SD disease
class PW bio
class HH group
class PP research
class RS ai
%%{init: {"journey": {"diagramMarginX": 20, "taskMargin": 20, "leftMargin": 80, "width": 140, "height": 70}}}%%
journey
title A parent's first five minutes
section Search
Types Tay-Sachs into one search box: 4: Parent
Sees the closest relatives on the map: 4: Parent
section Understand
Opens Sandhoff disease and reads why, with sources: 5: Parent
Learns the shared pathway is a lead, not a proof: 4: Parent
section Act
Finds a patient group that already serves both: 5: Parent
Gets a verified researcher to write to: 5: Parent
RareVerse is three layers: a pipeline that pulls public records into one graph, a deterministic grading engine that scores every pair of diseases, and a Next.js app that turns both into a map a parent can read. One small server route adds the AI contact finder.
flowchart TB
subgraph SRC["π 7 public sources"]
direction TB
MON["Monarch Β· MONDO<br/>disease β gene"]
HPO["Human Phenotype<br/>Ontology<br/>symptoms"]
REA["Reactome 97<br/>pathways"]
CLV["ClinVar<br/>gene changes"]
ORP["Orphanet<br/>patient groups"]
PUB["PubMed<br/>papers"]
NIH["NIH RePORTER<br/>grants"]
MON ~~~ ORP
HPO ~~~ PUB
REA ~~~ NIH
end
subgraph PIPE["π Python pipeline"]
direction LR
BG["build_graph.py<br/>fetch and link"] --> WG["weight_graph.py<br/>information-content<br/>weights"] --> SEED[("rare_graph.json<br/>seed")]
end
subgraph BUILD["π§± Deterministic build"]
direction LR
REF["data:hpo<br/>data:reactome<br/>reference files"] --> ADP["data:graph<br/>schema adapter"] --> GRD["grade<br/>11-dimension<br/>engine"] --> OUT[("graph.json<br/>relevance.json")]
end
subgraph APP["βοΈ Next.js app"]
direction LR
UI["Map Β· 3D Β· List<br/>Evidence panel Β· Search"] --> API["/api/contacts<br/>server only"]
end
OAI["π€ OpenAI<br/>gpt-6-luna + web search"]
SRC --> PIPE --> BUILD --> APP
API --> OAI
classDef src fill:#E8F1FF,stroke:#2A78D6,color:#0B2E59
classDef py fill:#FFF4E5,stroke:#EDA100,color:#5A3B00
classDef ts fill:#EEEBFA,stroke:#5B4BB7,color:#2B2266
classDef data fill:#E6F4EC,stroke:#2B7A4B,color:#0F3D22
classDef app fill:#FCEBF1,stroke:#B23C68,color:#5C1530
classDef ai fill:#F3E8FF,stroke:#7C3AED,color:#3B0764
class MON,HPO,REA,CLV,ORP,PUB,NIH src
class BG,WG py
class REF,ADP,GRD ts
class SEED,OUT data
class UI,API app
class OAI ai
flowchart TB
URL["π URL state<br/>d Β· sel Β· r Β· hide Β· open Β· view Β· mode Β· list"] <--> APP["AtlasApp"]
DATA[("graph.json Β· relevance.json<br/>search-aliases.json")] --> APP
APP --> HOOD["buildNeighborhood<br/>relevance carried from the center"]
HOOD --> LAY["radialLayout<br/>distance = relevance<br/>direction = kind"]
LAY --> M2["πΊοΈ 2D map Β· SVG<br/>14-name label budget"]
LAY --> M3["π§ 3D view Β· canvas"]
HOOD --> LST["π List view"]
APP --> VM["Panel view model<br/>pure citation registry"]
VM --> PNL["π Evidence panel<br/>numbered sources"]
PNL --> CF["π€ Who can I contact?"] --> RT["/api/contacts"]
APP --> SB["π Search index<br/>synonyms Β· typos Β· plurals"]
classDef core fill:#EEEBFA,stroke:#5B4BB7,color:#2B2266
classDef view fill:#FCEBF1,stroke:#B23C68,color:#5C1530
classDef data fill:#E6F4EC,stroke:#2B7A4B,color:#0F3D22
classDef ai fill:#F3E8FF,stroke:#7C3AED,color:#3B0764
class APP,HOOD,LAY,VM,SB core
class M2,M3,LST,PNL,URL view
class DATA data
class CF,RT ai
Placement means something. On the map, distance from the center is relevance and direction is the kind of thing. Nothing is placed by hand, and the same input always gives the same picture.
| Direction | What lives there |
|---|---|
| β¬οΈ Top | Related diseases, the five closest drawn largest and labeled with their grade (Moderate Β· 62%) |
| Research: papers and grants | |
| Patient groups and registries | |
| β¬οΈ Bottom | Symptoms, rarest first |
| β¬ οΈ Left | Genes and pathways |
Achondrogenesis type II in the center: the five closest relatives (all linked to COL2A1) at the top, the gene and its pathways on the left, symptoms below.
1,122 nodes and 1,891 typed, sourced edges covering 93 rare diseases (a deliberately focused slice: the engine and the app are built to grow).
erDiagram
GENE }o--o{ DISEASE : "causes (93)"
DISEASE }o--o{ SYMPTOM : "has_phenotype (996)"
GENE }o--o{ PATHWAY : "in_pathway (269)"
VARIANT }o--o{ GENE : "variant_of (156)"
PAPER }o--o{ DISEASE : "about (249)"
PATIENT_GROUP }o--o{ DISEASE : "works_on (95)"
GRANT }o--o{ DISEASE : "funds (33)"
pie showData
title Nodes by type
"Symptoms (HPO)" : 303
"Papers (PubMed)" : 227
"Pathways (Reactome)" : 221
"Gene changes (ClinVar)" : 152
"Diseases (MONDO)" : 93
"Genes (HGNC)" : 52
"Patient groups (Orphanet)" : 47
"Research grants (NIH)" : 27
pie showData
title Edges by source
"HPO via Monarch" : 996
"Reactome" : 269
"PubMed" : 249
"ClinVar" : 156
"Orphanet" : 95
"Monarch" : 93
"NIH RePORTER" : 33
Every edge carries its provenance. The contract is schema.json (JSON Schema 2020-12), checked in CI:
classDiagram
direction LR
class Node {
+string id
+NodeType type
+string label
+string source
+string url
+object attributes
}
class Edge {
+string id
+string type
+string subject
+string object
+string source
+string url
+date date
+number confidence
+Kind kind
+string evidence
}
Edge --> Node : subject
Edge --> Node : object
note for Edge "kind: observed, inferred or contradicted"
| Source | What it contributes | Edges | Kind |
|---|---|---|---|
| Monarch Initiative (MONDO) | gene β disease, disease identity, synonyms for search | 93 | π’ stated |
| Human Phenotype Ontology | symptoms per disease; information content and null model for scoring | 996 | π’ stated |
| Reactome (release 97) | gene β pathway, lowest-level human pathways only | 269 | π’ stated |
| ClinVar | pathogenic gene changes | 156 | π’ stated |
| Orphanet | patient organisations | 95 | π‘ name match |
| PubMed | papers | 249 | π‘ search match |
| NIH RePORTER | research grants | 33 | π‘ search match |
In total, 1,514 edges are stated by a curated database and 377 are inferred, and the app always says which is which.
The heart of RareVerse is a deterministic engine in lib/grading/ that decides which diseases are related, how strongly, and why. The full specification lives in docs/grading.md. Four rules shape everything:
Note
- Three scores, never mixed. Biology (same gene, same kind of gene change, same pathway) is the only number that sets distance on the map. Clinical resemblance (symptoms, onset, inheritance) is shown beside it. Collaboration (shared groups, papers, studies, grants, researchers, registries) never moves a disease.
- The engine computes, the AI only reviews. AI judgments can lower a tier or add a caveat. They never raise a grade or change a number.
- No number without a source. Every shared item carries the ids of the edges behind it.
- A test holds the engine to the literature. A literature-rated answer key fails the build when grades drift.
flowchart TD
G[("public/graph.json")] --> CP["Candidate pairs<br/>inverted index on genes, variants, pathways,<br/>rarest symptoms and shared work"]
H[("HPO reference<br/>information content Β· 20,000-pair null model")] --> CLIN
CP --> D{{"11 evidence dimensions per pair"}}
D --> BIO["𧬠Biology<br/>gene · variant type · pathway"]
D --> CLIN["π©Ί Clinical<br/>symptoms Β· onset and inheritance"]
D --> COL["π€ Collaboration<br/>groups Β· papers Β· studies Β· grants Β· researchers Β· registries"]
BIO --> NB["noisy-OR with caps"] --> TIER{"Tier rules"}
TIER -->|"β₯ 0.75, two independent lines, one observed"| S["Strong"]
TIER -->|"β₯ 0.45"| M["Moderate"]
TIER -->|"β₯ 0.20"| E["Exploratory"]
CLIN --> NC["noisy-OR with caps"] --> LOOK["Looks very similar Β· similar Β· somewhat Β· different"]
COL --> NL["noisy-OR with caps"] --> BR["Collaboration bridges"]
S & M & E --> AIR{"Optional AI review"}
AIR -->|"can only lower"| OUT[("public/relevance.json")]
LOOK --> OUT
BR --> OUT
OUT --> CL["Louvain clusters Β· centrality Β· 3D coordinates"]
OUT --> KEY["β
Answer-key test<br/>14 literature-rated pairs"]
classDef bio fill:#EEEBFA,stroke:#5B4BB7,color:#2B2266
classDef clin fill:#FCEBF1,stroke:#B23C68,color:#5C1530
classDef col fill:#E6F4EC,stroke:#2B7A4B,color:#0F3D22
classDef data fill:#E8F1FF,stroke:#2A78D6,color:#0B2E59
classDef ok fill:#E7F8F2,stroke:#1BAF7A,color:#0B4A33
class BIO,NB,TIER,S,M,E bio
class CLIN,NC,LOOK clin
class COL,NL,BR col
class G,H,OUT data
class KEY,CL ok
| Family | Dimension | What is compared | Cap |
|---|---|---|---|
| 𧬠Biology | gene |
Genes linked to each disease | 0.70 |
| 𧬠Biology | mechanism |
Reactome pathways reached through the disease or its genes: the most specific shared one | 0.80 |
| 𧬠Biology | variant |
Share of loss-of-function changes, read from HGVS notation (a modifier) | 0.25 |
| π©Ί Clinical | phenotype |
HPO symptom profiles, information-weighted (SimGIC) and scaled between two anchors | 0.75 |
| π©Ί Clinical | disease |
Onset and mode of inheritance (a modifier) | 0.40 |
| π€ Collaboration | patient_org Β· asset |
Patient groups and registries | 0.50 |
| π€ Collaboration | trial Β· investigator |
Clinical studies and researchers | 0.40 |
| π€ Collaboration | paper Β· grant |
Papers and research grants | 0.30 |
Within a family, independent lines of evidence combine as a noisy-OR with caps, so agreement is what makes a link strong and no combination ever reaches 1. Two different diseases are never the same disease:
β modifiers count only when the pair already shares a gene or a pathway (for v) or some symptoms (for d).
π¬ Deep dive: how a pathway, a symptom and a gene change are weighed
A pathway is only as telling as it is rare. A pathway shared by every disease cannot tell any two apart. For a Reactome pathway reached by n of the N diseases with pathway data (N = 81 here), the engine uses information content normalized so that a pathway shared by exactly two diseases weighs 1. Big pathways are discounted by their size in proteins:
The pair scores the weight of the most specific pathway both diseases reach (Resnik's most informative common ancestor), so a gene that sits in many pathways cannot dilute the one it really shares.
| Reactome pathway | Proteins | Diseases reaching it | Weight |
|---|---|---|---|
| Galactose catabolism | 6 | 3 of 81 | 0.729 |
| Hyaluronan degradation | 16 | 2 of 81 | 0.720 |
| Melanin biosynthesis | 5 | 5 of 81 | 0.630 |
| Glycosphingolipid catabolism | 39 | 12 of 81 | 0.325 |
A symptom is only as telling as it is rare. "Seizure" is shared by hundreds of unrelated diseases, while "large clumps of pigment along the hair shaft" points at a handful. Each HPO term gets an information content over all 12,880 annotated diseases, symptom sets are closed upward through the ontology, and two diseases are compared with SimGIC (Pesquita et al., 2008):
A raw score means nothing on its own, so it is calibrated against two anchors measured on HPO's whole corpus: 0 at the 99th percentile of 20,000 random disease pairs (SimGIC 0.1636), and 1 at the median of 497 pairs of OMIM and Orphanet records of the same disease (SimGIC 0.3173). That is how the panel can honestly say "about as much overlap as two records of the same disease".
A shared gene is one line of evidence, never three. Gene changes and pathways hang off the gene, so a gene shared by two diseases would otherwise count three times. The engine sets them aside for allelic pairs (same_gene_allelic). One shared gene alone is therefore moderate, never strong, because the same gene can be broken in opposite ways (NOTCH2: Hajdu-Cheney syndrome, listed here as "acroosteolysis dominant type", versus Alagille syndrome 2).
| Biology tier | Score | Extra rule |
|---|---|---|
| π£ Strong | β₯ 0.75 | needs at least two independent lines of evidence, one of them stated by a curated source |
| π΅ Moderate | β₯ 0.45 | a gene-change conflict caps a pair here |
| βͺ Exploratory | β₯ 0.20 | a contradicted biology edge caps a pair here |
Clinical resemblance has its own words: looks very similar (β₯ 0.65), similar (β₯ 0.40), somewhat similar (β₯ 0.20) or different, and a thin symptom record caps it.
| Pair | Biology | Why, in the engine's own terms |
|---|---|---|
| Griscelli syndrome 1 β 2 | π΅ 0.655 | two shared pathways; both genes' ClinVar records mostly loss-of-function |
| Tay-Sachs β Sandhoff | π΅ 0.629 | five shared pathways, the most specific Hyaluronan degradation (2 of 81) |
| Galactokinase deficiency β classic galactosemia | π΅ 0.584 | Galactose catabolism (3 of 81 diseases) |
| Tietz syndrome β COMMAD | π΅ 0.70 | same gene (MITF); whether both break it the same way is unknown |
| Stickler syndrome 1 β osteopetrosis 3 | βͺ 0.241 | one broad developmental pathway (13 of 81) |
data/curated/answer_key.json rates 14 pairs from the literature (high, medium or low), each with a reason and a PubMed or Reactome source. lib/grading/answer-key.test.ts runs in CI and fails if the engine orders them differently or tiers them wrongly. 9 of 14 pairs hold. The other 5 are documented as known disagreements, each with its cause (the data or the engine's priors), not hidden. A clinician can edit the key and rerun npm test to recalibrate.
Tip
Scale. Comparing every disease with every other is quadratic, so candidate pairs come from an inverted index plus a set-similarity prefix filter. The whole atlas (4,278 disease pairs, 1,040 with something gradable) grades in about 60 ms, and the output is byte-identical on every run. CI checks that.
The moment that matters is when a family decides to write to someone. RareVerse makes that one click. It is also built so that the AI cannot invent a person, a page or an email.
%%{init: {"sequence": {"actorMargin": 30, "width": 120, "diagramMarginX": 10}}}%%
sequenceDiagram
autonumber
actor F as Family
participant UI as RareVerse<br/>in the browser
participant API as /api/contacts<br/>on the server
participant REC as PubMed and<br/>NIH RePORTER
participant AI as OpenAI<br/>gpt-6-luna<br/>with web search
participant V as Verifier
F->>UI: Who can I contact?
UI->>API: POST the<br/>disease ids
API->>REC: papers and grants<br/>linked to the disease
REC-->>API: authors, affiliations,<br/>grant leads
Note over API: Candidate list c1, c2, ...<br/>built WITHOUT AI
API->>AI: pick only from the candidates,<br/>at most 4 web searches,<br/>strict JSON schema
AI-->>API: chosen people,<br/>the pages it opened
API->>V: keep or drop every person,<br/>link and email
Note over V: name match, page allow-list,<br/>SSRF guard, name on the page,<br/>email printed on<br/>an official page
V-->>API: verified cards,<br/>each with its check lines
API-->>UI: contacts,<br/>cached for 24 hours
UI-->>F: who, why, and<br/>checked ways<br/>to reach them
| Guarantee | How it is enforced |
|---|---|
| π€ Only real researchers | Candidates are the senior, first and corresponding authors of linked PubMed papers and the leads of linked NIH grants. The model must pick by id, and the server drops anyone whose name does not match. |
| π Only pages it actually opened | Every URL must appear among the web-search sources, the citations or our PubMed/NIH links. |
| π Pages are checked | Profile and lab pages are fetched (6 s, 1 MB, public hosts only, behind an SSRF guard) and must name the person. A page that blocks automated readers is kept only when its own address names them, and the card says it could not be opened. |
| βοΈ No guessed emails | An email is shown only if it is printed on the official page or in the PubMed record, and it must belong to that person. |
| π§Ύ No unchecked prose | The model's free-text notes are never shown. Each "why" is checked against the PubMed or NIH record, and replaced by one written from the record when it claims more. |
| π Key never leaves the server | OPENAI_API_KEY is read only in a server-only module, is never sent to the browser and is never logged. |
| πΈ Cost control | A 24-hour cache, 6 new searches per visitor per 10 minutes (shared by everyone while CONTACTS_TRUSTED_PROXY_HOPS is 0, the default), at most 2 OpenAI calls at once, and a server-wide hourly cap (30 by default). |
| Tool | Version | Needed for |
|---|---|---|
| Node.js | 24 (what CI uses); 22.18+ also runs the TypeScript scripts | the app, the build scripts, the tests |
| npm | 10+ (ships with Node) | installing |
| Python | 3.10+, standard library only | rebuilding the seed graph from the public APIs (optional) |
| OpenAI API key | any key with access to the model you choose | the "Who can I contact?" button (optional) |
# 1. Clone
git clone https://github.com/vihuynh72/research-os.git
cd research-os
# 2. Point the lockfile at the public npm registry.
# It was generated on Replit, whose package mirror is private; CI makes the same change.
node -e "const f='package-lock.json',fs=require('fs');fs.writeFileSync(f,fs.readFileSync(f,'utf8').replaceAll('http://package-firewall.replit.internal/npm/','https://registry.npmjs.org/'))"
# 3. Install the exact locked versions
npm ci
# 4. (Optional) turn on the AI contact finder
cp .env.example .env.local # then set OPENAI_API_KEY=sk-... in .env.local (restart the server after changing it)
# 5. Start the app
npx next dev --port 3000Open http://localhost:3000, or jump straight to a disease: http://localhost:3000/?d=MONDO:0010100 (Tay-Sachs). The graph and the grades are committed, so the app runs right away with no API calls. Only the contact finder needs a key.
Warning
npm run dev and npm start bind to 0.0.0.0:5000 (that is what Replit expects). On macOS, port 5000 belongs to the AirPlay Receiver, so use npx next dev --port 3000 and npx next start --port 3000 as shown, or turn off AirPlay Receiver in System Settings.
Tip
Step 2 edits package-lock.json. Don't commit that change: git checkout -- package-lock.json restores it after installing.
npm run build
npx next start --port 3000npm run check:schema # schema.json and public/graph.json
npm run data:graph -- --check # the graph rebuilds byte for byte from its committed inputs
npm test # 321 tests, including the literature answer key
npm run grade:check # the committed grades match the engine
npm run build # the production build CI makes before the type check
npm run typecheck # TypeScript, no emitπ οΈ Troubleshooting
| Symptom | Fix |
|---|---|
npm ci fails with ENOTFOUND package-firewall.replit.internal |
Run step 2 (the lockfile still points at Replit's private mirror). |
EADDRINUSE :5000, or a 403 page from AirPlay |
Use npx next dev --port 3000, or turn off AirPlay Receiver. |
Unknown file extension ".ts" when running a script |
Use Node 24 (or 22.18+): the scripts are TypeScript run natively by Node. |
"Who can I contact?" says Not switched on here yet (the API answers 503 no_key) |
Put OPENAI_API_KEY=sk-... in .env.local and restart the server: Next.js reads .env.local at startup. |
| A hydration warning that mentions extension attributes | A browser extension (such as Grammarly) edited the page before React loaded. It is harmless, and RareVerse already ignores it on <html> and <body>. |
Copy .env.example to .env.local. Git ignores every .env* file except the example. Every variable is optional: without any of them, the whole atlas works and only the contact finder is off.
| Variable | Default | What it does |
|---|---|---|
OPENAI_API_KEY |
(none) | Turns on the AI contact finder. Server-side only. |
OPENAI_MODEL |
gpt-6-luna |
The model the contact finder uses (it needs the Responses API web-search tool). |
CONTACTS_MAX_SEARCHES_PER_HOUR |
30 |
New OpenAI searches per hour for the whole server, a whole number from 1 to 1000. Repeated questions come from the cache for free. |
CONTACTS_TRUSTED_PROXY_HOPS |
0 |
How many proxies (0 to 5) in front of the server append the visitor's address to X-Forwarded-For (often 1 on a hosting platform). 0 trusts none, so every visitor shares one rate limit. |
NCBI_TOOL Β· NCBI_EMAIL |
(unset) | Optional: identify your deployment to NCBI when reading PubMed. |
ATLAS_DATA_DIR |
./public |
Load graph.json and relevance.json from another folder. |
REPLIT_DEV_DOMAIN |
(unset) | Set by Replit; added to Next.js allowedDevOrigins. Not needed locally. |
Caution
Never commit a real key, never prefix it with NEXT_PUBLIC_, and set a monthly budget on your OpenAI project. On a hosted deployment (Replit, Vercel, β¦) put the key in the platform's Secrets panel, not in a file.
The committed files are enough to run and grade the atlas. To regenerate them from the public APIs, run the steps in this order:
flowchart TB
subgraph S1["β Fetch public records"]
direction LR
C[["candidates.json<br/>diseases to include"]] --> BG["π build_graph.py<br/>Monarch Β· ClinVar Β· PubMed<br/>NIH RePORTER Β· Orphanet"] --> SEED[("data/seed/rare_graph.json")]
end
subgraph S2["β‘ Reference data and weights"]
direction LR
HPO["npm run data:hpo<br/>HPO release β<br/>IC, null model, anchors"] --> WG["π weight_graph.py<br/>weights on the seed"] --> REA["npm run data:reactome<br/>Reactome Analysis Service"]
end
subgraph S3["β’ Build, grade and index"]
direction LR
G["npm run data:graph<br/>β public/graph.json"] --> GR["npm run grade<br/>β public/relevance.json"] --> AL["node scripts/<br/>build-search-aliases.ts<br/>β public/search-aliases.json"]
end
S1 --> S2 --> S3
classDef py fill:#FFF4E5,stroke:#EDA100,color:#5A3B00
classDef ts fill:#EEEBFA,stroke:#5B4BB7,color:#2B2266
classDef data fill:#E6F4EC,stroke:#2B7A4B,color:#0F3D22
class BG,WG py
class HPO,REA,G,GR,AL ts
class C,SEED data
python3 pipeline/build_graph.py data/raw/candidates.json # public records β data/seed/rare_graph.json
npm run data:hpo # HPO files β data/reference/hpo-reference.json
python3 pipeline/weight_graph.py # information-content weights on the seed
npm run data:reactome # Reactome β data/reference/reactome-pathways.json
npm run data:graph # seed + references β public/graph.json
npm run grade # β public/relevance.json + data/grading/bundles.json
node scripts/build-search-aliases.ts # optional: synonyms for search (about a minute)-
The candidate list is yours to choose, and it is not in the repository. Create
data/raw/candidates.jsonbefore the first step. Itskeptarray lists the diseases to include:{ "kept": [ { "id": "MONDO:0010100", "name": "Tay-Sachs disease", "gene": "HEXA", "gene_id": "HGNC:4878", "orpha": "845" } ] }pipeline/build_graph.pyqueries Monarch, ClinVar, PubMed, NIH RePORTER and Orphanet live for every disease, so it needs network access and takes a while. -
HPO and Reactome downloads are cached in
data/raw/(git-ignored):npm run data:hpo -- --refreshornpm run data:reactome -- --refreshfetches them again. Every step afterbuild_graph.pycan then run offline. -
Determinism is enforced.
npm run data:graph -- --checkandnpm run grade:checkexit 1 on any byte that differs, and CI runs both. -
pipeline/export_atlas.pyis an alternative Python exporter. The app's canonical files come fromdata:graphandgrade, the same scripts CI checks.
| Challenge | How RareVerse solves it |
|---|---|
Public data is messy. Phenotype labels arrive out of order, patient groups match on generic words such as "disease", and titles carry &. |
Labels are re-read from HPO by id, a word list drops generic name matches, entities are decoded once, and every gap is recorded rather than filled. |
| Evidence is not independent. One shared gene drags its gene changes and pathways along, which would look like three agreeing facts. | Allelic evidence counts once. Pathways that only come with the shared gene are set aside, and a strong link needs two independent lines. |
| Not all overlap is meaningful. "Seizure" is everywhere. | Information content over 12,880 diseases, SimGIC over ontology closures, and calibration against a 20,000-pair null model and same-disease anchors. |
| Big pathways say little. | Atlas-level specificity (Resnik-style IC) times a protein-count discount, scored on the most specific shared pathway. |
| Trust. A parent will bring this to a doctor. | Every sentence is built from structured fields with numbered citations, each edge is tagged stated or inferred, absences cite the dataset searched, and a literature answer key gates CI. |
| AI hallucination. | The model chooses only from a candidate list built without AI, and the server verifies every page and email before anything renders. |
| Readable at a glance. 150 neighbors want to be on screen. | A deterministic radial layout keeps distance honest at every filter value (a property tested at all 101 percent steps), with a 14-name label budget and collision-free label placement. |
| Two audiences. | Caregiver and researcher views of the same evidence: plain words for one, score tables and ids for the other. |
| Reproducibility. | Seeded randomness, sorted iteration and byte-identical outputs checked in CI. Same inputs, same bytes. |
flowchart LR
subgraph IN["Install"]
direction TB
P(["push or<br/>pull request"]) --> I["npm ci"]
end
subgraph DAT["Data"]
direction TB
S["check:schema<br/>graph contract"] --> D["data:graph --check<br/>byte-identical<br/>rebuild"]
end
subgraph ENG["Engine"]
direction TB
T["npm test<br/>321 tests +<br/>answer key"] --> G["grade:check<br/>grades match<br/>the engine"]
end
subgraph WEB["App"]
direction TB
B["next build"] --> TC["typecheck"] --> OK(["β
green"])
end
IN --> DAT --> ENG --> WEB
classDef step fill:#EEEBFA,stroke:#5B4BB7,color:#2B2266
classDef ok fill:#E7F8F2,stroke:#1BAF7A,color:#0B4A33
class I,S,D,T,G,B,TC step
class P,OK ok
The 321 tests across 34 files cover the grading engine and the literature answer key, the graph adapter and search (synonyms, typos, plurals), map invariants (honest distance at every filter value, label budget, deterministic layouts), the panel's citation registry and view models, URL state, the 3D scene, and the contact finder (PubMed parsing, verification rules, SSRF guard, rate limits).
| Script | What it does |
|---|---|
npm run dev |
Development server on 0.0.0.0:5000 (Replit). Locally, prefer npx next dev --port 3000. |
npm run build Β· npm start |
Production build and server. |
npm test |
All unit tests, run with Node's built-in test runner. |
npm run typecheck |
TypeScript, no emit. |
npm run check:schema |
Validate schema.json, its example and public/graph.json. |
npm run data:hpo |
Build the HPO reference (information content, null model, anchors). |
npm run data:reactome |
Fetch Reactome pathways for the atlas's genes. |
npm run data:graph |
Seed + references β public/graph.json (-- --check to verify). |
npm run grade Β· grade:check |
Grade the atlas β public/relevance.json (or verify it). |
research-os/
βββ app/ Next.js App Router: page, layout, icon
β βββ api/
β βββ contacts/ POST /api/contacts: the AI contact finder (server only)
β βββ refresh/ POST /api/refresh: rebuild graph + grades (local development only)
βββ components/atlas/ the product UI
β βββ map/ label budget, line styles, universe layout, legend, kind chips
β βββ panel/ view model, citation registry, disease / pair / node views
β βββ contact/ the "Who can I contact?" dialog
β βββ KnowledgeGraph.tsx the 2D map (SVG)
β βββ Graph3D.tsx the 3D view (canvas)
β βββ AtlasApp.tsx state, URL sync, layout
βββ lib/
β βββ grading/ the deterministic grading engine (+ answer-key test)
β βββ graph/ graph index and search, neighborhood builder, next steps
β βββ contacts/ PubMed, NIH, OpenAI, verification, SSRF guard, limits
β βββ viz/ radial layout and 3D projection math
β βββ data/ data loader
βββ pipeline/ Python: fetch public records β seed graph, weights, clusters
βββ scripts/ TypeScript build steps: adapter, HPO, Reactome, grading, search synonyms
βββ data/ seed graph, reference files, answer key, grading bundles
βββ public/ graph.json, relevance.json, search-aliases.json (what the app loads)
βββ docs/grading.md the grading engine, in depth
βββ schema.json the graph contract (JSON Schema 2020-12)
RareVerse is built to be extended: by developers, by data people, and by clinicians who can tell us where the engine is wrong. Contributions of every size are welcome.
- Fork the repository and create a branch:
git checkout -b feature/your-idea. - Make your change, and keep
npm test,npm run typecheckand the--checkscripts green. - Open a pull request that says what changed and why. Screenshots help for UI work.
House rules (they are what make RareVerse trustworthy):
- π§Ύ No claim without a source. Every edge needs
source,url,dateandkind(observed, inferred or contradicted). If the data does not say it, the UI says "not on record". - π― Deterministic by default. Same inputs, same bytes: no unseeded randomness, no order that depends on the machine.
- π€ AI may lower, never raise. Model output can add a caveat, cap a tier or propose contacts that are then verified. It never creates a grade or a fact.
- π£οΈ Plain words for families. Jargon belongs in the researcher view.
- π Secrets stay on the server. Never commit keys, and never expose them to the browser.
| Idea | Why it matters |
|---|---|
| Fetch ClinVar variants per condition | It would tell diseases of the same gene apart (same mechanism or opposite ones). |
| Add onset and inheritance from HPO annotations | The clinical "onset and inheritance" dimension is ready but unfed. |
| Ingest ClinicalTrials.gov studies as trial nodes | Families need recruiting studies, and the panel already knows how to show them. |
| Make NIH grant leads researcher nodes | It would complete the "who is working on this" network. |
| Clinician review of the answer key | One edited JSON file recalibrates the engine. |
| Collaboration brief export | A sourced proposal for two groups to share research (the button is waiting). |
| Grow the atlas past 93 diseases | The engine's weights are relative to the atlas, so more diseases give sharper signals. |
| Translations | Many rare-disease families do not read English. |
- Evidence-first knowledge graph from 7 public sources
- Deterministic grading engine with a literature answer key
- Map, 3D and list views; search with synonyms and typo tolerance
- Numbered citations on every claim
- AI contact finder with server-side verification
- Collaboration brief (export a sourced research proposal)
- Clinical studies and researchers as first-class nodes
- Per-condition gene changes
- Clinician-reviewed answer key
- 1,000+ diseases
Warning
RareVerse is a research and discovery tool, not medical advice. Grades describe shared biology in public records. They are not diagnoses or treatment recommendations. Known limits are documented in docs/grading.md: for example, some diseases have no symptoms on record yet, and gene changes are recorded per gene rather than per disease.
| Vi Huynh | Jaspal Saluja | Paul Marquardt |
Built at the 7th Global AI Hackathon (Hack-Nation, 2026).
RareVerse stands on public science: the Monarch Initiative, the Human Phenotype Ontology, Orphanet, Reactome, ClinVar, PubMed and NIH RePORTER, plus OpenAI for the contact finder. Data belong to their sources and remain under their terms.
The authors have not chosen a license yet. Until a LICENSE file is added, please open an issue before reusing the code.



