Multiple Sclerosis Dashboard

I was diagnosed with Multiple Sclerosis in 2016.

I'm not going to do the whole "this is what MS is" thing because you can Google that and I'm not a neurologist. The short version is your immune system attacks the myelin sheath around your nerves (the insulation, basically) and you get lesions in your brain and spinal cord and things stop working properly. It's chronic, it's unpredictable, and the standard treatment is immunosuppressive drugs that turn down your entire immune system to stop it from attacking itself - which works, sort of, but also means you're immunocompromised and that comes with its own set of problems.

I declined all disease-modifying therapies (DMTs). That's a whole conversation and I'm not going to get into the reasoning here because it would take like 10,000 words and honestly I'm still not sure if it was the right call. I think it was. Ask me again in 10 years.

What I did instead was go deep on functional medicine, hormonal optimization, and basically try to understand my disease at a molecular level so I could make informed decisions about what to do about it. Not "I read some articles about vitamin D" deep - I mean I got my full genome sequenced (743,054 markers from the Estonian Biobank genotyping array), pulled 10 years of lab work, tracked every MRI, mapped out every genetic variant that touches MS pathways, cross-referenced it all, and built a system to make sense of it.

For 10 years after diagnosis I had zero clinical relapses. Zero medication. Lived normally.

Then in March 2026 I had my first relapse - a C4 cervical cord lesion that affected my right hand, arm, and gait. After a decade of nothing, suddenly I needed to make consequential decisions fast. Which supplements to prioritize for remyelination. Whether hormone therapy was safe given my genetics. Whether relocating from Estonia (59°N, basically no UV half the year) to somewhere like Thailand (13°N) would actually matter. Whether the hives I got after IV steroids were a random side effect or evidence of something deeper.

The conventional medical system isn't built for this. My neurologist handles DMT conversations. My functional medicine practitioner (Justin Maguire, based in South Africa, remote) handles supplements & hormones. My genetic data sits in a raw file from the Estonian Biobank. My lab results are scattered across three hospital systems and two countries. My MRI images are on a CD. Nothing talks to anything else.

So I built a system that connects all of it.

overview

What it actually is

A GitHub repo that turned into a personal medical operating system. There's a structured knowledge base (71 wiki pages, 24 data files, 288 raw source documents - PDFs, MRI DICOMs, genetic exports, 17 months of WhatsApp consultation archives), a live diagnostic dashboard (Next.js on Vercel with a knowledge graph and biological age calculators and severity-ranked findings), and an AI research layer (Claude-powered multi-agent swarms, 15+ Python tools, autonomous literature monitoring, an in-dashboard assistant with 15 tool definitions).

Everything version-controlled. Every claim sourced. Every change logged.

The numbers if you're curious: 640+ lab data points across 153 unique biomarkers from 30+ dates spanning 2015 to 2026. ~90 genetic variants across 14 categories. 4 MRI scans. 31 research deep-dives totaling 9,400+ lines. ~17,000 lines of dashboard code. 71 wiki pages with 14,000+ lines of content. Whether any of this is actually useful or whether I just built an elaborate coping mechanism is honestly an open question.

The dashboard

Next.js app, 12 tabs, GitHub dark theme because I like the look.

The overview shows days since my last IV steroid course (IVMP) and priority-ranked alerts.

overview with AI tools and action queue

Health data tab organizes everything by biological system (immune, antiviral, thyroid, hormonal) rather than by data type, which took me embarrassingly long to figure out was the right way to do it - bundling the relevant genes & biomarkers & supplements & research for each system together instead of having them in separate silos.

health data with antiviral defense sidebar

Labs tab has every blood test since 2015 with alias-aware fuzzy search (type "b12" or "cobalamin" or "methylcobalamin" and it finds the right marker), filterable by date range, abnormal-only toggle, grouped by body system. It uses both standard lab reference ranges AND functional/optimal ranges from OptimalDX methodology. The difference between TSH 0.41 "within range" and TSH 0.41 "floor of range, functionally suppressed" is a treatment decision and most lab portals just show you the first one.

labs with marker detail sidebars

full biomarker table with trend sparklines

