Inspiration

Your health record is shattered across systems that never talk to each other. The EHR has your meds, the lab has your bloodwork, your watch has your vitals, and a stack of faxes has everything else. The most dangerous problems live in the gaps between those sources, where no one is looking.

We wanted to prove that with a real example. One of us exported his own Apple Health data, 1.1 million records over ~4 years and we asked a simple question: what would a clinician miss if they only looked at the chart? The answer was striking. His watch had recorded 37 overnight blood-oxygen readings below 90% and ~6 awakenings a night, while he quietly took an OTC antihistamine to sleep. Three separate records, each harmless alone. Together: an untreated sleep-disordered-breathing signal that exists in no clinical source on its own. That gap is ChartBridge.

What it does

ChartBridge pulls a patient's fragmented data into one normalized record and reconciles it:

  • Live FHIR - fetches a real patient bundle from the SMART Health IT R4 sandbox.
  • Real wearables - ingests an Apple Health export (resting HR, HRV, VO₂max, SpO₂, sleep, ECG) as a first-class vitals layer.
  • Gap detection - a deterministic engine flags reconciliation gaps: stale meds, overdue screening, perioperative allergy risks, and wearable-only signals the EHR never saw.
  • Grounded RAG — - clinic's unstructured records (faxes, referral letters, portal messages) are indexed in a xAI Collections vector database and retrieved to back every claim with a citation.
  • Actionable Reports - Grok writes two grounded reports from the same data: a clinician brief and a plain-English patient summary.
  • Voice intake - Grok Voice over a Twilio phone call collects answers to the open questions directly from the patient.
  • Autonomous pipeline - Inngest runs the whole flow (FHIR → gaps → RAG → report) as durable, retriable, observable steps.

How we built it

Next.js 16 / React 19 / TypeScript on Vercel. The data layer normalizes FHIR + Apple Health into one bundle; gap detection and report generation are pure functions over it, so the demo works even with zero API keys (graceful degradation to a deterministic report and lexical search). xAI's grok-4.3 writes the reports; xAI Collections (grok-embedding-small) does the embeddings and hybrid search server-side. A custom Node server bridges Twilio's media stream to Grok Voice over WebSockets, and Inngest orchestrates the autonomous pipeline.

Challenges we ran into

  • No free vector DB. We discovered xAI Collections ships its own server-side embeddings - so we rebuilt RAG on it and dropped the turbopuffer dependency entirely.
  • One million records. The Apple Health export is a 504 MB XML file; we stream-parse it into a compact, demo-ready summary of trends and signals.
  • Making it cohesive. Fusing real wearable vitals with a clinical record so the gaps line up across sources took real clinical grounding (we checked USPSTF screening rules so the "overdue labs" gap is actually defensible for a 30-year-old).
  • Real-time voice. Next.js App Router can't do raw WebSocket upgrades, so we wrote a custom server to bridge Twilio ↔ Grok Voice.

What we learned

The real value was not just in xAI's model. It came from bringing together fragmented clinical data and identifying connections across systems. The most impactful insights were almost always found at those intersections. We also learned how far a consolidated technology stack could take us, handling everything from analysis to voice interactions within a single platform.

What's next

AI dispensed medicines with option for healthcare professionals to step in. EHR write-back, multi-patient cohorts.

Built With

Share this project:

Updates