TLDR: FHIR-AgentBench is a new benchmark designed to evaluate Large Language Model (LLM) agents in realistic healthcare settings, specifically for question answering over interoperable Electronic Health Records (EHR) using the HL7 FHIR standard. It uses 2,931 real clinical questions and de-identified patient data. The study found that current LLM agents struggle significantly with FHIR’s complex data structure, achieving only 50% accuracy even with advanced multi-turn and code-generating architectures. Key findings highlight the importance of multi-turn interactions for better data retrieval and code generation for accurate data interpretation, while also pointing out challenges in retrieval precision and data parsing.
Large Language Models (LLMs) are rapidly transforming various sectors, and healthcare is no exception. These AI agents are being developed to streamline administrative tasks, assist in diagnostics, and personalize patient care. However, for these powerful tools to be truly effective and deployable in clinical settings, they need to seamlessly integrate with the complex data ecosystems of healthcare systems. A significant shift in this landscape is the widespread adoption of the Health Level Seven Fast Healthcare Interoperability Resources (HL7 FHIR) standard, which organizes, shares, and queries electronic health data in a resource-based, interconnected format.
The challenge for LLM agents is to navigate this intricate, graph-like structure of FHIR resources, retrieve relevant information, and synthesize accurate answers to clinical questions. Unlike traditional relational databases with flat tables, FHIR data is discrete, nested, and linked by references, often requiring multiple retrieval steps to gather the necessary information. Existing benchmarks for evaluating these agents have not kept pace with this transition, often relying on synthetic data or lacking the realism needed to assess LLMs on interoperable clinical data.
Introducing FHIR-AgentBench: A Realistic Benchmark
To bridge this critical gap, researchers have introduced FHIR-AgentBench, a novel benchmark designed to evaluate LLM agents for realistic interoperable Electronic Health Record (EHR) question answering. This benchmark is grounded in 2,931 real-world clinical questions and uses de-identified patient records from MIMIC-IV-FHIR, ensuring authenticity in clinical questions, complexity in patient records, and fidelity to the FHIR system.
FHIR-AgentBench challenges agents with practical clinical QA tasks, including temporal reasoning, navigating thousands of records, handling case-sensitive terminologies, and even addressing queries with no relevant results. The dataset and evaluation suite will be publicly released to foster reproducible research and accelerate the development of robust LLM agents for clinical applications. You can find more details about the research paper here: FHIR-AgentBench Research Paper.
Key Findings: The Road Ahead for LLM Agents
The comprehensive evaluation using FHIR-AgentBench revealed significant challenges for current LLM agent architectures. Even the highest-performing agent, a multi-turn agent equipped with a retriever and a code interpreter, achieved an answer correctness of only 50.0%. This highlights the inherent difficulty in reasoning over realistic, interoperable clinical data.
The evaluation also uncovered two crucial trends:
- Multi-Turn Interaction is Key for Recall: Agents capable of iteratively refining their search consistently achieved higher retrieval recall (71%) compared to single-turn agents (58%). This suggests that the ability to engage in a dialogue-like process is vital for gathering all necessary information.
- Code Generation is Essential for FHIR Data: Incorporating a code interpreter dramatically improved final answer correctness in both single-turn and multi-turn settings. This indicates that LLMs struggle to interpret the nested, graph-like structure of FHIR resources without the explicit, procedural logic provided by code.
Interestingly, retrieval precision remained consistently low across all architectures. While high recall is necessary to obtain the right information, flooding the agent’s context with irrelevant FHIR resources directly hinders its ability to find and reason over the correct data. This emphasizes a critical trade-off that future agent designs must address.
Also Read:
- Navigating the Future of Healthcare: A Deep Dive into Large Language Models in Medicine
- Evaluating LLM Precision: A New Benchmark for Function Calling Instruction Adherence
Common Pitfalls and Future Directions
The researchers conducted a detailed error analysis, identifying primary categories of failure:
- Retrieval Failures: Agents often struggled to identify the correct FHIR resource type to search (e.g., looking for procedures in ‘Procedure’ resources when outcomes are in ‘Observation’ resources). They also generated overly specific queries or were limited by single-turn interactions that prevented them from retrieving multiple linked resource types.
- Answer Generation Failures (Interpretation Gap): Even when correct resources were retrieved, agents often failed to correctly interpret the FHIR data structure. This included difficulties in navigating references between resources (e.g., from a medication request to the actual medication name), incorrect filtering (e.g., counting all encounters instead of just inpatient visits), and misinterpreting fields (e.g., filtering on human-readable text instead of standardized FHIR codes).
- Code Execution Failures: Agents sometimes generated erroneous Python code with syntax errors or incorrect logic, preventing them from producing an answer even with the right data.
FHIR-AgentBench provides a standardized, high-fidelity platform to diagnose these failures and measure progress. Future work will focus on expanding the dataset, developing more sophisticated agents with advanced retrieval tools and precise FHIR data structure specifications, and incorporating real-world constraints like latency and cost into evaluations. This benchmark is a vital step towards developing safe, reliable, and truly interoperable AI for healthcare.


