DEV Community

Cover image for CureNet AI: Decentralized Health Intelligence for India, Powered by Gemma 4 and ABHA Standardization
Labish Bardiya
Labish Bardiya

Posted on

CureNet AI: Decentralized Health Intelligence for India, Powered by Gemma 4 and ABHA Standardization

Gemma 4 Challenge: Build With Gemma 4 Submission

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

What I Built

CureNet AI is an ABDM-native, offline-first Health Intelligence platform built to unify fragmented medical records securely under the Ayushman Bharat Digital Mission (ABDM) and FHIR R4 standards.

In rural India, reliable internet is a luxury. Prescriptions are handwritten. Lab reports fade on thermal paper. Patient histories exist as loose sheets in plastic folders. The consequences are measurable:

  • ₹26,037 crore in health insurance claims denied in a single year — ₹15,100 crore disallowed and ₹10,937 crore repudiated — largely due to incomplete documentation (IRDAI Annual Report, FY24)
  • 32% of patients transferred between facilities with incompatible records undergo duplicate diagnostic testing within 12 hours (NIH peer-reviewed study)
  • 47% of India's total health expenditure is paid out-of-pocket by patients — among the highest globally — inflated by repeated tests and fragmented care
  • ~2 minute consultations — overloaded OPDs force doctors to see 100+ patients in hours, leaving no time to reconstruct history from paper records (BMJ Open)
  • Less than 15% of Indian hospitals have fully digitized medical record systems

CureNet AI solves this by deploying Gemma 4 edge intelligence directly into the local clinic ecosystem — no internet required.

Core Features Shipped

Intelligent Local Ingestion: Camera-based document scanning powered by Gemma 4 31B Dense vision. Prescriptions and lab reports are analyzed directly by Gemma 4's multimodal capabilities — extracting medications, dosages, lab values, vitals, and diagnosis without any cloud dependency.

Structured Medical Parsing: A custom FHIR R4 bundle builder generates ABDM-compliant Document Bundles containing Patient, Practitioner, MedicationRequest, Observation, and DiagnosticReport resources — with SNOMED CT medication codes and LOINC lab test codes. Doctors can instantly verify whether a test was already performed — directly eliminating redundant diagnostics.

Privacy-First Architecture: AES-256-GCM encrypted local database with keys stored in the device's hardware keystore. Custom ABDM crypto module for RSA-OAEP, ECDH X25519, and AES-GCM encrypted data exchange. Full DPDP Act 2023 compliance — when Gemma 4 runs locally, zero patient data leaves the device.

Complete ABDM Integration: Full M1 + M2 + M3 milestone compliance — ABHA creation via Aadhaar and Mobile OTP, care context linking, consent management, and encrypted health data exchange using V3 sandbox APIs.

Offline-First Architecture: Three-tier connectivity probing (Ollama → Backend → Cloud) with automatic fallback. When fully offline, the AI serves responses from locally stored encrypted records. When online, cloud models act purely as fallback.

ABHAy AI Assistant: RAG-augmented health chat running intent classification, web search, clinical atom retrieval, and semantic search all simultaneously — cutting response latency from ~12s to ~4s.

Accessible by Design: High-contrast UI with large tap targets designed for senior citizens and low-literacy users. Full multilingual support across all 22 scheduled languages of India via the Bhashini API, with built-in Text-to-Speech so patients who cannot read can hear their medical information in their own language.

Demo Video

Code

👉 GitHub Repository: https://github.com/labishbardiya/CureNet-AI

How I Used Gemma 4

Medical records demand zero leakages and low latency. Gemma 4 acts as the core, private intelligence engine — running entirely locally via Ollama with no patient data ever leaving the device.

We split reasoning between edge and workstation environments using two models:

Gemma 4 E4B (Effective 4B) — On-Device Edge Intelligence

We run Gemma 4 E4B (gemma4:e4b) via Ollama for low-latency tasks on the local machine.

🤔 Why E4B? With its Per-Layer Embeddings (PLE), E4B packs frontier-level logic into a ~3 GB memory footprint. Its 128K context window handles large clinical data logs while running natively offline.

🤔 How it's used? It acts as our first-tier intent classifier — categorizing every user query into MEDICAL_QUERY, GENERAL_CHAT, or APP_HELP in under 2 seconds. This determines whether the full RAG pipeline activates. It also handles chat title generation and serves as an automatic failover when the 31B model is overloaded — ensuring the experience never breaks.

Gemma 4 31B Dense — Medical Extraction & FHIR R4 Conversion

On the clinic workstation backend, we deploy Gemma 4 31B Dense (gemma4:31b) via Ollama for complex clinical intelligence.

🤔 Why 31B Dense? Medical records cannot tolerate routing gaps or hallucination. The Dense architecture processes every token through all 31 billion parameters with a 256K context window — unlike MoE variants that risk dropping clinical context. When a missed medication has patient safety implications, Dense is the correct choice.

🤔 How it's used? Two critical paths. First, it processes prescription and lab report images directly using multimodal vision via a zero-shot structure prompt — extracting patient info, medications with dosage/frequency/duration/route, lab results with values/units/reference ranges, vitals, diagnosis, and follow-up instructions. Indian patterns like 1+0+1 (morning/afternoon/night) are parsed correctly. Brand names like "Crocin" map to their SNOMED CT active ingredient codes. Second, it powers the ABHAy RAG assistant for medical reasoning with full clinical context from the patient's encrypted local records. All outputs feed into our FHIR R4 builder, generating strict ABDM-compliant bundles with SNOMED CT and LOINC coding.

Top comments (0)