Inspiration
In a medical emergency, every single second counts. Yet, modern hospitals are paralyzed by fragmented systems and manual coordination. When a trauma patient arrives, it triggers a chaotic chain reaction: calling for beds, checking blood banks, paging surgeons, and praying the insurance claim won't be denied due to a coding error.
Meanwhile, on the ward, doctors and residents are burning out. They spend up to 50% of their shifts doing manual data entry instead of treating patients. We realized that solving healthcare inefficiency required two things: macro-level autonomous logistics for the hospital, and micro-level frictionless tools for the doctors.
We built CareFlow to bridge this gap, creating the first truly autonomous, privacy-first hospital ecosystem along with a companion app for doctors, CarePal
What it does
Our project is a dual-platform solution:
1. CareFlow (The Hospital Command Center) A web-based autonomous command center that orchestrates hospital logistics using a 9-agent AI engine.
- Parallel Triage: When an ambulance payload drops, 8 specialized AI agents execute concurrently to reserve ICU beds, verify O-Negative blood stock, page on-call cardiologists, and prep logistics.
- Chief Medical Officer Synthesis: A synthesis agent reviews the parallel data and generates a conflict-free Hospital Prep Plan, enforcing life-saving hard-blocks (e.g., Penicillin allergies).
- Claims Adjudication: To protect hospital finances, an automated OCR auditor uses Gemini Vision to cross-check medical scans against the generated treatment plan, ensuring strict ICD-10 and PMJAY/Medicare compliance to prevent insurance denials.
2. CarePal (The Edge Mobile App) A companion mobile app built for doctors on the floor, designed around the reality that hospital WiFi is unreliable and patient privacy is paramount.
- 100% Offline Voice Dictation: Doctors hold the microphone and say, "Admit John Doe to bed 4, start Amoxicillin." Using a locally hosted, on-device Whisper AI model, CarePal parses the complex clinical intent without needing an internet connection.
- Smart MAR Grid: Automatically populates Medication Administration Records, warns of drug interactions, and offers a 30-second "undo" window for logged doses.
- Instant Handovers: Generates comprehensive PDF shift handovers (vitals, pending scutwork, active drugs) in a single tap.
How I built it
We separated our architecture into a powerful cloud brain and a secure edge client:
- The Cloud Brain (Next.js): We utilized the Google Agent Development Kit (ADK) powered by Gemini 2.5 Flash. We orchestrated 9 distinct agents using a mix of
ParallelAgentandSequentialAgentpipelines. To fetch patient histories and guidelines, we connected the agents to MongoDB Atlas using the officialmongodb-mcp-server(Model Context Protocol) and Atlas Vector Search. - The Edge Client (React Native / Expo): Built with Expo, we utilized
op-sqlitefor lightning-fast, C++ driven local database transactions. This ensures strict DPDP/HIPAA compliance via local hard-deletion. - On-Device NLP: We integrated
whisper.rnto run lightweight Whisper ONNX models entirely on the mobile device, allowing doctors to securely dictate PII (Personally Identifiable Information) without ever sending audio to a cloud API.
Challenges I ran into
- The "Sequential" Latency Trap: Initially, running 9 LLM agents sequentially took over 45 seconds—far too slow for an emergency. By heavily refactoring our ADK pipeline to a "Goldilocks" model, we reduced the time complexity from $\mathcal{O}(\sum_{i=1}^{n} T_i)$ to $\mathcal{O}(\max(T_1 \dots T_8) + T_{synthesis})$. Now, 8 agents run in parallel using lightweight native JavaScript tools, feeding their output into a final Sequential Synthesis agent that handles the heavy MCP reasoning.
- On-Device AI Constraints: Getting an AI model to parse medical jargon reliably on a mobile device without the internet was incredibly difficult. We had to manage memory constraints, audio buffer slicing, and React Native bridging to ensure the Whisper model didn't crash the app during long dictations.
- Data Synchronization: Ensuring the offline-first mobile app could still trigger critical "Team Alerts" to the Next.js command center required building a resilient mobile-sync webhook that catches offline actions when the device reconnects.
Accomplishments that I'm proud of
- Successfully marrying a highly complex, multi-agent cloud architecture with a completely isolated, privacy-first edge mobile application.
- Getting the Claims Adjudicator to accurately read a messy medical invoice image, extract ICD-10 codes, and validate them against an AI-generated prep plan using Gemini Vision.
- Building a beautiful, frictionless UI for the doctors (CarePal) that actually feels like it saves time rather than adding another layer of administrative burden.
What I learned
- A deep understanding of the Google Agent Development Kit (ADK) and how to orchestrate parallel vs. sequential agentic workflows.
- How to leverage the Model Context Protocol (MCP) to securely grant LLMs access to enterprise-grade databases like MongoDB.
- Advanced React Native optimization, specifically managing heavy local LLM weights and ultra-fast SQLite transactions on mobile.
What's next for CareFlow
- Native HL7 FHIR Integration: Transforming our JSON schemas into strict FHIR R4 resources for seamless interoperability with legacy EHR systems like Epic or Cerner.
Built With
- adk
- google-cloud
- nextjs
Log in or sign up for Devpost to join the conversation.