1. Home
  2. 1Heath
  3. Architecture

High-Level and Low-Level Design

The components of 1Heath, how a consultation flows through them, the data model, the verification rules and the technology stack.

Key Points
  • Four layers: apps, an on-phone engine and encrypted vault, an AI gateway, and (planned) a server linked to ABDM.
  • The model drafts in the cloud; verification runs on the phone.
  • Nothing reaches the signed record without passing the rules, and a signed record never changes.

High-Level Design

Apps
Doctor appListen, review, sign, PDF · built
Desk appRegister, consent, vitals
Pharmacy appDispense what was signed
Patient appRecord, reminders, emergency card
On the phone
Audio pipeline16 kHz capture, voice activity detection, chunks of up to ~10 s
Rules engineName matching, verification, safety checks, note assembly
Encrypted vaultConsultations, signed records, catalogue
Gateway
AI gatewayHolds all service keys, routes speech and drafting, meters usage, enforces limits
AI services
Speech to textTranslate and code-mixed modes, India-hosted
Drafting modelSarvam-105B, India-hosted
Planned server
Record serverSync, backup, sharing between apps · India region
ABDM linkABHA, health facility and professional registries, FHIR R4, consent manager
Drug registryNational Drug Registry lookups
Figure 1. Components. Solid boxes exist in the demo; dashed boxes are designed but not built. Keys for AI services live only in the gateway, never on the phone.

One Consultation, End to End

  1. Swipe to start. Consent is already recorded at the desk. Listening begins.
  2. Capture and chunk. The phone records 16 kHz mono audio; a voice-activity detector cuts it at natural pauses into chunks of up to about 10 seconds.
  3. Transcribe. Each chunk goes through the gateway to speech recognition in translate mode, which returns English in natural word order.
  4. Gate. If the English contains a catalogue name, a molecule, a number or a dosing word, the same audio is sent once more in code-mixed mode to keep the original words and numbers. The last chunk after Stop is sent to both at once.
  5. Live strips. As chunks return, the screen fills two strips: "Already taking" (what the patient says they take) and "Today's orders".
  6. Draft. On Stop, both transcripts go to the drafting model, which returns a structured note: complaints, history, examination, diagnosis, current medicines with an action, and prescription lines with every field.
  7. Verify on the phone. The rules engine checks every line and assigns a state: verified, confirm, or cannot sign.
  8. History paragraph. Written only from verified facts.
  9. Fallback. If the model fails or takes longer than 10 seconds, a rules-only note is shown and every medicine needs confirmation.
  10. Review and sign. The doctor resolves flagged lines and slides to sign.
  11. Store and print. The signed record, each line's spoken words, its interpretation, every reason given and the catalogue source are stored; the prescription PDF is generated.
MeasureValueStatus
Name matching per consultationabout 0.16 sMeasured on a laptop; target under 0.2 s on the phone
Note on screen after Stop5 s or lessTarget, not yet measured on the phone
Model fallback threshold10 sDesign rule
Lines that block signing3 or fewerTarget; a real block is never downgraded to meet it
Invented medicines allowed0Any invention fails a test run
Figure 2. Performance targets and what has actually been measured.

Cost and Connectivity

QuestionAnswer
Speech cost per consultationAbout ₹0.50 a minute for translation alone, about ₹0.81 a minute with the second original-language pass[1]. A two- to five-minute consultation costs roughly ₹1 to ₹4 in speech fees.
Drafting cost per consultationNot yet measured; it will be measured on recorded consultations before any pricing decision.
What if the internet is slow or down?The demo needs internet to transcribe. If the drafting model fails or takes longer than 10 seconds, the doctor gets a rules-only note in which every medicine must be confirmed. There is no offline mode yet; whether one is needed is a question for the pilot.
Can the model run on India's own infrastructure?Yes in principle: the drafting model's weights are open[2], so it can be self-hosted if a hospital or the law requires it.

Low-Level Design: The Data Model

