Inspiration

Community health workers, home-visit nurses, and accessibility coordinators constantly record sensitive intake notes in rural homes, hospital basements, and transit corridors where connectivity drops without warning and sending raw personal identifiers (SSNs, MRNs, dates of birth, phone numbers) to cloud endpoints is unacceptable. Hybrid AI solves both constraints together: fast, zero-cost local inference on the device in your hand when offline or handling raw identifiers, paired with PII-redacted Gemini cloud synthesis when deeper clinical formatting is needed.

What it does

FieldScribe Local transforms unstructured voice or typed field notes into structured triage plans, urgency classifications, vital-sign observations, and accessibility accommodations (step-free wheelchair access, certified ASL interpretation, high-contrast large-print packets, low-stimulation sensory rooms):

  • Local-First Execution (0 B Cloud Egress): Uses InferenceMode.PREFER_ON_DEVICE and InferenceMode.ONLY_ON_DEVICE to run on Chrome's built-in Gemini Nano (LanguageModel API) on Web, Apple FoundationModels (LanguageModelSession) on iOS, or a deterministic local clinical engine when offline.
  • Dual Client + Edge PII Airlock: Before any note escalates to HYBRID_CLOUD_SYNTHESIS, an on-device scrubber masks SSNs, medical/case IDs, dates of birth, phone numbers, and emails into color-coded tokens ([REDACTED-*]), displaying a live byte-exact egress receipt in the top bar. Judges can test live Gemini 3.1 Flash Lite cloud synthesis in one click with zero API key setup via our origin-locked edge gateway, which also enforces server-side raw-SSN rejection.
  • Interoperable HL7 FHIR R4 Export & Voice Dictation: Includes live on-device voice dictation with an acoustic waveform monitor, Daylight / Night Shift themes for dim hospital corridors, one-tap Airplane Mode verification, and one-click export to HL7 FHIR R4 Bundle JSON (Communication, Flag, and Observation resources) or Care Handoff Markdown.

How we built it

  • Web PWA (web/): Zero-dependency ES module architecture (hybrid-router.mjs) integrating firebase/ai (getAI, GoogleAIBackend, getGenerativeModel, InferenceMode.PREFER_ON_DEVICE) alongside direct W3C LanguageModel capability probing and an origin-locked Cloudflare Worker gateway (gemini-3.1-flash-lite), wrapped in a 100dvh zero-scroll responsive interface verified across 5 mobile, tablet, and desktop viewports.
  • Native Swift 6 iOS (ios/): Actor-isolated FieldScribeKit + FieldScribeApp pairing Apple FoundationModels (#if canImport(FoundationModels)) with FirebaseAILogic + FirebaseAppCheck (AppAttestProvider), Siri / Action Button AppIntents, a Lock Screen WidgetKit extension, and a multi-layer .icon bundle.

Challenges we ran into

Not every judge's browser has pre-downloaded multi-gigabyte Gemini Nano weights or configured a personal Firebase project before opening a hackathon demo URL. We engineered a seamless three-tier cascade (on-device Gemini Nano -> sub-millisecond deterministic local clinical engine -> zero-setup PII-redacted Gemini 3.1 Flash Lite gateway + optional custom Firebase AI Logic project keys) so every mode works instantaneously on the very first click.

Accomplishments that we're proud of

  • True multi-platform architecture spanning Web PWA and Native Swift 6 / SwiftUI iOS (FoundationModels, WidgetKit, AppIntents).
  • Verifiable byte-level privacy telemetry (0 B Cloud Egress locally; ~200 B redacted-only payload in hybrid cloud mode).
  • Clinical interoperability out of the box via HL7 FHIR R4 Bundle JSON export alongside human-readable Care Handoff Markdown.

What we learned

Enforcing a strict local PII boundary before Firebase AI Logic inference changes both architecture and UX: showing field workers live redacted token pills and exact byte counts turns privacy from an invisible promise into an auditable workflow.

What's next for FieldScribe Local

Adding offline WebGPU Whisper multilingual speech transcription for Spanish, Mandarin, and Arabic home visits, plus direct SMART-on-FHIR EHR sandbox sync for community health nonprofits.

Sorry I couldn’t add captions to the images, wasn’t working from my device.

Built With

Share this project:

Updates

Submission history