This is a submission for Weekend Challenge: Passion Edition
What I Built
Chronic Disease Copilot is a privacy-first, voice-enabled AI health companion that helps people managing chronic conditions stay on top of daily symptom tracking, lab results, medication interactions, and doctor-visit prep β without ever feeling surveilled by their own health app.
The core idea that shaped every decision: your health data should never have to leave your machine to be understood. The assistant runs its AI analysis entirely locally via Ollama, and includes a one-tap Zero Retention Mode β when it's on, nothing touches the database. It's processed in memory and gone the moment the response is delivered.
Key Features
ποΈ Voice-activated symptom logger β speak your symptoms naturally; a local model classifies severity and flags concerning patterns in real time, no typing required on a day you don't have the energy to type.
π Zero Retention Mode (HIPAA-conscious design) β a runtime toggle, not a fixed setting. Flip it on right before logging something sensitive, flip it off for routine tracking you're fine persisting. Full on-device processing, zero persistent storage while active.
π§ͺ Smart lab results & interaction checker β plain-language lab explanations (no more Googling "what does elevated ALT mean" at 11pm), local drug-interaction checks, and trend tracking that surfaces the story in the numbers β e.g., "HbA1c improved by 11% over the last quarter."
π Appointment prep coach β auto-generated pre-visit summaries, personalized question prompts pulled from recent logs, and a shareable, clinician-ready brief so the patient walks in with the conversation already half-written.
π£οΈ Conversational daily check-in β instead of a static form, a guided voice conversation walks through mood, medication adherence, symptoms, and vitals one question at a time, extracting structured data from each free-text answer.
πͺͺ Record-grade patient profile & audit trail β ICD-10-coded conditions, allergy severity, family history, and a care-team list with per-provider access-expiry dates, gated behind MFA and voice-biometric enrollment, with a visible access log so the patient always knows who has touched their data.
Demo
Code
π©Ί Chronic Disease Copilot
An intelligent, privacy-first AI health assistant designed for chronic condition management.
Features β’ Architecture β’ Installation β’ Usage β’ Contributing
π About the Project
Managing a chronic disease requires continuous monitoring, which can be overwhelming. The Chronic Disease Copilot is a 24/7 personal health companion built to alleviate this burden.
It seamlessly blends ElevenLabs for natural, empathetic voice interactions with Ollama for entirely localized, private AI health analysis. Built with absolute privacy in mind, it features a Zero Retention Mode for HIPAA-compliant operations, ensuring that your sensitive health data is analyzed without ever being stored persistently.
β¨ Key Features
ποΈ Voice-Activated Symptom Logger
- Natural Interaction: Log your daily symptoms naturally using just your voice.
- Local AI Analysis: Ollama analyzes speech to classify severity and detect alarming patterns.
- Empathetic Feedback: Receive human-like audio feedback powered by ElevenLabs.
π Zero Retention Mode (HIPAA Compliant)
- Ultimate Privacy: Toggle privacyβ¦
How I Built It
The app is a React frontend and a single Express backend, with all "intelligence" running through a local LLM instead of a cloud API β a deliberate architectural choice given the sensitivity of the data involved. That same Express app runs two ways: app.listen() locally against a real SQLite file, and as an exported handler behind a thin api/index.js for a Vercel serverless demo deployment β same routes, same logic, two runtimes.
Frontend: React 19 + Vite for a fast, responsive dashboard, styled with Tailwind CSS and React Router across nine screens β Dashboard, Symptom Logger, Lab Results, Medications, Interaction Checker, Appointment Prep, Daily Check-In, Patient Profile, and a conversational Copilot view. Framer Motion powers the micro-interactions (including a live AudioVisualizer during voice input) that make logging feel alive rather than clinical.
Privacy as a request-level contract, not a UI setting: the PrivacyToggle component ("Incognito" vs "Standard") sets an x-privacy-mode header on every outgoing request. Middleware on the backend reads that header and, route by route, skips the INSERT/UPDATE entirely β the AI analysis still runs and the response still comes back, but the write to disk simply never happens. It's enforced at the request layer, not trusted to a downstream policy.
Dual-database strategy: locally, better-sqlite3 in WAL mode persists medications, adherence logs, and symptoms. On Vercel's ephemeral serverless filesystem, the exact same db.prepare(...).run()/.all()/.get() call signatures are served by a hand-rolled in-memory MockDatabase class β so the demo deploys without a hosted database, and the privacy guarantee (nothing persists) is actually stronger in that environment, not weaker.
AI Inference: the crux of the build. Every AI feature calls a local Ollama instance directly over HTTP (/api/generate, model configurable via OLLAMA_MODEL, default qwen3.5) with format: json and a feature-specific system prompt that pins the model to a strict JSON schema β symptom analysis returns {analysis, severity, tags, followUp}, drug interactions return {status, data: {pair, severity, description, recommendation}}, appointment prep returns a full structured brief (summary, keyTopics, suggestedQuestions, recentSymptoms, medications, labResults, actionItems, voiceSummary). Constraining a smaller local model to schema instead of leaning on a frontier model's free-form reasoning took real prompt iteration, but it's what makes the outputs reliably renderable in the UI.
Graceful degradation by design: every single Ollama call is wrapped so that if the local model is unreachable, the API still returns a sensible, clearly-labeled fallback response instead of a broken UI β the app never hard-fails just because inference is offline.
Voice & Speech: ElevenLabs handles text-to-speech (with selectable voice profiles β empathetic-female, professional-female, calm-male) for natural audio responses, while the native Web Speech API handles speech-to-text client-side β keeping the voice loop low-latency with no audio needing to leave the device for transcription.
Patient identity, modeled like a real health record: the Patient Profile screen isn't a flat form β it carries ICD-10-coded conditions, allergy severity, family history, and a care-team list with per-provider access-expiry dates, backed by a login flow with simulated MFA and voice-biometric enrollment, plus a visible access-log audit trail so a patient can see exactly who touched their data and when.
Daily Check-In as a guided conversation: rather than a static form, /api/check-in/process walks the patient through mood β adherence β symptoms β vitals one turn at a time, with Ollama extracting structured data from each free-text answer and generating the next empathetic question β and a 7-day pattern-detection endpoint (/api/symptoms/patterns) that periodically re-scans recent symptom logs for trends worth flagging.
Challenges I Ran Into
Local models are not frontier models. Getting a smaller model to reliably return valid, renderable JSON for every feature β not just usually β took real iteration: tight per-feature system prompts, explicit schema definitions in every prompt, and a fallback response wired into every single AI call so a malformed or slow response degrades to a labeled placeholder instead of a broken screen. Balancing "sounds empathetic" against "stays clinically conservative" in the check-in and symptom-analysis prompts was a constant tuning act, not a one-time setting.
The other real challenge was deploying a "local-first" app to a public demo at all β Vercel's serverless functions have no persistent disk, so better-sqlite3 simply can't run there. Rather than fake the demo, I wrote a drop-in MockDatabase class that mirrors the exact prepare().run()/.all()/.get() interface, so the same route code runs unmodified against a real SQLite file locally and an ephemeral in-memory store on the hosted demo β which, incidentally, makes the hosted demo more private by default, since nothing survives past the request.
Accomplishments I'm Proud Of
Building something genuinely HIPAA-conscious by architecture, not by policy. Zero Retention Mode isn't a checkbox that trusts a backend team not to log your requests β an x-privacy-mode header is checked in middleware, and the code path that would write to disk is skipped entirely, route by route, while the AI response still returns normally. That's a meaningfully different, verifiable privacy guarantee than "we promise not to look" β a judge can read the route handlers and see the write simply isn't there.
I'm also proud of how far the "patient record" concept goes for a weekend build β ICD-10 codes, allergy severity, family history, care-team access windows, an access-log audit trail, and MFA/voice-biometric gating on login. It reads less like a demo and more like a first draft of something a real clinic could pilot.
What's Next
Expanding the local drug-interaction database beyond the current seed set
On-device fine-tuning so the model adapts to an individual's condition history over time β still never leaving the device
A caregiver-facing view (opt-in, still local-first) for people managing a chronic condition on behalf of a parent or child
Prize Categories
Best Use of ElevenLabs β ElevenLabs isn't decorative TTS bolted on at the end here; it's load-bearing for the accessibility goal of the whole app. The /api/voice/speak endpoint maps three distinct voice personas to ElevenLabs voice IDs β empathetic-female (Rachel), professional-female (Bella), and calm-male (Adam) β so the tone of the spoken response can match the moment: an empathetic voice reading back a symptom log feels different from a professional voice reading a clinician-ready appointment brief aloud. Every AI-generated response across the app (symptom analysis, lab explanations, appointment prep) carries a natural-language field specifically written to be spoken, not just displayed β the appointment-prep endpoint even returns a dedicated voiceSummary field distinct from its written summary. Paired with the Web Speech API for input, this makes the entire daily check-in flow β mood, adherence, symptoms, vitals β fully usable hands-free and screen-free, which matters directly for the target user: someone managing a chronic illness who may be fatigued, in pain, or have limited dexterity on a given day.
Built solo end-to-end β architecture, prompt design, and UI β as part of Team Inverse's ongoing work on privacy-first health and civic tech for underserved settings.
Top comments (0)