Inspiration
We've both worked in compliance-heavy environments where the hardest problem is always getting the right data to the right system at the right time, securely, without losing context. Healthcare has this problem worse than anywhere else. Clinicians have access to incredible AI tools, but those tools can't talk to each other, and they can't talk to the patient's actual record. We built MedG to close that gap.
What it does
MedG is a clinical AI orchestrator that connects directly to a patient's FHIR R4 health record and routes questions to specialist agents in real time.
- Ask about a patient's medications → pulls live data, checks for allergy conflicts and drug interactions
- Ask about conditions, vitals, or observations → queries the FHIR server directly
- Ask for an ICD-10 code → routes to a dedicated lookup agent instantly
The system runs as a registered A2A external agent on the Prompt Opinion platform, with patient credentials flowing securely through FHIR context extension headers.
How we built it
We built three agents backed by a shared infrastructure library:
- healthcare_agent: FHIR-connected tools for demographics, medications, conditions, observations, and medication safety
- general_agent: ICD-10-CM code lookups and date/time utilities
- orchestrator: Routes questions to the right specialist agent using Gemini 2.5 Flash and Google ADK's AgentTool pattern
Stack: Python 3.13, Google ADK, Gemini 2.5 Flash, A2A SDK, FHIR R4, Starlette, ngrok, Prompt Opinion platform.
Challenges we ran into
A2A protocol version mismatch was the hardest problem. The starter kit uses A2A SDK 0.3.x, but Prompt Opinion's platform sends 1.0-style requests with different method names and role enum formats. We built a custom
ProtocolAdaptermiddleware that translates between versions at runtime.FHIR metadata location discovery was also an issue. Google ADK surfaces A2A metadata in multiple locations depending on request flow.
Deployment without Cloud Run pushed us to use ngrok for live tunneling, which introduced SSL domain quirks and the challenge of keeping three agent servers synchronized simultaneously.
Getting the prompt opinion to pull from our agent was our biggest hassle and failure.
Accomplishments that we're proud of
- Built a fully working multi-agent clinical system that queries a live FHIR server
- Implemented real medication safety logic — allergy conflict detection, drug interaction checks, and duplicate medication flagging against live patient data
- Successfully registered and connected our agent to the Prompt Opinion platform as a standards-compliant A2A external agent with FHIR context support
- Built a protocol translation layer that bridges A2A 0.3.x and 1.0 at runtime without changing the underlying agent logic
What we learned
We learned that multi-agent systems need to fail gracefully. When a sub-agent errors, the orchestrator must surface that clearly — not drop it silently. Clinical environments have zero tolerance for silent failures.
What's next for ChartGuard
- Cloud Run deployment for persistent, production-grade availability
- Expand the medication safety engine with a full drug interaction database
- Add FHIR scope declarations for conditions and observations in the agent card
- Get it working on prompt opinion
Built With
- fast-api
- git
- python
- visual-studio
Log in or sign up for Devpost to join the conversation.