Back to projects

Vitality AI

Vitality AI is an advanced, decoupled Health and Fitness ecosystem designed to provide clinical-grade, fact-checked, and highly personalized health insights. It utilizes a sophisticated dual-agent architecture, live medical journal citations (RAG), and a permanent clinical memory store.

ReactNode.jsPythonFastAPIGroq
Dual-Agent Medical Triage
Live PubMed Citations
Persistent Clinical Memory
PII Data Scrubbing
Vitality AI preview

The Challenge

The digital health market is saturated with generic AI chatbots that lack true medical safety guardrails, contextual memory, and verifiable sources. Users often receive hallucinated nutritional facts or unsafe medical advice. The goal was to engineer a solution that addressed these critical flaws by providing:

  • Uncompromised Safety: Real-time evaluation of AI outputs to prevent dangerous medical advice.
  • Contextual Awareness: Long-term memory of the user's specific health trajectory (e.g., past lab results, weight tracking).
  • Verifiable Truth: Answers backed by actual clinical studies and live nutritional databases, rather than LLM approximations.
  • Data Privacy: Strict Zero-Data-Retention compliance for external LLM calls.

The Solution

I architected and developed a robust, decoupled three-tier microservice application that separates the user interface, data privacy layer, and AI intelligence.

  • Dual-Agent Medical Triage: Every response generated by the primary LLM is secretly intercepted by an "Evaluator LLM" to screen for extreme calorie deficits or medical emergencies, triggering an EMERGENCY_TRIAGE protocol if needed.
  • Persistent Clinical Memory: The Node.js backend actively queries the user's historical SQLite data (weight logs, past lab results) and dynamically injects this clinical context into the agent's prompt during every interaction.
  • Live Fact-Checking & RAG Implementation: The Python agent queries the PubMed API to retrieve peer-reviewed clinical studies and the USDA FoodData Central API for live, accurate nutritional facts, generating responses with explicit citations.
  • PII Scrubbing & Privacy: The Node.js proxy dynamically scrubs Personally Identifiable Information (PII) before any user context is sent to the external Python AI engine, guaranteeing no sensitive user data is exposed.
  • Rich, Action-Driven UI: The React frontend parses specific actionType flags to render native components dynamically, such as Red Medical Sirens, Green Nutritional Fact Sheets, and Blue PubMed Citations.

Architecture & Tech Stack

The platform is decoupled into three distinct microservices, ensuring high scalability and a clean separation of concerns.

  • Frontend (User Interface): React 19, Vite, TypeScript, Tailwind CSS v4, shadcn UI, Framer Motion, Recharts. Handles the rich, interactive AI Copilot interface and visualizes data.
  • Backend (API Proxy & Database): Node.js, Express, TypeScript, SQLite, bcryptjs, JWT. Acts as the secure middle layer, manages sessions, stores clinical data, performs PII scrubbing.
  • AI Engine ("The Brain"): Python, FastAPI, Groq (Llama-3 models), ChromaDB. Integrates with USDA API and PubMed API. Houses Dual-Agent logic and performs real-time fact-checking.

Key Takeaways & Impact

Building Vitality AI demonstrated my ability to architect complex, AI-driven applications that prioritize user safety and data integrity.

By moving away from monolithic architectures and embracing microservices, I ensured that the heavy AI processing (Python) didn't bottleneck the secure data routing (Node.js) or the snappy user experience (React).

This project successfully bridges the gap between generic AI wrappers and true, clinical-grade health assistants, proving that with the right architecture (Dual-Agents, RAG, and strict data scrubbing), AI can be safely deployed in the sensitive health sector.