ETGen AI Hackathon 2026 ยท Phase 0 Prototype ยท Team Ajay Bharathi
Quick Start ยท Architecture ยท GNN Model ยท Dashboard ยท API Reference ยท Roadmap
- What is EIRION?
- Platform Demo
- Platform Architecture
- Full Analysis Process
- GNN Model: Heterogeneous Graph Attention Network
- Dashboard Features
- Tech Stack
- Project Structure
- Quick Start
- Environment Variables
- Demo Flow
- API Reference
- Data Sources & Datasets
- Roadmap
- Known Limitations
- References
- License
EIRION is the first pharmacogenomics-powered full-stack longevity platform. It combines a Heterogeneous Graph Attention Network (GATv2) for drugโgeneโorgan interaction modelling with a clinical AI engine to predict, visualize, and optimize individual organ health across a 5โ10 year horizon.
A user provides three input layers:
| Input Layer | What You Provide | What EIRION Does |
|---|---|---|
| ๐งฌ Biology | 23andMe / raw SNP upload | CYP450 metabolizer phenotype inference (CYP2D6, CYP2C19, CYP3A4, CYP2C9, CYP1A2, SLCO1B1, MTHFR) |
| ๐ Lifestyle | Sleep, stress, alcohol, diet, exercise, substance use | Quantifies organ stress from lifestyle factors |
| ๐ Regimen | Every supplement & medication with dose and frequency | Drug-drug interaction analysis + cumulative organ load scoring |
- ๐ซ Hepatic, renal, cardiovascular, and metabolic organ scores (0โ100 scale)
โ ๏ธ Drug-drug interaction (DDI) flags via GNN polypharmacy modelling- ๐ 5โ10 year organ trajectory under current vs. optimised regimen
- ๐ง Biological age estimate and delta from chronological age
- ๐ค Gemini-enriched clinical recommendations grounded in CPIC/AHA/WHO guidelines
- ๐ Downloadable 9-page clinical PDF report structured for clinician handout
https://github.com/user-attachments/assets/eirion_platform_demo.mp4
Full end-to-end demonstration: Registration โ 9-step wizard โ Analysis โ Dashboard โ PDF Export
๐ฏ Try the demo persona: Click "Try Priya Demo" on the landing page to auto-fill a canonical test case:
Priya, 35F, CYP2D6 poor metabolizer, Ashwagandha + Atorvastatin + SLCO1B1 reduced function โ statin myopathy risk flagged, 15% liver efficiency drop predicted by age 40.
End-to-end architecture: Experience Layer โ Application Layer โ Intelligence Layer โ Data Layer
The platform is composed of five architectural layers:
The React 19 + TypeScript SPA provides:
- Onboarding Wizard โ guided 9-step patient data collection
- Health Risk Dashboard โ multi-organ scorecard with interactive visualizations
- Recommendation Feed โ AI-enriched clinical advice
- Organ Trajectory View โ 5-year multi-timeframe projection charts
- Data Connection Hub โ 23andMe upload, lab OCR, wearable sync
FastAPI 0.135 serves as the API gateway with:
- RESTful endpoints for all platform features
- JWT authentication with bcrypt password hashing
- Notification service for asynchronous alerts
- Data ingestion service for genetic file parsing and lab OCR
The core inference pipeline:
- GATv2 GNN (1.29M parameters) โ compound toxicity prediction across 13 Tox21 assays
- CYP450 scoring engine โ deterministic pharmacokinetic rules with genetic multipliers
- Gemini 2.5 Flash โ patient-contextualised clinical recommendation generation
- Multi-organ trajectory projector โ 5-year organ health forecasting
- SQLite via Prisma โ user accounts, attributes, trajectory history
- PharmGKB / CPIC โ curated drug-gene relationships
- Tox21 / Reactome โ bioassay labels and biological pathway data
- RDKit โ molecular structure processing (SMILES โ Morgan fingerprints)
Complete data pipeline: Data sources โ Graph construction โ Training โ Inference โ EIRION GNN v1.0.0
User Input (9-Step Wizard)
โ
โโ Step 1: Demographics (age, sex, weight, height, ethnicity)
โโ Step 2: Pre-existing conditions (diabetes, CKD, hypertension, etc.)
โโ Step 3: 23andMe SNP upload โ SNPโPGx map โ CYP phenotype inference
โโ Step 4: Manual genetic entry (CYP2D6, CYP2C19, CYP3A4, etc.)
โโ Step 5: Lab panel โ upload image (Gemini Vision OCR) or manual entry
โ โโโ LFT (ALT, AST, GGT, ALP, Albumin)
โ โโโ KFT (eGFR, Creatinine, BUN)
โ โโโ Metabolic (HbA1c, Fasting Glucose)
โ โโโ Cardiac (LDL, HDL, Triglycerides, hsCRP)
โโ Step 6: Lifestyle โ sleep, stress, alcohol, exercise, smoking, toxins
โโ Step 7: Diet โ calories, macros, fiber, processed food %, diet type
โโ Step 8: Regimen โ every supplement & medication with dose + frequency
โโ Step 9: Confirmation & submission
โ
โผ
AnalysisRequest (Pydantic v2 โ fully validated)
โ
โโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Backend Engine โ
โ โ
โ 1. CYP450 Load Scorer (scorer.py โ 887 lines) โ
โ Compound ร metabolizer multiplier ร dose โ
โ โ per-compound hepatic load (0โ100 scale) โ
โ โ lifestyle penalties (sleep, stress, sugar) โ
โ โ food penalties (processed food, fiber, etc.) โ
โ โ
โ 2. GATv2 GNN (EirionGNN โ 1.29M params) โ
โ SMILES โ Morgan FP โ GATv2 โ 13 Tox21 probs โ
โ DrugโGeneโPathway message passing (2-hop) โ
โ โ DDI flags with mechanism explanations โ
โ โ organ-level toxicity impact scores โ
โ โ
โ 3. Multi-Organ Knowledge Graph (28K lines) โ
โ Condition penalties โ organ loads โ
โ Compound โ gene โ pathway chains โ
โ CYP genetic multipliers per compound โ
โ โ
โ 4. Multi-Organ Trajectory Projector โ
โ Baseline + optimised 5-yr projection โ
โ per organ (liver/kidney/CVD/metabolic) โ
โ Recommendation delta simulation โ
โ โ
โ 5. Gemini 2.5 Flash Enrichment โ
โ Full patient context prompt (CYP panel, โ
โ organ scores, labs, regimen with DDI notes) โ
โ โ Mechanistically specific, personalized โ
โ clinical recommendations with evidence โ
โ โ
โ 6. PDF Generator (ReportLab โ 47K) โ
โ 9-page A4 clinical handout โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
AnalysisResponse (Pydantic v2)
โ
โผ
React Dashboard (14 widgets)
โโโ Multi-Organ Scorecard (liver, kidney, CVD, metabolic)
โโโ 5-Year Trajectory Chart (baseline vs optimised)
โโโ Multi-Timeframe Projection Chart
โโโ Biological Age Widget (with chronological delta)
โโโ Risk Summary Card
โโโ DDI Flags Panel (mechanism + recommendation)
โโโ CompoundโGeneโPathway Chain Panel
โโโ Compound Contribution Breakdown
โโโ Gemini Recommendation Feed
โโโ Circadian / Sleep Panel
โโโ Guideline Reference Panel (CPIC/AHA/WHO)
โโโ Progress Tracking Chart
โโโ Clinical PDF Export Button
โโโ Compound Cart (current regimen)
EirionGNN: SMILES input โ Morgan FP โ Input projections โ 2-layer GATv2 with residual connections โ MLP head โ 13 Tox21 toxicity predictions
The EirionGNN model (engine/gnn_model.py) is a two-stage architecture with 1.29M trainable parameters:
Learns contextualised node embeddings across a heterogeneous knowledge graph using 4 edge types:
| Edge Type | Source โ Target | Count | Data Source |
|---|---|---|---|
compound โ targets โ gene |
Compound โ Gene | 21,936 + fallback | PharmGKB via InChIKey bridge |
gene โ targeted_by โ compound |
Gene โ Compound | 21,936 (reversed) | PharmGKB |
gene โ in_pathway โ pathway |
Gene โ Pathway | 48,593 | Reactome (Homo sapiens) |
pathway โ contains โ gene |
Pathway โ Gene | 48,593 (reversed) | Reactome |
| Node Type | Count | Feature Dim | Feature Source |
|---|---|---|---|
| Compound | 12,505 | 1024 | Morgan fingerprint (radius=2, RDKit) |
| Gene | 23,658 | 512 | Truncated one-hot identity |
| Pathway | 2,848 | 512 | Truncated one-hot identity |
| Total edges | 70,000+ | โ | PharmGKB + Reactome |
The dynamic attention (Brody et al. 2021) computes per-edge-type attention coefficients:
e_vu = aแต ยท LeakyReLU(W_t ยท [h_u โ h_v])
ฮฑ_vu = exp(e_vu) / ฮฃ_{kโN(v)} exp(e_vk)
h_v' = โ_{k=1}^{K} ฯ( ฮฃ_{uโN(v)} ฮฑ_vu^k ยท W^k ยท h_u )
Config: K=4 heads, hidden=128, 2 message-passing layers + residual connections + LayerNorm + Dropout(0.3)
Predicts 13 Tox21 bioassay toxicity scores per compound:
h_compound โ Linear(128โ64) โ ReLU โ Dropout(0.3) โ Linear(64โ13) โ 13 toxicity logits
Target Assays:
| Category | Assays | Biological Relevance |
|---|---|---|
| Nuclear Receptor | NR-AhR, NR-AR, NR-AR-LBD, NR-Aromatase, NR-ER, NR-ER-LBD, NR-PPAR-ฮณ | Endocrine disruption, hormone signalling, CYP induction |
| Stress Response | SR-ARE, SR-ATAD5, SR-HSE, SR-MMP, SR-p53 | Oxidative stress, genotoxicity, mitochondrial toxicity, DNA damage |
| Composite | label_any | Overall toxicity flag |
| Metric | RF Baseline | EirionGNN | Delta |
|---|---|---|---|
| Macro AUC (13 assays) | 0.7517 | 0.7628 | +1.5% |
| Best single assay | NR-AhR 0.870 | NR-AR-LBD 0.911 | โ |
| NR-AR improvement | โ | โ | +9.7% |
| NR-AR-LBD improvement | โ | โ | +13.3% |
| Parameters | ~200 trees | 1.29M | โ |
| Training time (CPU) | ~8 min | ~40 min | โ |
๐ Full Per-Assay Results (click to expand)
| Assay | GNN AUC | RF AUC | Delta |
|---|---|---|---|
| NR-AhR | 0.8423 | 0.8696 | -0.0273 |
| NR-AR | 0.7961 | 0.6987 | +0.0974 |
| NR-AR-LBD | 0.9110 | 0.7782 | +0.1328 |
| NR-Aromatase | 0.7506 | 0.7947 | -0.0441 |
| NR-ER | 0.6845 | 0.6471 | +0.0374 |
| NR-ER-LBD | 0.7629 | 0.7435 | +0.0194 |
| NR-PPAR-ฮณ | 0.6962 | 0.7519 | -0.0557 |
| SR-ARE | 0.7074 | 0.7144 | -0.0070 |
| SR-ATAD5 | 0.7891 | 0.7471 | +0.0420 |
| SR-HSE | 0.6542 | 0.6703 | -0.0161 |
| SR-MMP | 0.8306 | 0.8522 | -0.0216 |
| SR-p53 | 0.7697 | 0.7643 | +0.0054 |
| label_any | 0.7222 | 0.7402 | -0.0180 |
| Macro avg | 0.7628 | 0.7517 | +0.0111 |
| Parameter | Value |
|---|---|
| Optimizer | Adam (lr=1e-4, weight_decay=1e-4) |
| LR Scheduler | ReduceLROnPlateau (factor=0.5, patience=5) |
| Loss | BCEWithLogitsLoss (pos_weight=8.0 per task) |
| Gradient clipping | 1.0 (L2 norm) |
| Batch size | Full graph (transductive) |
| Max epochs | 300 (early stop at 240) |
| Best checkpoint | Epoch 40 (valid AUC 0.7594) |
๐ Full GNN documentation:
docs/GNN_README.mdโ 760 lines covering mathematical foundations, layer-by-layer description, InChIKey bridge construction, dataset details, and v2.0 development plans.
| Feature | Description |
|---|---|
| ๐ง 9-Step Onboarding Wizard | Demographics โ conditions โ 23andMe upload โ genetic manual entry โ lab upload/entry โ lifestyle โ diet โ regimen โ confirm |
| ๐งฌ SNP โ PGx Inference | Parses 23andMe raw .txt files, maps rsIDs to star-alleles, infers CYP450 metabolizer phenotypes for 7 genes |
| ๐ซ Multi-Organ Scorecard | Liver, kidney, cardiovascular, and metabolic scores (0โ100) with risk level colouring (green/amber/red) |
| ๐ 5-Year Trajectory | Baseline vs. optimised trajectory charts with organ-years-gained metric |
| ๐ Multi-Timeframe Projection | Extended organ health projections across multiple timeframes |
| ๐ง Biological Age | AI-estimated biological age with delta from chronological age |
| GNN-powered drug-drug interaction detection with mechanism explanation and clinical recommendation | |
| ๐ฌ CompoundโGeneโPathway Chains | Visual chain showing how each compound flows through genes to organ pathways |
| ๐ค Gemini Recommendations | Rich, evidence-grounded AI recommendations personalized to CYP genotype, organ scores, and labs |
| ๐ฉป Lab OCR Upload | Upload lab report images โ Gemini Vision extracts structured lab values automatically |
| ๐ Clinical PDF Export | 9-page professional A4 clinical handout (ReportLab): demographics, labs, PGx, DDI, trajectory, recs, disclaimer |
| ๐ฌ AI Chat | Gemini-powered conversational AI for health questions in patient context |
| โ๏ธ Profile & Settings | Name/password update, notification preferences, data export (JSON), analysis reset |
| ๐ Notification Centre | In-app notification bell with unread badge and notification management |
| ๐ Compound Cart | Live view of current supplement/medication stack with per-compound organ impacts |
| ๐ณ Pro Features | Paywall overlay for premium features (wearable sync, advanced projections) |
| Layer | Technology | Version |
|---|---|---|
| Frontend Framework | React + TypeScript | 19.2 + TS 5.9 |
| Build Tool | Vite | 8.0 |
| Styling | Tailwind CSS | 4.2 |
| State Management | Zustand (persisted) | 5.0 |
| Data Fetching | Axios + React Query patterns | 1.14 |
| Charts | Recharts | 3.8 |
| Animations | Framer Motion | 12.38 |
| Icons | Lucide React | 1.7 |
| Routing | React Router DOM | 7.13 |
| Toasts | React Hot Toast | 2.6 |
| Backend Framework | FastAPI + Pydantic v2 | 0.135 + 2.12 |
| ASGI Server | Uvicorn | 0.42 |
| Auth | PyJWT + bcrypt | 2.12 + 5.0 |
| Database ORM | Prisma Python (asyncio) | 0.15 |
| Database | SQLite | โ |
| ML Framework | PyTorch | 2.11 |
| Graph ML | PyTorch Geometric | 2.7 |
| Cheminformatics | RDKit | 2025.9 |
| ML Utilities | scikit-learn + NumPy + SciPy | 1.7 + 2.2 + 1.15 |
| AI / LLM | Google Gemini (google-genai) | 1.69 |
| PDF Generation | ReportLab + Pillow | 4.4 + 12.1 |
| Scheduling | APScheduler | 3.11 |
| HTTP Client | HTTPX | 0.28 |
| Containerisation | Docker + Docker Compose | โ |
eirion/
โโโ README.md โ this file
โโโ docker-compose.yml โ full-stack Docker orchestration
โโโ .env.example โ environment variable template
โโโ .gitignore โ git ignore rules
โ
โโโ backend/ # โโโ FastAPI API Server โโโ
โ โโโ main.py โ app bootstrap, lifespan, CORS, 11 routers
โ โโโ schema.prisma โ SQLite schema (User, UserAttributes, TrajectoryHistory)
โ โโโ database.py โ Prisma async connection manager
โ โโโ auth.py โ JWT token creation/verification + bcrypt
โ โโโ requirements.txt โ pinned Python dependencies (44 packages)
โ โโโ Dockerfile โ backend container image
โ โโโ dev.db โ SQLite development database
โ โ
โ โโโ engine/ # โโโ The Brain โโโ
โ โ โโโ __init__.py โ engine package init
โ โ โโโ scorer.py โ ๐ PRIMARY: CYP-adjusted multi-organ scoring (887 lines)
โ โ โโโ gnn_model.py โ EirionGNN: GATv2 HeteroConv model class (1.29M params)
โ โ โโโ inference.py โ GNN predictor: SMILES โ Morgan FP โ 13 Tox21 probabilities
โ โ โโโ knowledge.py โ CYP load factors, DDI rules, compound registry tables
โ โ โโโ knowledge_graph.py โ Compoundโgeneโpathway knowledge graph (28K)
โ โ โโโ graph_builder.py โ PyTorch Geometric HeteroData graph builder
โ โ โโโ projector.py โ Multi-organ 5-year trajectory projector
โ โ โโโ gemini_recs.py โ Gemini 2.5 Flash recommendation enrichment
โ โ โโโ pdf_generator.py โ 9-page A4 ReportLab clinical report (47K)
โ โ โ
โ โ โโโ weights/ # Trained model checkpoints
โ โ โ โโโ eirion_gnn_best.pt โ GATv2 GNN checkpoint (2.17 MB, best valid AUC 0.7594)
โ โ โ
โ โ โโโ planned/ # Phase 2/3 modules (designed, not yet live)
โ โ โโโ __init__.py โ planned module index
โ โ โโโ bio_age_tracker.py โ advanced biological age tracking
โ โ โโโ dmpnn_toxicity.py โ D-MPNN molecular toxicity encoder
โ โ โโโ gatv2_drug_gene_organ.py โ extended GATv2 drugโgeneโorgan model
โ โ โโโ multi_organ_expansion.py โ expanded organ system support
โ โ โโโ rl_regimen_optimizer.py โ RL (SAC/PPO) regimen optimizer
โ โ โโโ tft_forecasting.py โ Temporal Fusion Transformer (10-yr forecast)
โ โ โโโ wearable_fhir_integration.py โ FHIR R4 + Oura/Apple Health sync
โ โ
โ โโโ models/ # โโโ Pydantic v2 Data Models โโโ
โ โ โโโ __init__.py โ model exports
โ โ โโโ request.py โ AnalysisRequest + Patient, Genetics, Labs, Lifestyle, Regimen
โ โ โโโ response.py โ AnalysisResponse + OrganScore, DDIFlag, Trajectory, Recommendation
โ โ
โ โโโ routers/ # โโโ API Endpoints (11 routers) โโโ
โ โ โโโ __init__.py โ router exports
โ โ โโโ users.py โ register, login, GET/PATCH /me, change-password
โ โ โโโ analysis.py โ POST /analysis/run โ main inference endpoint
โ โ โโโ export.py โ GET /export/clinical-pdf โ authenticated PDF download
โ โ โโโ extraction.py โ POST /extraction/parse-labs โ Gemini Vision lab OCR
โ โ โโโ notifications.py โ GET/PATCH /notifications
โ โ โโโ history.py โ trajectory history persistence
โ โ โโโ chat.py โ conversational AI endpoint
โ โ โโโ labs.py โ lab data management
โ โ โโโ billing.py โ billing/subscription (Pro features)
โ โ โโโ wearables.py โ Oura Ring / wearable sync endpoints
โ โ โโโ health.py โ health check endpoint
โ โ
โ โโโ data/ # โโโ Static Reference Data โโโ
โ โ โโโ snp_pgx_map.json โ rsID โ star-allele โ metabolizer phenotype map (CPIC)
โ โ โโโ mock_response.json โ fallback response for dev/demo mode
โ โ
โ โโโ tests/ # โโโ Test Suite โโโ
โ โโโ __init__.py
โ โโโ test_engine.py โ scoring engine unit tests (17K)
โ
โโโ frontend/ # โโโ React 19 + TypeScript SPA โโโ
โ โโโ index.html โ HTML entrypoint
โ โโโ package.json โ npm dependencies and scripts
โ โโโ vite.config.ts โ Vite build configuration
โ โโโ tsconfig.json โ TypeScript configuration
โ โโโ eslint.config.js โ ESLint rules
โ โโโ Dockerfile โ frontend container image
โ โ
โ โโโ src/
โ โโโ main.tsx โ React DOM render entry
โ โโโ App.tsx โ router, SmartHome redirect, protected routes, header
โ โโโ App.css โ global application styles
โ โโโ index.css โ base CSS reset and tokens
โ โโโ types.ts โ full TypeScript type definitions (8K)
โ โ
โ โโโ pages/ # โโโ Page Components โโโ
โ โ โโโ Landing.tsx โ auth-aware landing page with hero + CTA
โ โ โโโ Login.tsx โ login form โ JWT token
โ โ โโโ Register.tsx โ registration (email + name + password)
โ โ โโโ Wizard.tsx โ 9-step onboarding orchestrator
โ โ โโโ Dashboard.tsx โ full analysis dashboard (14 widgets)
โ โ โโโ Demo.tsx โ "Priya Demo" โ pre-filled canonical test case (26K)
โ โ โโโ ProfileSettings.tsx โ user profile, password, data export, reset
โ โ
โ โโโ components/
โ โ โโโ wizard/ # โโโ 13 Wizard Step Components โโโ
โ โ โ โโโ Step1Demographics.tsx
โ โ โ โโโ Step2Conditions.tsx
โ โ โ โโโ Step2Genetics.tsx
โ โ โ โโโ Step3GeneticUpload.tsx โ 23andMe .txt file parser
โ โ โ โโโ Step3Lifestyle.tsx
โ โ โ โโโ Step3Diet.tsx
โ โ โ โโโ Step4GeneticManual.tsx
โ โ โ โโโ Step4Regimen.tsx
โ โ โ โโโ Step5LabUpload.tsx โ Gemini Vision OCR for lab reports
โ โ โ โโโ Step5Labs.tsx
โ โ โ โโโ Step6Lifestyle.tsx โ deep lifestyle intake (15K)
โ โ โ โโโ Step6Confirm.tsx
โ โ โ โโโ Step8Regimen.tsx โ compound entry with search (13K)
โ โ โ
โ โ โโโ dashboard/ # โโโ 14 Dashboard Widgets โโโ
โ โ โ โโโ OrganScorecard.tsx โ 4-organ score cards with risk colours
โ โ โ โโโ TrajectoryChart.tsx โ 5-year baseline vs optimised (Recharts)
โ โ โ โโโ MultiTimeframeChart.tsx โ extended projection chart (10K)
โ โ โ โโโ BiologicalAgeWidget.tsx โ bio age display with delta
โ โ โ โโโ RiskSummaryCard.tsx โ headline risk summary
โ โ โ โโโ RecommendationFeed.tsx โ Gemini AI recommendation cards
โ โ โ โโโ CompoundCart.tsx โ current regimen display
โ โ โ โโโ CompoundContributions.tsx โ per-compound load breakdown
โ โ โ โโโ PathwayChainPanel.tsx โ drugโgeneโpathway chain viz
โ โ โ โโโ GuidelinePanel.tsx โ CPIC/AHA/WHO guideline refs
โ โ โ โโโ CircadianPanel.tsx โ circadian/sleep analysis
โ โ โ โโโ ClinicianExportButton.tsx โ PDF download button
โ โ โ โโโ PaywallOverlay.tsx โ Pro feature paywall
โ โ โ โโโ ProgressChart.tsx โ health progress tracking
โ โ โ
โ โ โโโ notifications/ # โโโ Notification System โโโ
โ โ โ โโโ NotificationBell.tsx โ bell icon + unread badge + dropdown
โ โ โ
โ โ โโโ chat/ # โโโ AI Chat Interface โโโ
โ โ โโโ (chat components)
โ โ
โ โโโ store/ # โโโ Zustand State Stores โโโ
โ โ โโโ wizardStore.ts โ full patient + analysis state (persisted)
โ โ โโโ authStore.ts โ JWT token + user session
โ โ โโโ notificationStore.ts โ notification state + unread count
โ โ
โ โโโ api/ # โโโ API Layer โโโ
โ โโโ analysis.ts โ analysis API hooks
โ โโโ mock_response.json โ client-side fallback for offline/demo
โ
โโโ docs/ # โโโ Documentation โโโ
โโโ GNN_README.md โ full GNN documentation (760 lines, 37K)
โโโ Eirion-ET.pdf โ hackathon submission PDF (1.1 MB)
โโโ Eirion_highlvl_doc.docx โ high-level project documentation
โ
โโโ images/
โ โโโ Banner_Eirion.png โ project banner (1.8 MB)
โ โโโ ARCHITECTURE.png โ system architecture diagram (561 KB)
โ โโโ FULL_PROCESS.png โ end-to-end data flow diagram (738 KB)
โ โโโ GNN_Architecture.png โ GATv2 model architecture diagram (1.1 MB)
โ
โโโ videos/
โโโ eirion_platform_demo.mp4 โ full platform demo video (18 MB)
| Component | Files | Lines of Code (est.) | Key Highlights |
|---|---|---|---|
| Backend Engine | 10 | ~3,500 | scorer.py (887 lines), pdf_generator.py (1,200+ lines) |
| Backend Routers | 12 | ~1,000 | 11 API routers covering all platform features |
| Backend Models | 3 | ~400 | Pydantic v2 request/response models |
| Backend Tests | 2 | ~400 | Scoring engine unit tests |
| Backend Planned | 8 | ~2,000 | Phase 2/3 modules (designed, not live) |
| Frontend Pages | 7 | ~1,800 | Demo.tsx (26K โ full demo scenario) |
| Frontend Wizard | 13 | ~2,800 | 9-step onboarding flow |
| Frontend Dashboard | 14 | ~1,700 | 14 interactive dashboard widgets |
| Frontend State | 3 | ~300 | Zustand persisted stores |
| Documentation | 3 | ~800 | GNN_README.md (760 lines) |
| Total | ~97 | ~14,700 | โ |
| Requirement | Version |
|---|---|
| Python | 3.10+ |
| Node.js | 20+ |
| npm | 10+ |
| Gemini API Key | Get from Google AI Studio |
git clone https://github.com/Ajayace03/Eirion.git
cd eirion
cp .env.example .env
# Edit .env โ set GEMINI_API_KEY (required)
# Optionally set JWT_SECRET for productioncd backend
# Create virtual environment
python -m venv .venv
# Activate (Linux/macOS)
source .venv/bin/activate
# Activate (Windows)
.\.venv\Scripts\Activate.ps1
# Install dependencies
pip install -r requirements.txt
# Generate Prisma client and create database
prisma generate --schema=schema.prisma
prisma db push --schema=schema.prisma
# Start API server
uvicorn main:app --reload --host 0.0.0.0 --port 8000๐ข API available at:
http://localhost:8000
๐ Interactive docs:http://localhost:8000/docs
cd frontend
npm install
npm run dev๐ข App available at:
http://localhost:5173
cp .env.example .env # set GEMINI_API_KEY
docker compose up --build| Service | URL |
|---|---|
| ๐ Frontend | http://localhost:5173 |
| โก Backend API | http://localhost:8000 |
| ๐ API Docs (Swagger) | http://localhost:8000/docs |
Create .env in the eirion/ root (shared by both backend and frontend):
# โโโ Required โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GEMINI_API_KEY=your_google_gemini_api_key_here
# โโโ Backend โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
DATABASE_URL=file:./dev.db
JWT_SECRET=change_this_to_a_random_256bit_secret # Generate: python -c "import secrets; print(secrets.token_hex(32))"
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
# โโโ Frontend (Vite) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
VITE_API_URL=http://localhost:8000- Register at
/registerโ create an account with email, name, and password - Click "Start Your Analysis" โ launches the 9-step onboarding wizard
- Step 1โ2: Enter demographics and pre-existing conditions
- Step 3: Upload a 23andMe
.txtfile for automatic CYP phenotype inference - Step 4: Or manually enter genetic metabolizer statuses
- Step 5: Upload lab report image (Gemini Vision OCR) or enter values manually
- Step 6โ7: Complete lifestyle and diet questionnaires
- Step 8: Enter your full supplement/medication stack with doses
- Step 9: Confirm and hit "Generate Blueprint"
- Explore the dashboard: organ scores, trajectory chart, DDI flags, Gemini recommendations
- Download your Clinical PDF Report from the dashboard header
๐ฏ Quick Demo: Click "Try Priya Demo" on the landing page to instantly see a fully populated analysis without entering any data.
All protected endpoints require a Bearer token in the Authorization header:
Authorization: Bearer <JWT_TOKEN>
| Method | Path | Auth | Description |
|---|---|---|---|
POST |
/users/register |
โ | Register new account (email, full_name, password) |
POST |
/users/login |
โ | Login โ returns JWT token |
GET |
/users/me |
โ | Get current user profile + attributes |
PATCH |
/users/me |
โ | Update profile (full_name) |
POST |
/users/change-password |
โ | Change password (requires current password, bcrypt) |
| Method | Path | Auth | Description |
|---|---|---|---|
POST |
/analysis/run |
โ | Main inference โ runs full multi-organ scoring pipeline |
POST |
/extraction/parse-labs |
โ | Gemini Vision lab report OCR (image โ structured values) |
GET |
/export/clinical-pdf |
โ | Download 9-page clinical PDF report |
| Method | Path | Auth | Description |
|---|---|---|---|
GET |
/notifications |
โ | Get notification list with unread status |
PATCH |
/notifications/{id}/read |
โ | Mark notification as read |
GET |
/history |
โ | Get trajectory history (past analyses) |
POST |
/chat/message |
โ | Send message to Gemini AI chat |
GET |
/labs |
โ | Get stored lab values |
GET |
/wearables/sync |
โ | Trigger wearable data sync |
GET |
/billing/status |
โ | Get subscription status |
GET |
/health |
โ | Health check (returns service status) |
curl -X POST http://localhost:8000/analysis/run \
-H "Authorization: Bearer <JWT>" \
-H "Content-Type: application/json" \
-d '{
"patient": {
"age": 35,
"sex": "female",
"weight_kg": 65,
"height_cm": 168,
"ethnicity": "south_asian"
},
"genetics": {
"cyp2d6_metabolizer": "poor",
"cyp2c19_metabolizer": "intermediate",
"cyp3a4_metabolizer": "normal",
"cyp2c9_metabolizer": "normal",
"cyp1a2_metabolizer": "unknown",
"slco1b1_function": "reduced",
"mthfr_c677t": "heterozygous"
},
"conditions": [
{"condition_id": "hyperlipidemia"}
],
"lifestyle": {
"sleep_hours_avg": 6.5,
"stress_level": 7,
"alcohol_drinks_per_week": 5,
"exercise_mins_per_week": 90,
"sugar_g_per_day": 120,
"smoking_status": "never",
"environmental_toxin_exposure": 3,
"processed_food_frequency": 5
},
"regimen": [
{"compound_id": "atorvastatin", "dose_mg": 20, "frequency_per_day": 1, "is_rx": true},
{"compound_id": "ashwagandha", "dose_mg": 600, "frequency_per_day": 1},
{"compound_id": "vitamin_d", "dose_mg": 2000, "frequency_per_day": 1},
{"compound_id": "omega_3", "dose_mg": 2000, "frequency_per_day": 1}
]
}'{
"risk_summary": {
"risk_level": "amber",
"liver_index_now": 67.5,
"projected_drop_percent": 12.3,
"headline": "Moderate liver stress detected โ index 68/100. Projected to decline ~12% by year 5."
},
"organ_scores": [
{"organ": "liver", "score": 67.5, "risk_level": "amber", "top_driver": "Atorvastatin"},
{"organ": "kidney", "score": 82.1, "risk_level": "green", "top_driver": "Lifestyle"},
{"organ": "cardiovascular", "score": 71.3, "risk_level": "amber", "top_driver": "High Stress"},
{"organ": "metabolic", "score": 74.8, "risk_level": "amber", "top_driver": "High Sugar Diet"}
],
"biological_age": 39.8,
"ddi_flags": [
{
"compound_a": "atorvastatin",
"compound_b": "ashwagandha",
"severity": "moderate",
"mechanism": "CYP3A4 competitive inhibition increases statin exposure"
}
],
"trajectory": [
{"year": 0, "liver_index": 67.5, "optimized_liver_index": 67.5},
{"year": 5, "liver_index": 59.2, "optimized_liver_index": 72.1}
],
"recommendations": [
{
"action_type": "swap",
"title": "Replace Ashwagandha with Rhodiola Rosea",
"details": "Your CYP2D6 poor-metabolizer status increases ashwagandha hepatic load by 40%..."
}
]
}The backend uses SQLite via Prisma with three models:
model User {
id String @id @default(cuid())
email String @unique
full_name String
hashed_password String
onboarding_complete Boolean @default(false)
is_pro Boolean @default(false)
oura_token String?
created_at DateTime @default(now())
attributes UserAttributes?
history TrajectoryHistory[]
}
model UserAttributes {
id String @id @default(cuid())
user_id String @unique
age Int
sex String
weight_kg Float
height_cm Float?
ethnicity String?
cyp2d6_metabolizer String @default("unknown")
cyp2c19_metabolizer String @default("unknown")
}
model TrajectoryHistory {
id String @id @default(cuid())
user_id String
score Int
snapshot String // JSON string of AnalysisResponse
created_at DateTime @default(now())
}| Source | Use in EIRION | Records | License |
|---|---|---|---|
| Tox21 qHTS | GNN training: 13 bioassay toxicity labels | 12,505 compounds | Public domain (US Gov) |
| PharmGKB | Drugโgene relationships, CYP star-alleles, InChIKey bridge | 21,936 compound-gene edges | CC BY-SA 4.0 |
| CPIC Guidelines | CYP phenotype โ clinical action mapping | 572 drug-gene pairs | CC BY 4.0 |
| Reactome | Geneโpathway edges for GNN knowledge graph | 48,593 gene-pathway edges (2,848 pathways) | CC BY 4.0 |
| RDKit | SMILES โ Morgan fingerprints (1024-bit, radius=2) | โ | BSD 3-Clause |
| Google Gemini | Clinical recommendation generation + Lab OCR | โ | API ToS |
- 9-step PGx onboarding wizard with 23andMe upload
- CYP450-adjusted hepatic scoring engine (7 CYP enzymes)
- GATv2 GNN DDI polypharmacy model (1.29M params, 0.76 AUC)
- Multi-organ trajectory (liver, kidney, CVD, metabolic)
- Gemini 2.5 Flash enriched recommendations
- Gemini Vision lab report OCR
- 9-page ReportLab clinical PDF export
- User auth (JWT + SQLite + Prisma), profile settings
- Notification centre with unread badge
- AI chat endpoint
- Docker Compose full-stack deployment
- Comprehensive documentation (README + GNN_README)
- FHIR R4 EHR integration (Epic, Cerner) โ see
planned/wearable_fhir_integration.py - Oura / Apple Health wearable sync โ live readiness scores via OAuth
- GNN v2.0: CTD + ChEMBL expansion (50%+ compound-gene coverage)
- CTD chemical-gene linkage via PubChem CAS numbers
- ChEMBL bioactivity data (pChEMBL โฅ 5)
- Tanimoto structural similarity inference for unlinked compounds
- Node2Vec gene embeddings (replace one-hot)
- Edge feature encoding (PK/PD flags, CPIC level, evidence source)
- Temporal Fusion Transformer for 10-year multi-organ forecasting โ see
planned/tft_forecasting.py - RL regimen optimiser (SAC/PPO) for supplement redesign โ see
planned/rl_regimen_optimizer.py - Advanced biological age tracking โ see
planned/bio_age_tracker.py - D-MPNN molecular encoder โ see
planned/dmpnn_toxicity.py - Clinician dashboard + B2B API
- FDA SaMD (Software as Medical Device) regulatory preparation
- IRB-approved clinical trial integration
- Pharmacist in-the-loop review workflow
- Multi-drug interaction modelling (DrugBank DDI dataset)
- Attention-based explainability dashboard (GATv2 attention weights โ clinical rationale)
๐ฌ This is a Phase 0 hackathon prototype. It is NOT a medical device.
| Limitation | Detail | Mitigation |
|---|---|---|
| GNN compound-gene coverage | 6.1% via PharmGKB (758/12,505 compounds) | v2.0 targets 50%+ via CTD + ChEMBL expansion |
| Deterministic scoring | Organ scores use rule-based models, not validated clinical models | Gemini enrichment adds clinical context; future versions use ML throughout |
| Clinician review required | All recommendations require professional review before action | Disclaimer shown in app and PDF report |
| PDF not FDA-cleared | Clinical PDF is informational only | Phase 3 targets SaMD regulatory pathway |
| Wearable sync stub | Architecture-complete but uses mock data | Pending OAuth token integration for Oura/Apple Health |
| No stereochemistry | Morgan FP (radius=2) doesn't capture enantiomer differences | v2.0 considers D-MPNN molecular encoder |
| CPU-only tested | GNN trained and deployed on CPU | CUDA/MPS should work with no code changes |
- Brody, S., Alon, U., and Yahav, E. (2021). How attentive are graph attention networks? arXiv:2105.14491
- Veliฤkoviฤ, P., Cucurull, G., Casanova, A., Romero, A., Liรฒ, P., and Bengio, Y. (2018). Graph attention networks. ICLR 2018
- Yang, K., Swanson, K., Jin, W. et al. (2019). Analyzing learned molecular representations for property prediction. JCIM 59(8), 3370โ3388
- Zitnik, M., Agrawal, M., and Leskovec, J. (2018). Modeling polypharmacy side effects with graph convolutional networks. Bioinformatics 34(13), i457โi466
- CPIC Consortium. (2024). Clinical Pharmacogenomics Implementation Consortium guidelines. https://cpicpgx.org
- Davis, A. P. et al. (2023). Comparative Toxicogenomics Database (CTD): Update 2023. NAR 51(D1), D1257โD1262
- Huang, R. et al. (2011). Chemical genomics profiling of environmental chemical modulation of human nuclear receptors. EHP 119(8), 1142โ1148
- Fey, M. and Lenssen, J. E. (2019). Fast graph representation learning with PyTorch Geometric. ICLR Workshop
- Rogers, D. and Hahn, M. (2010). Extended-connectivity fingerprints. JCIM 50(5), 742โ754
MIT โ see LICENSE



