MedAgentBench: A Realistic Virtual EHR Environment to Benchmark Medical LLM Agents

Yixing Jiang, Kameron Collin Black, Daniel J. Park, James Zou, Andrew Y. Ng, Jonathan Chen2025

TL;DR

This paper introduces MedAgentBench, a novel benchmark and interactive environment for evaluating the agent capabilities of Large Language Models (LLMs) in realistic medical scenarios. It addresses the critical need for standardized evaluation in healthcare, where current LLMs show promise but are not yet reliable enough for clinical deployment.

What Problem Does This Paper Address?

The paper tackles the challenge of evaluating LLMs as "agents" – systems that can plan, use tools, and interact with environments to complete complex tasks – specifically within the medical domain. While LLMs have shown impressive advancements, their application in healthcare is hampered by a lack of standardized benchmarks. Existing medical AI benchmarks often focus on question-answering or structured reasoning, failing to capture the dynamic, interactive nature of clinical workflows. This gap makes it difficult to assess LLMs' readiness for real-world healthcare tasks, which involve administrative burdens and potential staff shortages. The authors aim to bridge this gap by creating a realistic virtual Electronic Health Record (EHR) environment for robust agent evaluation.

Methods

The core of the paper is the introduction of MedAgentBench, a comprehensive evaluation suite. This suite includes:

  • A broad evaluation suite: Comprising 300 clinically-derived tasks across 10 categories, all written by human physicians.
  • Realistic patient profiles: 100 de-identified and jittered patient profiles, containing over 700,000 data elements.
  • A FHIR-compliant interactive environment: This virtual EHR simulates real-world EMR systems using standard APIs, allowing agents to interact with patient data. The environment is built using the HAPI FHIR JPA and deployed via Docker for easy setup.
  • An accompanying codebase: Facilitating the use and extension of the benchmark.

The evaluation process involves an agent orchestrator that interprets high-level tasks, plans function calls (using a defined set of nine FHIR functions), and executes them against the virtual EHR. The primary evaluation metric is task success rate (SR), with a strict pass@1 approach to mirror real-world deployment constraints where even single errors can have significant consequences.

Datasets

The paper introduces MedAgentBench as a newly created benchmark dataset. It is not trained on existing datasets but rather comprises:

  • 300 clinically-derived tasks: Curated by internal medicine physicians, covering inpatient and outpatient scenarios.
  • 100 realistic patient profiles: Extracted from the STARR (STAnford Research Repository) project, de-identified and with timestamps jittered. These profiles include lab test results, vital signs, procedure orders, diagnosis, and medication orders from the past five years.

Key Insights and Ideas

  • The need for interactive benchmarks: The paper strongly emphasizes that evaluating LLMs as agents requires more than just question-answering. Realistic clinical tasks demand interaction with complex environments, making benchmarks like MedAgentBench crucial.
  • LLMs are promising but not yet ready: While state-of-the-art LLMs show some capability in medical agent tasks, their performance is far from perfect, highlighting significant room for improvement.
  • Query vs. Action tasks: Most LLMs perform better on information retrieval (query) tasks than on tasks requiring modification of medical records (action). This suggests that initial applications of medical agents might focus on read-only functionalities.
  • Difficulty matters: Performance varies significantly across task difficulty levels, with models excelling at simple, single-step tasks but struggling with more complex, multi-step actions.

Key Results

The evaluation of 12 state-of-the-art LLMs on MedAgentBench revealed:

  • Best performer: Claude 3.5 Sonnet v2 achieved the highest overall success rate at 69.67%.
  • General performance: Most models showed "non-trivial performance," indicating potential, but none were deemed "highly reliable agents."
  • Query vs. Action SR: On average, models performed better on query tasks (information retrieval) than action tasks (record modification). For example, Claude 3.5 Sonnet v2 had an 85.33% query SR and a 54.00% action SR.
  • Difficulty breakdown: Models performed best on "easy" tasks (100% for Claude 3.5 Sonnet v2) and significantly worse on "hard" tasks (23.33% for Claude 3.5 Sonnet v2).
  • Common errors: Models often failed to follow instructions precisely, produced invalid actions, or returned answers in incorrect formats.

Limitations and Future Work

The authors acknowledge several limitations and suggest future research directions:

  • Limited scope: MedAgentBench focuses primarily on medical record contexts and does not capture the full complexity of real-world medical scenarios, which involve inter-team coordination and communication.
  • Patient profile representativeness: The patient profiles are derived from Stanford Hospital records and may not be representative of the general population, potentially introducing biases.
  • Future work:
    • Expanding the benchmark to other healthcare domains (e.g., surgical specialties, nursing).
  • Investigating the reliability of LLMs with repeated action-based tasks.
  • Exploring advanced techniques like many-shot in-context learning and meta-prompting.
  • Developing more sophisticated agent systems, including compound AI systems with hierarchical reasoning or memory-augmented decision-making.
  • Addressing the performance gap between closed-weight and open-weight LLMs.

Summary updated

Abstract

BACKGROUND: Recent large language models (LLMs) have demonstrated significant advancements, particularly in their ability to serve as agents thereby surpassing their traditional role as chatbots. These agents can leverage their planning and tool utilization capabilities to address tasks specified at a high level. This suggests new potential to reduce the burden of administrative tasks and address current healthcare staff shortages. However, a standardized dataset to benchmark the agent capabilities of LLMs in medical applications is currently lacking, making the evaluation of LLMs on complex tasks in interactive healthcare environments challenging. METHODS: To address this gap to the deployment of agentic AI in healthcare, we introduce MedAgentBench, a broad evaluation suite designed to assess the agent capabilities of large language models within medical records contexts. MedAgentBench encompasses 300 patient-specific clinically-derived tasks from 10 categories written by human physicians, realistic profiles of 100 patients with over 700,000 data elements, a FHIR-compliant interactive environment, and an accompanying codebase. The environment uses the standard APIs and communication infrastructure used in modern EMR systems, so it can be easily migrated into live EMR systems. RESULTS: MedAgentBench presents an unsaturated agent-oriented benchmark that current state-of-the-art LLMs exhibit some ability to succeed at. The best model (Claude 3.5 Sonnet v2) achieves a success rate of 69.67%. However, there is still substantial room for improvement which gives the community a next direction to optimize. Furthermore, there is significant variation in performance across task categories. CONCLUSION: Agent-based task frameworks and benchmarks are the necessary next step to advance the potential and capabilities for effectively improving and integrating AI systems into clinical workflows. MedAgentBench establishes this and is publicly available at https://github.com/stanfordmlgroup/MedAgentBench, offering a valuable framework for model developers to track progress and drive continuous improvements in the agent capabilities of large language models within the medical domain.
BibTeX
@misc{jiang2025medagentbench,
  author = {Yixing Jiang and Kameron Collin Black and Daniel J. Park and James Zou and Andrew Y. Ng and Jonathan Chen},
  title = {{MedAgentBench: A Realistic Virtual EHR Environment to Benchmark Medical LLM Agents}},
  year = {2025},
  doi = {10.32388/vn3yh7},
}
Figure