"Age better with evidence."
Built by @lerenaminy.
Traditional health reports are static and siloed. Users receive blood work (ApoB, HbA1c, etc.) but lack an integrated framework to translate numbers into action. AgeWell acts as a Clinical Reasoning Engine, mimicking the logic of a senior longevity physician by cross-referencing individual biometrics against the latest peer-reviewed literature.
The project utilizes a Decoupled Architecture to ensure high scalability and modular maintenance:
- LLM Engine: Gemini 2.5 Flash (State-of-the-art 2026 Reasoning Model)
- Embedding Model: BGE-M3 (Multi-lingual, 1024-dimensional vectors for high-precision semantic retrieval)
- Vector Store: FAISS (Facebook AI Similarity Search)
- Frontend: Streamlit (Custom clinical UI with professional styling)
- Structure: Modular separation of concerns between UI (
app.py) and Reasoning Engine (logic.py)
The AgeWell knowledge base is grounded in 45+ authoritative medical sources, categorized into eight critical domains:
- Metabolism: Insulin sensitivity, metabolic flexibility, and HbA1c management.
- Cardiovascular: Lipid profiles (ApoB/LDL), hypertension, and endothelial function.
- Fitness: VO2 Max mortality correlations and sarcopenia prevention through resistance training.
- Nutrition: Mediterranean protocols, Intermittent Fasting (TRF), and autophagy pathways.
- Recovery: Circadian rhythm optimization, sleep hygiene, and HRV (Heart Rate Variability).
- Biomarkers: Micronutrient density (Vitamin D/Omega-3) and chronic inflammation (CRP) monitoring.
- Neurology: Cognitive reserve, stress management (Cortisol), and neuroplasticity.
- Cellular Longevity: Biological age vs. chronological age, senescent cells, and mitochondrial health.
To ensure objective reasoning, the engine is embedded with five foundational clinical benchmarks:
- Body Composition: BMI ranges, body fat percentage standards, and Waist-to-Hip Ratio (WHR) predictors.
- Reference Ranges: Comprehensive Metabolic Panel (CMP) and lipid target values.
- Vitals: AHA/ACC Blood Pressure categories and resting heart rate (RHR) norms.
- Fitness Benchmarks: VO2 Max percentiles and grip strength standards for longevity.
- Optimal Zones: Defining optimal ranges for Vitamin D, B12, and Ferritin.
AgeWell is now a fully functional MCP Server. You can connect this repository to Claude Desktop or Cursor to use the AgeWell clinical database as a live tool within your AI workflow.
- Tool: query_longevity_expert
- Capability: Returns structured 5-step clinical reports based on 1,100+ verified data segments.
- Transport: Stdio-based connection for local security.
Designed to solve AI distraction. When critical outliers (e.g., BMI over 30) are detected, the system triggers a priority-weighting override, forcing the AI to address urgent SHIFT protocols before addressing missing or secondary lab data.
To maintain a clinical-grade user experience, I developed a multi-stage post-processing pipeline. It strips inconsistent AI formatting and injects sanitized HTML to ensure the professional report remains visually perfect.
Optimized retrieval using 800-character chunks with a 150-character overlap. This strategy ensures that clinical context and causal logic within medical documents remain intact during vectorization.
Follow these four steps to run AgeWell locally:
git clone https://github.com/yourusername/AgeWell.git
cd AgeWell
pip install -r requirements.txtCreate a file named .env in the root directory and add your API key:
GEMINI_API_KEY=your_actual_api_key_herePlace your medical documents in the /knowledge_base folder and run:
python build_index.pyRun the following command to start the web interface:
streamlit run app.pyThis tool is for educational and informational purposes only. It does not constitute medical advice, diagnosis, or treatment. Always seek the advice of a qualified healthcare professional before making health decisions based on information provided by AgeWell.
- Author: Wei Ting Chang
- Stack: Python, FAISS, Streamlit, Google Generative AI