Genetics tab has all ~90 variants browsable by category. Treatment plan has the full supplement stack (30+ compounds) each linked to the specific genetic variant or lab finding that justifies it.

treatments tab

supplement detail sidebar

Graph tab is an interactive knowledge graph in Cytoscape.js - genes as red diamonds, biomarkers as blue ellipses, supplements as green rectangles, click any node and a sidebar opens with connections & evidence & action items.

knowledge graph

graph zoomed in

There's also a gap analysis mode that breaks the graph into clusters so you can see which genetic pathways have monitoring gaps vs which ones are fully covered.

gap analysis view

Timeline covers everything from 2011 to now (418 lines of YAML).

timeline

There's a files tab for browsing all 288 raw source documents and a research tab for the 31 deep-dives.

research deep-dives

The genetics

This is probably the part I spent the most time on and also the part where I'm least confident I actually understand what I'm looking at (genomics is hard and anyone who tells you otherwise is either a geneticist or lying).

I extracted ~90 MS-relevant variants from my Estonian Biobank genome data (743,054 markers, 349,433 rs-prefixed) and organized them into 14 categories. I'll go through the ones that actually matter.

MS susceptibility: HLA-DRB1*15:01 is the big one (odds ratio ~3.0, the strongest genetic risk factor for MS). I'm also homozygous on two STAT3 variants which is a double-hit on the Th17 inflammatory pathway. IL2RA/CD25 homozygous risk, PTGER4 homozygous, RGS1 homozygous. Lots of homozygous risk alleles which is... fun.

Cytokine imbalance: IL-1beta homozygous HIGH, TNF-alpha heterozygous HIGH, IL-10 homozygous LOW. In plain language my genetics produce a lot of pro-inflammatory signals and very little counter-regulation. Pro-inflammatory state with no brake. This matters for basically everything.

The antiviral triple-hit

This is where it gets interesting.

I have a triple-hit across TLR3-L412F (homozygous - impaired dsRNA sensing), IRF7 (heterozygous), and TLR9 (heterozygous). Three genes involved in detecting and fighting viruses, all compromised. Combined with sky-high EBV antibodies (VCA 727 U/mL) and the growing evidence that EBV is causally linked to MS... that pattern tells a story. There's one compensating factor - IFNL4 TT gives me strong interferon-lambda production which partially makes up for the sensing deficit. But "partially" is doing a lot of work in that sentence.

And then COVID happened. My pre-infection IgG was 0.7. Post-infection: 2,748. That's not a typo. When your virus-sensing apparatus is genetically impaired, a massive immune activation event like that is... not ideal. The system tracks this as a potential MS disease activity trigger which I think is reasonable given the context.

The vitamin D 11-locus chain

I have 11 variants across the entire vitamin D pathway. Not one or two SNPs - eleven, spanning every single step from sun hitting your skin to the vitamin D receptor actually doing its job in the cell.

DHCR7 (synthesis), CYP2R1 (first hydroxylation - two variants), GC/VDBP (transport - three variants), CYP27B1 (activation - three variants), VDR (receptor - four variants), CYP24A1 (catabolism - two variants).

Every. Single. Step.

Population frequency of this combination is estimated at somewhere between 1-in-2,000 and 1-in-50,000 (I don't know exactly, the math gets complicated with linkage disequilibrium and population-specific allele frequencies and honestly I'm not sure the estimate is even meaningful at that point).

vitamin D detail sidebar showing the decline

This explains why my vitamin D declined from 68 to 36 nmol/L over 7 years despite supplementing and despite living in southern Europe for part of that time. I wasn't just "not getting enough sun" - the entire metabolic pathway is compromised. I need way more than the average person at every stage: more UVB exposure, higher oral doses, better transport, more activation. The system connected all 11 variants into a single chain and calculated the cumulative impairment.

No single doctor would have caught this because no single doctor looks at 11 SNPs across 6 genes and connects them into one pathway story. You'd need a geneticist AND an endocrinologist AND a neurologist all looking at the same data at the same time which... doesn't happen.

The rest of the genetics

