5 December 2026 · 5 min
When AI Writes EHR Queries: Inside Google's MedGemma 2 and Clinical Agents
Google's MedGemma 2 is an open foundation model that shifts healthcare AI from chatting to acting. It generates code, queries electronic health records, and cites sources, but arrives with strict warnings that it requires rigorous sandboxed validation before clinical use.
Key points
- MedGemma 2 is a multimodal health AI model for developers, available in 4B and 26B Mixture-of-Experts sizes.
- It introduces native tool calling, generating SQL and FHIR queries to retrieve patient histories directly from EHRs.
- The model writes Python code for medical calculations, improving relative accuracy on MedCalc-Bench by 56% for the 4B model compared to base Gemma 4.
- Google emphasizes the model is a starting point and is not intended to directly inform clinical diagnosis or treatment without independent validation.
Source: MedGemma 2 model card and launch announcement - Google Research, 2026
This spot is available. Reach clinicians, health-system leaders and medtech and pharma teams following AI in medicine. Sponsor the show
This episode is an AI-generated conversation summarising a public document; the hosts' voices are synthetic. It is for information only and is not medical advice. Always refer to the original source.
Transcript
Maya: AI just went from chatting with clinicians to writing code and querying the EHR.
Sam: Today we are looking at the MedGemma 2 model card and launch announcement published by Google Research.
Maya: As a reminder, our voices are AI-generated, and this is a summary of a public document. MedGemma 2 is Google's newest open foundation model for health AI developers, and it marks a massive shift in how these systems actually operate in practice.
Sam: What exactly is MedGemma 2, and what is the big shift?
Maya: It is a collection of open AI models built for medical text, image, and now audio comprehension. Google says they have moved from passive multimodal question answering to reasoning-capable models built for real-world clinical workflows.
Sam: How does a model actually execute a clinical workflow?
Maya: Through native tool calling. Instead of just generating text, MedGemma 2 can write structured SQL and FHIR queries to retrieve data from a patient's longitudinal history in the electronic health record.
Sam: Wait, really? It writes the database query itself?
Maya: Yes. It can also write Python code to run clinical calculations. But this is crucial: the model does not execute the code. Developers have to host and validate that code execution in appropriately permissioned, sandboxed environments.
Sam: Let us look at the real numbers. How much better is it at this than the baseline models?
Maya: On a clinical calculation benchmark called MedCalc-Bench, the larger MedGemma 2 model improved relative accuracy over the base Gemma 4 by 10%. And the smaller model improved by 56%.
Sam: You mentioned larger and smaller models. What are the deployment options here?
Maya: There are two sizes. The compact multimodal model is called MedGemma 2 4B, with effective 4B parameters. It is built to run directly on mobile devices and offline clinic workstations.
Sam: And the bigger one?
Maya: That is the MedGemma 2 26B MoE, which stands for 26B Mixture-of-Experts. It activates about 4B parameters per token, so it runs faster than a standard 26B model. That one is designed for hospital on-premises servers and private cloud deployments.
Sam: Quick note before we carry on. This spot is open for a sponsor. If your company builds or sells AI for healthcare and wants to reach the clinicians, health-system leaders and industry teams who listen to this show, the link to our sponsorship page is in the show notes.
Maya: And now, back to the document.
Sam: This means a health system could run a highly capable medical AI entirely on its own servers, without sending sensitive patient data out to the public cloud. Both of these support a context window up to 128K tokens, right?
Maya: Exactly. And the 4B model has another unique feature: native medical audio understanding. It can transcribe medical dictations without needing a separate speech-to-text step. It processes audio sampled at 16 kHz up to a 30s max duration.
Sam: Does it just listen in the room?
Maya: No, the document is very clear. It does not include live audio recording, streaming microphone capture, or ambient listening. It only processes the audio files you supply to it.
Sam: This brings us to the biggest limitation. If it is writing EHR queries and Python scripts, what happens if it makes a mistake with a drug calculation?
Maya: That is the biggest limitation by far. MedGemma 2 is strictly a starting point. Google explicitly states it is not intended to directly inform clinical diagnosis, patient management decisions, treatment recommendations, clinical calculations or any other direct clinical practice applications.
Sam: So if a medtech company or a hospital wants to use this, the burden of validation is entirely on them.
Maya: Yes. The model provides the orchestration backbone, but developers are solely responsible for the validation, security, execution and correctness of any tools, APIs, or data sources connected to the model.
Sam: What about hallucinations? If it is acting as a clinical agent, can it invent medical guidelines?
Maya: They have improved its clinical grounding to anchor answers in supplied references, like institutional guidelines. On an internal grounding benchmark, the 26B MoE hit an accuracy of 95.6. But Google warns that it may still produce content not supported by the provided sources.
Sam: This is a massive leap. We are moving from AI as a smart textbook to AI as a medical assistant that can retrieve charts and crunch numbers. The previous version, MedGemma 1, saw more than 60,000 unique users. With these agentic tools, this ecosystem is about to explode.
Maya: The memorable takeaway here is that open health AI has entered the tool calling era. These models can now orchestrate multi-step clinical workflows, but they remain foundational tools that demand rigorous, sandboxed validation before they ever touch a patient's care.
Sam: To recap: Google's MedGemma 2 brings code generation, EHR querying, and audio transcription to open medical AI, available in sizes for both edge devices and local servers.
Maya: But it requires significant developer adaptation, sandboxed environments for code execution, and it is explicitly not ready out-of-the-box for direct clinical decisions.
Sam: As always, the source document is linked in our show notes. And a reminder, this podcast is for informational purposes only and is not medical advice.