EntityHoldsRule
PatientIdentity, ABHA link, allergies with reactions, long-term conditions, "also taking" listA phone number is never treated as unique; patients are never merged automatically
ConsentWhat was consented to, consent text version, who recorded it, whenNo recording without it
ConsultationDoctor, patient, start and stop, vitals from the deskOne consultation, one note
Transcript chunkAudio reference, English text, original-language text, timingAudio deleted after signing (planned for pilot)
Draft lineBrand, generic, strength, dose, grid, frequency, food timing, duration, when-needed condition and daily maximum, routeEvery field links to the words that support it
Verification resultState per line, rule that fired, candidate choicesThe model's label is checked, never silently changed
Signed recordFinal lines, spoken words, interpretations, reasons, catalogue sources, signature, timeImmutable; a correction is a new signed version
Audit eventEvery confirmation, override reason and allergy-record change, with person and timeAppend-only

Low-Level Design: Matching Medicine Names

  • A spoken word becomes a confirmed name only if it matches exactly, or is close in both spelling (score of at least 0.80) and sound (at least 0.90), and beats the next candidate by at least 0.10.
  • Ordinary English words are never replaced: "shall call" can only suggest Shelcal, never become it.
  • Suffixes are part of the name. Pan and Pan-D, or Telma and Telma-H, are different medicines; a suffix is never dropped or added.
  • Merged numbers are split only when the catalogue confirms the strength: "Pan 40100" becomes Pan 40, 1-0-0.
  • Uncertain names become up to three one-tap choices, each shown with its composition. 90 sourced look-alike pairs always appear together. Context may rank choices, never fill one in.
  • The matching list covers about 500 common outpatient brands with spoken forms in English, Hindi and Telugu and spellings in five Indian scripts (4,649 spellings), plus the clinic's own stock list.

Low-Level Design: The Verifier's Rules

CheckRuleResult
New order or current medicine"I take X" is a current medicine, never a new order; a brand with dosing detail from the doctor is an orderConfirm if unclear
Negation"Not Dolo" applies only to that medicineRemoved, with the words shown
Missing strength, dose, frequency or durationNever auto-completed; never filled in by popularityConfirm with choices
Strength the model made upA strength not in the words is treated as inventedBlocks signing
When-needed (SOS) medicineNeeds a condition and a daily maximumChoices: if fever, if pain, if needed
AllergyChecked by ingredient and drug classCannot sign
Banned combinationAgainst 711 notified combinations, by ingredients and formCannot sign
Weekly drug written dailyFor example methotrexate or vitamin D 60,000 IUConfirm with a reason
Children's liquid medicinesNeed concentration and weight; anyone under 18 until a paediatrician rules otherwiseBlocks until added
DuplicatesSame ingredient in today's orders or in what the patient already takesConfirm
Drug outside the doctor's systemFor example an allopathic drug by an AYUSH doctorWarning, not a block

Technology Stack

LayerTechnology
AppsFlutter (Dart) with Kotlin for Android platform code; Material 3 design
On-phone enginePython rules engine embedded in the app; Dart audio pipeline
On-phone storageSQLCipher encrypted database
GatewayCloudflare Workers, with key-value storage for key state and a SQL database for usage metering
AI servicesSarvam speech recognition and Sarvam-105B
Server (planned)Python and PostgreSQL in an India region; FHIR R4 for ABDM
StandardsABHA, ABDM registries and consent, SNOMED CT India extensions, NAMASTE, ICD-11
Wearables (planned)Android Health Connect and Apple HealthKit

How It Is Built and Tested

  • Rulings live in the repository. Every product decision is written down, and a build checklist fails the build if a rule is broken.
  • About 1,788 automated tests across the apps and the engine, plus image tests that guard approved screens at normal size, 200% text, tablet and stress layouts.
  • A frozen clinical test set of 131 cases; any change to an existing test needs the founder's written acceptance.
  • A benchmark harness that replays cached transcripts, so most accuracy changes are measured without new speech costs.
  • Done means verified on a real Android phone through the real app with a real gesture.

Sources

  1. 1Heath internal benchmarks, October to November 2026. Synthetic consultations; method described on the Models and data page. pawankalyan.dev
  2. Artificial Analysis. Sarvam 105B and Sarvam 30B: everything you need to know, 2 April 2026. artificialanalysis.ai