Inspiration
Across India, mobile connectivity has reached hundreds of millions of rural and elderly people far faster than reading literacy. UNESCO’s EFA Global Monitoring Report counts 287 million non-literate adults in India, and NFHS-5 (2019–21) found that only 33% of Indian women had ever used the internet. Yet a routine clinic visit still begins with an English paper form or a rushed two-minute summary at the reception desk—where crucial details like symptom onset, severity, and prior medications easily get lost before the doctor even walks in.
We built Sancho to give patients who cannot read or type a voice-first clinic front desk. It captures their symptoms in their own words while keeping a human clinician firmly in control.
What it does
Sancho is a voice-first clinical intake and medicine companion that turns spoken symptoms into an evidence-linked clinician brief:
- Zero-Typing Patient Intake: A patient taps Consult Sancho, chooses a language (Hindi and English are fully wired; Tamil and Arabic are in the registry), and grants separate, explicit consent for microphone, camera, and doctor sharing.
- Offline-First & Deterministic Safety: Across three illness pathways (each with 7 spoken or 5 button-based questions), every answer runs through local, deterministic red-flag rules (
packages/core). Mentioning chest pain or breathlessness immediately triggers an offline emergency screen with a one-taptel:112button—no AI model call or internet connection required, and Sancho never auto-dials without user action. - Encrypted On-Device Capture: Audio chunks and responses are encrypted locally in IndexedDB (via Web Crypto AES-GCM) and sync reliably once connectivity returns.
- Clinician Review & Approval Gate: Doctors review a 15-second brief where every extracted fact links back to the original audio clip and exact transcript span. The clinician confirms, edits, or rejects each point, then completes a two-step, server-enforced prescription sign-off backed by an append-only audit trail.
- Approved Reminders & FHIR R4 Export: Only clinician-approved instructions unlock spoken medicine reminders (Taken, Snooze, or Skip) and export cleanly as an HL7 FHIR R4 document Bundle.
- One-Command Reproducibility: The entire stack boots with
docker compose up --buildon port 4000—requiring zero API keys and no.envfile, shipping at 180 KiB gzipped for the initial route, and backed by 610 passing tests.
How we built it
We built Sancho in Kiro using a spec-driven development workflow inside an npm-workspaces monorepo (apps/web in React 19 + Vite + Tailwind 4, apps/api in Hono on Node, and packages/core in strict TypeScript):
- Spec-Driven Development (
.kiro/specs/): Before writing application code, we authored 12 progressive specs (01-foundationthrough12-submission), mapping out EARS acceptance criteria (requirements.md), Mermaid architecture diagrams (design.md), and implementation checklists (tasks.md). - Steering & Custom Agents (
.kiro/steering/,.kiro/agents/,.kiro/hooks/): We locked core architectural and medical safety rules into steering documents, using custom Kiro agents and guard hooks to enforce strictweb → core ← apiboundaries and run automated quality gates after every change. - Property-Based & E2E Testing: We combined
fast-checkproperty-based tests with Playwright end-to-end suites (610 automated tests total) to verify red-flag routing, consent gating, offline reload resilience, and light/dark mode contrast.
Challenges we ran into
- Keeping On-Device Speech Lightweight Without Losing Offline Reliability: Bundling a 750 MB neural speech model into the browser would have blown past our 200 KiB rural-3G budget. Instead, we built an encrypted on-device chunked audio recorder (paired with a native Android plugin), a 5-button zero-ASR fallback so intake always finishes, and swappable Whisper HTTP / Sarvam adapters behind a feature-flagged local runtime seam.
- Enforcing the Clinician Approval Trust Boundary: Early upload flows allowed client-side state to influence approval status. We re-architected prescription sign-off and audit timestamps so they rely strictly on server-verified tenant context and the server clock.
- Preventing Mixed-Language Clinical Screens: Persisted demo threads initially kept English assistant replies when users switched to Hindi. We added a language-aware seed migration in
threads.tsthat updates fixture threads to match the active language while leaving patient-authored messages untouched. - Unifying Navigation & Theme Accessibility: Stacked header bars originally caused
backdrop-blurstacking conflicts that trapped the help popover (?) behind the bottom navigation. We consolidated desktop navigation into a singlez-50header, added a persistent Day/Night toggle, and stripped out redundant controls.
Accomplishments that we're proud of
- Deterministic Safety That Survives Outages: Emergency routing runs on pure local TypeScript in
packages/core. Even completely offline with zero API keys configured, urgent symptoms route straight totel:112. - A True Evidence Trail from Voice to FHIR R4: Every extracted fact in the clinician brief traces directly back to the source audio and exact transcript character span, exporting seamlessly into an HL7 FHIR R4 Bundle.
- Zero-Key Reproducibility & Lean Performance: A single Docker command (
docker compose up --build) spins up the full stack with synthetic data, passes 610 automated tests, and keeps the initial bundle at 180 KiB gzipped. - Live Public Deployment: Deployed and verified live at https://sancho.dirgha.ai with full light/dark theme support and unified responsive navigation.
What we learned
- Safety Architecture Beats Model Prompting: In clinical intake, deterministic rule code must execute before any LLM call, and human clinician sign-off must be enforced at the server boundary—never just in the UI.
- Spec-Driven Development Prevents Clinical Scope Creep: Writing EARS acceptance criteria and steering constraints inside
.kiro/forced us to draw a clear line between features that are built and verified versus those pending clinical validation. - Designing for Non-Literate Users Reshapes Every UI Decision: Replacing text boxes with spoken prompts, 56px tap targets, granular per-permission consent rows, and audio medicine reminders fundamentally changes how clinic software works.
What's next for Sancho | Voice Clinic
- Supervised Record-First Clinic Pilot: Partner with 1–2 primary-care clinics and ASHA frontline health workers in the Hindi belt for a 100-encounter pilot tracking intake completion rates, handoff completeness, and clinician review times.
- Native-Speaker Audio & Clinical Safety Evaluation: Gather real-device Android audio and run native-speaker evaluations on Hindi and Tamil red-flag phrases, word/character error rates (WER/CER), and DPDP privacy compliance before turning on live cloud speech recognition.
- Expanded Language Packs & EHR Integrations: Add Marathi, Bengali, and Telugu language support and connect HL7 FHIR R4 Bundles directly into India's ABDM/ABHA ecosystem and telemedicine queues.