Inspiration

Every time you see a new doctor, you're handed a clipboard and asked to recall your entire medical history from memory. You forget medications, can't remember dates, and miss important details. Doctors end up making decisions with incomplete information.

We wanted to fix that not with another form, but with a conversation.

What it does

Sage is an AI-powered health passport that lives on your phone.

You chat with it naturally "I take Metformin for diabetes and I'm allergic to penicillin" and it automatically builds a structured health profile. It can also scan prescription bottles with your camera and extract the information.

When you see a doctor, you can instantly share your full history as:

  • a PDF, or
  • a QR code they scan on the spot

Every time you add a medication, Sage checks the FDA database for:

  • drug interactions
  • safety warnings
  • allergy conflicts

All in real time.

How we built it

Sage is a two-part system:

Mobile app

  • Built with React Native + Expo
  • All health data stored locally in on-device SQLite
  • Nothing leaves your phone unless you explicitly share it

Backend (Vercel serverless)

  • AI proxy → sends messages to Claude (claude-opus-4-6), returns structured JSON written directly to the database
  • Share service → generates temporary passport links using Upstash Redis (24-hour expiry)

Safety layer

  • Uses the OpenFDA API
  • Runs checks in parallel for:

    • drug interactions
    • warnings
    • allergy contraindications

Challenges we ran into

  • Reliable structured output from Claude We needed strict JSON, not prose. Built a parser that handles:

    • clean JSON
    • JSON inside markdown fences
    • plain text fallback
  • Stale state bug in React Callbacks captured outdated conversation history. Fixed using a ref that stays synced with state, ref feeds Claude, state renders UI.

  • Secure architecture vs speed Keeping API keys off-device while maintaining a fast, seamless experience required careful proxy design.

Accomplishments that we're proud of

  • Real-time medication safety checks Adding a drug and instantly seeing FDA warnings makes it feel like a real medical tool.

  • Privacy-first design

    • Data stays on-device by default
    • Shared data expires in 24 hours
  • Full product in 48 hours (2 people) AI chat, camera OCR, PDF export, QR sharing, dark mode — all working end-to-end.

What we learned

  • Prompt engineering is real engineering Designing a system prompt that enforces a strict JSON schema took more iteration than any feature.

  • Structured AI changes everything The model isn’t just responding — it’s writing to your database. It becomes part of the data pipeline, not just the UI.

What's next for Sage

Short term

  • Encrypted local database
  • Authentication + secure access
  • Health timeline visualization
  • Medication reminders

Long term

  • A universal health passport
  • One QR code any healthcare provider can scan to instantly understand your medical history and treat you safely

Built With

Share this project:

Updates