Methylation: MTHFR A1298C homozygous + MTRR A66G heterozygous. Dual methylation impairment affecting folate metabolism, homocysteine clearance, histamine breakdown.

Neuroplasticity: BDNF Val66Met heterozygous, ~25% reduced BDNF secretion which impairs remyelination. Kind of important when your disease literally destroys myelin and you need your brain to rebuild it.

Iron metabolism: HFE H63D heterozygous, explains my elevated transferrin saturation (52.75%). Would be alarming without the genetic context - with it, it's expected & monitored.

Gilbert's syndrome: UGT1A1*28 homozygous. My bilirubin runs high (42 µmol/L) and it looks scary on a lab report but it's genetically benign. The dashboard knows this and overrides the severity from CRITICAL to LOW with documented rationale. Also GSTP1 I105V heterozygous which affects drug detox.

Thyroid: DIO2 Thr92Ala homozygous. This one was discovered during the pharmacogenomics analysis, not something anyone was looking for. Makes me a poor converter of T4 to T3 (the active thyroid hormone). Turned out to be critical for treatment sequencing.

Pharmacogenomics: CYP3A5, CYP450 variants, UGT polymorphisms, OPRM1. These determine how I metabolize specific drugs and the system checks every new medication against this profile before it enters the treatment plan.

