Inspiration / problem

Health agents demo well and fail quietly. The failure modes that matter in healthcare are not crashes. They are a confidently named provider who is not in any database, a silent fallback that makes a degraded search look authoritative, and an agent that answers "what dose should I take" instead of declining. Our prototype had all three. Before this could go in front of a caregiver managing their parent's records, the question stopped being "can the agent answer" and became "can it act reliably enough to matter."

What it does

  • Reads an anonymized clinical intent (conditions, generic medication names, lab values, city). No names, dates of birth, insurance IDs, or addresses reach the cloud.
  • Picks the right specialty and searches a MongoDB provider database with vector and text search.
  • Checks current medications against a proposed one for known interactions.
  • Returns ranked providers with the clinical reason for each match, any medication flags, and a draft anonymized referral. When nothing fits, it says so instead of substituting.

How we built it

  • Gemini for reasoning and instruction following (model is environment-driven so the prototype and production stay in sync).
  • Agent Development Kit (ADK) for the agent, its tools, and the run loop. One root_agent is the single source of truth.
  • MongoDB Atlas for the provider database and the drug-interaction collection, reached natively through the Model Context Protocol: the read-only MongoDB MCP server runs over stdio and is wired in with ADK's MCPToolset (USE_MONGODB_MCP=1). The reliability scoreboard runs on a deterministic FunctionTool path against the same data, so the before/after numbers are reproducible.
  • FastAPI on Google Cloud Run for the live demo and the on-device-to-cloud bridge.

The optimization work (this is the submission)

The prototype shipped an agent we were not actually evaluating. The live server hand-rolled its own function-calling loop, while the ADK agent we thought we were testing was never wired in, and a stalled run dead-ended on "Agent reached maximum turns." We fixed the foundation and then measured everything:

  1. One code path. Serving, the demo, and adk eval now all run the same ADK Runner, so we evaluate exactly what we ship.
  2. A reliability scoreboard. 24 grounded scenarios in eval/run_eval.py plus a Google adk eval trajectory set score routing accuracy, grounding (no invented providers), safety refusals, PII handling, and completion rate, with before and after numbers in eval/RESULTS.md.
  3. Grounding by construction. The system instruction forces every provider name, rating, and appointment slot to come from a tool result. The scoreboard counts hallucinated names against the seeded database.
  4. Honest failure. Tools return a structured envelope with an ok flag and a degraded signal, so a failed vector search can never pass as a clean one. A stall now recovers with a non-fabricated message.
  5. A real regression gate. eval/test_tools_reliability.py runs with no Gemini key and no live database, so reliability is checked on every change, not staged once for a demo.

Business case

Somach - Care Router is a Somach, Inc. product. Health Passport, the on-device vault it builds on, is live on Google Play (com.carlkho.healthpassport) and was the Grand Champion of the Qualcomm and Nexa AI On-Device Bounty ($6,500). Somach has raised $33,000+ in non-dilutive funding across Qualcomm, Google AI for Impact ($8,000, top of 22,900 developers), and the Omi hackathon ($25,000), and was selected for Google's Gen AI Elite Top 50 in APAC. The wedge is the 63 million US family caregivers (about 24 million reachable on Android today) who manage paperwork for someone else. The model is a $4.99 per month consumer tier plus a longer-term SDK license for clinics that want local-first record tools without cloud compliance burden. Reliability is the unlock: a routing agent that gives wrong referrals is a liability, so the engineering in this submission is the precondition to charging for it.

Why on-device plus cloud, not one or the other

Extraction stays on the phone, which is the privacy moat that wins trust with the most sensitive data people own. The cloud agent only ever sees a de-identified intent and returns a plan the device re-attaches to identity locally. That is how we use Gemini without giving up the thing that makes Health Passport worth installing.

Challenges

The hardest part was resisting new features. With six days it was tempting to add visit-prep and record reconciliation. The win in Track 2 is depth on reliability, so we held scope to the agent that already exists and put the time into measurement.

What's next

  • Bring the MCP path up to parity with the hardened tools by adding query-level grounding checks, then make it the default once the scoreboard confirms no regression.
  • Expand the scoreboard with clinician-reviewed cases.
  • Carry the hardened agent into the XPRIZE Build with Gemini track, where the same core has to run a real business with real revenue.

Built with

google-adk, gemini, vertex-ai, mongodb-atlas, model-context-protocol, fastapi, google-cloud-run, python

Built With

Share this project:

Updates