Grounded agents combine patient context, policy, and approved knowledge
Healthcare agents need more than a vector store. They need current patient context, role-aware authorization, and a deliberate rule for which knowledge sources can influence the answer or next action.
A practical grounding stack usually combines live FHIR retrieval, approved operational data such as schedules or tasks, and a narrow document corpus such as policy, pathways, or guideline excerpts. This lets the system synthesize an answer while preserving where each part came from.
The first gate is identity resolution. Before retrieving anything else, the workflow should confirm which patient, encounter, or case the task refers to and stop if identity remains ambiguous or conflicting.
Layers in a healthcare agent grounding stack
| Layer | Typical source | Why it exists |
|---|---|---|
| Patient context | FHIR Patient, Encounter, Observation, MedicationRequest | Anchors output to the actual person and current state |
| Operational context | Scheduling, queue, prior-auth, or case-management systems | Lets the agent reason about the workflow it is in |
| Knowledge context | Approved guidelines, pathways, or policy documents | Supports grounded explanation or routing decisions |
Grounded healthcare agent retrieval path
Loading diagram...
Grounding should fail visibly, not silently degrade
If the workflow cannot retrieve the patient, the needed operational state, or the approved policy source, the agent should stop or escalate instead of improvising from model memory alone.
Choose an agent design pattern
Google Cloud Architecture Center guidance that is useful here for understanding when evidence gathering can run in parallel and when the workflow still needs a bounded synthesis step.
Open the design-pattern guideSMART App Launch 2.2.0
Official HL7 implementation guide for SMART authorization patterns used with FHIR applications and agents.
Open the HL7 guideMy Health Record FHIR Gateway - API Specification v4.0.0
Australian Digital Health Agency API specification for the current My Health Record FHIR gateway request, response, and error behavior.
Review the My Health Record API specificationFHIR tool use should stay scoped and inspectable
Agentic workflows work best when FHIR access is explicit. Instead of giving a model a broad “read everything” capability, expose task-oriented resource reads or drafts with clear SMART scopes and known response shapes.
SMART launch context matters as much as scopes. If the app launches with the patient, encounter, practitioner, or task already identified, the workflow can narrow retrieval immediately instead of reconstructing context from chat text and risking the wrong chart.
Example FHIR retrieval surface for a reviewable agent
These operations keep the agent focused on current demographics and recent vitals instead of unrestricted chart access.
Request
GETANNOTATIONS
Response
SMART App Launch v2.1.0 on the Australian Digital Health Developer Portal
Australian catalog entry for SMART App Launch, updated April 2025, useful for local implementer context.
Open the Australian SMART pageFHIR search
HL7 specification for RESTful FHIR search interactions, parameters, and searchset bundle behavior used in task-scoped retrieval.
Review the HL7 search specKeep the retrieved patient context structured and auditable
Before passing patient context to a model, normalize it into a compact structure that preserves identifiers, timestamps, and provenance. That allows downstream reviewers to inspect the same evidence bundle that influenced the answer or proposed action.
That compact bundle should retain recency tags such as observation timestamps, medication status dates, and the implementation guide or profile that shaped the resource. Those details help reviewers decide whether the evidence was current enough for the task.
Example of a compact evidence bundle for an agent step
A valid JSON bundle that preserves who the patient is, which observations were used, and what medication was current.
Click on an annotation to highlight it in the JSON
Grounding should stay minimal
The safest context bundle is the smallest set of current facts that can support the task. Over-collecting PHI increases privacy and explainability risk without improving every workflow.
FHIR in Cloud Healthcare API
Google Cloud documentation on FHIR stores, resource handling, and healthcare interoperability concepts.
Open the FHIR concepts pageMy Health Record FHIR Gateway - Data Mapping v3.0
Australian Digital Health Agency mapping guide for how My Health Record gateway payloads align with the local FHIR resource surface.
Open the My Health Record data-mapping guideSafer writeback turns agent output into reviewable workflow objects
The highest-risk FHIR mistake is not a bad summary. It is a silent mutation of the clinical workflow. In safer agent designs, the model does not jump straight from retrieval to authoritative chart changes. It creates a reviewable work item, carries forward the supporting evidence, and preserves a machine-readable trace of what happened.
Conditional writeback is part of that safety model. When a reviewer accepts a Task, the system should confirm the workflow state or target record version has not changed since the evidence bundle was assembled, otherwise the action should be re-reviewed.
FHIR resources that make agent output easier to review and investigate
| Resource | How it is used | Why it is safer |
|---|---|---|
| Task | Represent a reviewable next step such as prior-auth review, inbox routing, or clinician sign-off | Keeps the proposed action in workflow state instead of silently mutating the record |
| Provenance | Record which evidence bundle, model, or reviewer contributed to the step | Lets teams reconstruct what influenced the draft or recommendation |
| AuditEvent | Capture the access and action trail around the workflow step | Supports privacy, security, and post-incident investigation |
Example of a reviewable FHIR Task for agent output
A Task resource can hold the proposed next step while a human reviewer remains the named owner of the final decision.
Click on an annotation to highlight it in the JSON
Writeback should start as a proposal
If the workflow is high consequence, the first resource written by the agent should usually be a reviewable task or draft object, not the final clinical fact itself.
Guard writeback with version checks
If the record changed after the evidence bundle was created, the workflow should reopen review instead of applying the stale draft against newer clinical state.
FHIR Task
HL7 specification for using Task as a workflow request or activity wrapper in interoperable systems.
Open the Task resourceFHIR Provenance
HL7 specification for recording which agents, people, or inputs were involved in producing or updating data.
Open the Provenance resourceFHIR AuditEvent
HL7 specification for auditable events such as access, update, or workflow execution across systems.
Open the AuditEvent resourceKnowledge Check
Test your understanding with this quiz. You need to answer all questions correctly to mark this section as complete.