And some good news for once: APOE ε3/ε3 (no Alzheimer's risk), no Factor V Leiden, no Prothrombin mutation, TPMT wild type.

Every variant is cross-referenced against the biomarkers it affects & the supplements it necessitates via a schema layer that maps genes to markers to interventions. There's a 1,457-line alias file that maps every possible name for 153 biomarkers to a single canonical name (so "b12" and "cobalamin" and "methylcobalamin" all resolve to the same marker). When I add a new variant the graph rebuilds, new edges appear, the chain engine re-runs, and a variant I added for pharmacogenomic purposes might surface a monitoring gap I didn't know existed.

The analysis engine

The dashboard doesn't just show numbers - it reasons about them. Or tries to, anyway.

analysis tab with PhenoAge, NLR charts, and critical alerts

PhenoAge is a biological age calculation from 9 routine blood biomarkers using the Levine 2018 algorithm (I ported it from Python to TypeScript so it runs client-side in the browser). Result: biological age 3.3 years younger than chronological. The organs are in good shape.

GlycanAge is immune age from IgG glycosylation patterns. Result: +14 years. My immune system is aging 14 years faster than my organs.

That 17-year divergence is itself a finding. My immune system is chronically overactivated and aging faster than the body it's supposed to be protecting (and is instead attacking). Consistent with autoimmune pathology. Not just two numbers - evidence that the autoimmune process is selectively aging one system while the rest stays young.

Inflammatory ratios (NLR, SII, PLR, MLR) are calculated from standard CBC data with MS-specific thresholds and tracked across all dates. The system flagged that my inflammatory ratios spiked about 4 weeks before my March 2026 relapse. If that pattern holds it means a routine blood test could warn me before I even feel symptoms which is insane when you think about it.

NLR chart with relapse threshold

SII chart with MS disease activity threshold

The severity engine classifies everything into 4 tiers (critical/high/medium/low) considering biomarker status, genetic amplification, trend direction, threshold proximity, and patient-specific overrides. Not just "in range" or "out of range" but 12 possible states.

FSH and vitamin D biomarker trend cards

And there's a clinical relevance tiering system on top of that - Tier 1 is active management (shown by default), Tier 2 is trend context, Tier 3 is baseline reference (things like EBV serology, CSF analysis that you only need to check once), Tier 4 is archival.

decisions, actions, and contraindication detail

The cross-reference chain engine (398 lines of TypeScript) automatically discovers multi-hop diagnostic chains by traversing the knowledge graph. Things like gene→biomarker→supplement chains ("MTHFR A1298C → impaired folate metabolism → methylfolate"), genetic clusters (two homozygous STAT3 hits converging on the same pathway), safety contraindications (Gilbert's → affects drug metabolism → dose adjustment), monitoring gaps ("HFE H63D iron loading risk but no recent ferritin measurement"), compensation circuits (body compensating for a genetic deficit through an alternative pathway - like my 1,25-OH vitamin D being HIGH while 25-OH is LOW, which is the body screaming "I need more substrate"), temporal cascades (biomarker spike preceding clinical relapse), and intervention response (supplement started → biomarker changed → did it actually work?).

What the system discovered

Some of these findings I genuinely don't think would have been caught otherwise.

MCAS

I have a 14-year multi-organ pattern: melanoma at 20 (2012) → chronic tonsillitis (2012) → MS diagnosis (2016) → IBS-D (2019) → hidradenitis suppurativa (2020) → seborrheic dermatitis (2024) → chronic urticaria (2026).

Seven seemingly unrelated conditions across different organ systems seen by different specialists over more than a decade.

The system unified all of them under a single hypothesis: Mast Cell Activation Syndrome.

It identified 7 genetic pillars converging on mast cell hyperreactivity: IL-1beta HIGH (more histamine release per event), TNF-alpha HIGH (amplified vascular response), IL-10 LOW (no brake), STAT3 double-hit (more mast cells in tissues), PTGER4 homozygous (amplified prostaglandin arm), MTHFR-impaired HNMT (slow histamine clearance via impaired methylation), and HFE H63D (iron loading which feeds mast cell activation).

How it happened: I got bilateral hip hives 3 days after IV steroids. The AI mechanism analyst mapped 5 converging pathways for post-steroid urticaria. The genetics interpreter flagged that 6 genetic systems converge on mast cell hyperreactivity. The cross-referencer connected this to the complete medical history and recognized that every condition on the list - melanoma, tonsillitis, MS, IBS-D, hidradenitis suppurativa, seborrheic dermatitis, urticaria - has documented mast cell infiltration in the literature.

Then I mentioned that the hives weren't just post-steroid - they've been recurring with temperature changes for years. That moved the hypothesis from "plausible" to "probable pending biochemical confirmation."

No single doctor saw this pattern. The neurologist manages MS. The dermatologist treated the HS & sebderm. The gastroenterologist diagnosed IBS-D. The allergist saw the hives. Each one only sees their organ system. The system connected them through a shared genetic architecture that none of those specialists had access to.

This changed the entire treatment approach.

The T3-histamine-rT3 vicious cycle

My functional medicine practitioner identified this one and the system's literature analysis validated it: thyroid hormone (T3) exacerbates histamine release → inflammation increases → reverse T3 goes up → T3 effectiveness decreases → the thyroid intervention defeats itself.

Then the system flagged that I'm DIO2 Thr92Ala homozygous - a poor converter of T4 to T3. Nobody was looking for this. It came out of the pharmacogenomics analysis as a side finding and turned out to change everything about the thyroid approach.

The conclusion: mast cell stabilization (ketotifen) must come BEFORE thyroid hormone (natural desiccated thyroid). If you start thyroid first, the T3 triggers histamine, the histamine triggers inflammation, the inflammation converts T3 to reverse T3, and you're right back where you started but now you're also itchy. Treatment sequencing matters as much as the treatment itself.

Finding this required the mechanism analyst mapping the T3→histamine pathway, the genetics interpreter flagging DIO2, the literature reviewer finding the rT3 feedback loop, and the cross-referencer connecting them into one chain. No single agent and no single doctor would have assembled that.

Pan-hypopituitary suppression

Not a pituitary tumor (which is what you'd normally think) - allostatic overload suppressing thyroid, HPG, growth hormone, and adrenal axes simultaneously. The system connected cortisol, TSH, LH, FSH, IGF-1, and testosterone data across multiple dates and identified the pattern. Everything suppressed, but in a way that looks like chronic stress response rather than pituitary pathology.

Melanoma history constraining treatment 14 years later

The system flagged that fingolimod (a first-line DMT my neurologist might suggest) is contraindicated with melanoma history. Skin cancer at 20 directly constraining my MS treatment options at 34. Nobody was thinking about that connection. It was sitting in my medical history the whole time.

GlycanAge vs PhenoAge

Already mentioned this above but it's worth highlighting as a discovery: -3.3 years by organ biomarkers, +14 years by immune glycan aging. The divergence itself is the finding - the autoimmune process is selectively aging one system while the rest stays young.

Drug repurposing

The system simulated what knowledge graph tools like TxGNN (Harvard/Zitnik Lab) and SPOKE would produce when queried through my specific genetic nodes. Five candidates across 7 genetically impaired pathways: ibudilast (TLR4/PDE4/MIF inhibitor that upregulates IL-10, my genetically LOW pathway), metformin (rejuvenates oligodendrocyte precursor cells for remyelination), fenebrutinib (BTK inhibitor for compartmentalized neuroinflammation), low-dose naltrexone (TLR4 antagonist, IL-10 upregulator), and tenofovir (EBV replication inhibitor - critical given the antiviral triple-hit).

Each candidate filtered through my full pharmacogenomic profile: Gilbert's UGT1A1*28, CYP3A5 non-expressor, DIO2 Thr92Ala. Not picking from a generic list - simulating which drugs would work for this specific patient with this specific genetic architecture.

AI tools - drug repurposing, pharmacogenomics, supplement interactions

pharmacogenomics report

Hormonal remyelination hypothesis

An 8-question chain tracing Testosterone + Growth Hormone → PMN/histamine/IL-10/VDR → 4 parallel myelination pathways. Backed by 80+ PMIDs. This is the theoretical basis for the hormonal optimization protocol and I think it's solid but I'm also biased because I built the thing that found it so... take that for what it's worth.

The AI

health data with AI assistant open

There's an in-dashboard Claude assistant (Opus with extended thinking, 10,000 token thinking budget) with 15 tool definitions - it can query labs, look up genetic variants, search the knowledge base, do web searches via Brave API, deep research via Perplexity, propose wiki edits shown as diffs requiring explicit confirmation, generate reports, run integrity checks. It knows which tab you're on, what you've selected, what text you've highlighted. Conversations persist across sessions.

But the more interesting part is the multi-agent research swarm. 10 custom agents, each with specialized prompts: a Research Queen that orchestrates everything (decomposes questions into sub-questions, assigns them to specialists, coordinates & synthesizes), a Literature Reviewer for PubMed deep dives, a Mechanism Analyst that maps every intervention through 8 patient-specific pathway nodes, a Genetics Interpreter that cross-references any finding against all ~90 variants (with standing rules like "always check UGT1A1 for new drugs, always check HFE H63D for anything affecting iron, always check TLR3 for anything involving viral immunity"), a Fringe Researcher for experimental & off-label stuff, and a Cross-Referencer that finds connections between the other agents' findings and resolves contradictions by evidence quality (RCT > cohort > preclinical > anecdotal).

When a research question comes in the Queen decomposes it into 3-6 sub-questions, assigns each to a specialist, they all run in parallel, the Cross-Referencer synthesizes, and the result becomes a wiki page with full PMID citations and actionable treatment implications.

There's a hard rule: Facts Before Theories. Before any agent spawns, the Queen verifies the factual premise. What actually happened? What does the bloodwork actually show? What's documented vs assumed? This rule exists because an early version once built an elaborate 2,000-word causal analysis on a wrong assumption about event ordering. One clarifying question is always better than spawning 5 agents on a wrong premise.

Authority hierarchy: Justin Maguire's prescriptions > treating neurologist > published evidence > AI research. The AI is a research collaborator, never an authority. It doesn't get to override a doctor.

Beyond the dashboard there are 15+ Python tools: a PubMed Sentinel that autonomously scans for new papers matching my genetic variants & supplements & MS-relevant topics (so the knowledge base monitors for new evidence, it doesn't just contain what was known when I built it), a causal analysis tool that matches supplement start dates to biomarker trajectories ("did starting vitamin D3 actually move my 25-OH levels?"), knowledge graph queries hitting OpenTargets and MyVariant.info, lab version tracking with SHA256 checksums (when a lab releases partial results then updates with finals), an integrity checker (cross-reference validation, duplicate detection, schema validation - outputs PASS/WARN/FAIL), MRI DICOM analysis tools, and Estonian health portal parsers.

When new lab results arrive in any format - PDF, screenshot, pasted text, portal export - the system parses them against the canonical marker schema, stores the raw source immutably, appends to bloodwork.csv, runs integrity checks, updates wiki pages, updates TRUTH.md, cross-references abnormal values against genetics, and flags resolved pending results. The whole pipeline.

Governance

Three files control everything.

TRUTH.md is the source of truth - ~240 lines representing the current state of the patient. Profile, genetic risk factors, current status, treatment stack, latest labs, MRI summary, active decisions, pending results. Every agent reads this first. Every data entry session checks for drift against it. It's the constitution of the system.

index.md is the master wiki index, updated automatically, integrity-checked by tooling. log.md is the audit trail - every change logged with timestamp, what changed, and why.

Raw source files (the /raw/ directory, all 288 of them) are immutable. Never modified by any tool or agent. If my memory of when something happened conflicts with a documented date, the system flags the discrepancy rather than silently overwriting. Raw sources win.

The build

Next.js 14.2, React, TypeScript, Tailwind CSS (GitHub dark theme), Recharts for charts, Cytoscape.js for the knowledge graph, nuqs for URL state management so every tab & filter & sidebar state lives in the URL and you can bookmark specific dashboard views.

No traditional database. CSV for lab data, YAML for genetics & supplements & timeline, markdown for wiki pages. A prebuild script generates 6 JSON artifacts before each build. Local filesystem for development, Vercel KV/Redis for production.

Claude Opus with extended thinking for the AI layer. Brave Search & Perplexity for external knowledge. PubMed E-utilities for literature monitoring. OpenTargets & MyVariant.info for genomic queries. Password cookie for auth (30-day session, single-user system). Robots noindex/nofollow, X-Frame-Options DENY, private GitHub repo - this is my actual medical data so it's locked down.

~17,000 lines of dashboard code. 27 React components. 12 API routes. Deployed on Vercel.

The family explainer

There's one page that doesn't require authentication - a plain-language explainer about MS written for my family. My partner had questions and I realized I kept explaining the same things over and over so I wrote it all down in one place and gave her the link. No jargon, no genetic variant IDs, just "here's what's happening and here's what we're doing about it and here's what to watch for."

Honestly one of the most useful things in the whole system even though it's the simplest. Having a URL you can send someone that explains your disease in normal language is... really nice. Better than trying to explain it in person for the hundredth time when you're tired.

What I think I learned

Structure beats volume. 640 lab data points are useless as a PDF stack. Put them in a CSV with canonical naming & alias resolution & cross-references & genetic context and they become something you can actually reason about.

Cross-referencing is where the value is. No single data source tells the story. The MCAS hypothesis only emerged when the system connected melanoma (2012), tonsillitis (2012), MS (2016), IBS (2019), HS (2020), sebderm (2024), and urticaria (2026) with the genetic profile. No individual specialist had that view because no individual specialist sees all your organ systems at once.

AI agents need constraints more than they need capabilities. The Facts Before Theories rule, the authority hierarchy, the immutable sources policy - those constraints are what make the system trustworthy. Unconstrained AI research produces confident nonsense. I know this because I've seen it do exactly that before I added the constraints.

Nobody is going to connect your data for you. Your neurologist doesn't have time. Your GP doesn't have the context. Your functional medicine doctor sees one piece. The only person with access to all the data is you, and if you don't build the system to make sense of it then it just stays scattered across hospital portals & PDFs & your increasingly unreliable memory.

I don't know if this is useful for anyone else. It's built for exactly one patient with exactly my genetic profile and exactly my disease history. But I think the idea is generalizable - treating your medical data as a knowledge graph where genes connect to biomarkers connect to supplements and everything is evidence-linked and AI-queryable. Someone with Type 1 diabetes or Crohn's or lupus could build something similar with their own data and I think they'd get similar value from it. I don't know though. Maybe I just built an elaborate coping mechanism and none of this actually changes outcomes. The MCAS finding feels real. The NLR/SII relapse prediction feels real. The vitamin D 11-locus chain explains something that genuinely confused me for years. But I'm also the person who built the system so of course I think the findings are real... so take all of this with a grain of salt.

I'll probably keep building this thing for as long as I have MS, which is (presumably) forever.