Visual abstractsVisuals
ResearchJournal of the American Medical Informatics Association · Sep 8, 2026

Evaluating retrieval-augmented generation versus long-context input for clinical reasoning over electronic health records

Myers S, Dligach D, Miller TA, Barr S, Landefeld J, Gao Y, et al
Digital Health & AIAdult
Read the full paper free at PubMed Central ↗

Abstract

Objective To evaluate whether retrieval-augmented generation (RAG) can serve as an efficient alternative to long-context prompting for clinical reasoning over electronic health records (EHRs). Materials and methods We defined 3 EHR-based tasks that are replicable across health systems and vary in reasoning complexity: (1) extracting imaging procedures (modality, date, and anatomic site), (2) generating timelines of therapeutic antibiotic use, and (3) identifying the key diagnoses for a hospitalization. Using real inpatient clinical notes from a US academic health system, we evaluated 3 large language models (GPT-5.4-mini, Mistral Medium 3, DeepSeek V3.1) with varying amounts of provided context, comparing targeted retrieval to using the most recent clinical notes. Results For Imaging Procedures, RAG strongly outperformed recent-note inputs and exceeded long-context performance (by 0.17-9.83 F1 across all models) using fewer than 8K tokens. Similar benefits were observed for Antibiotic Timelines, where Discussion RAG demonstrated strong token efficiency across tasks, with the clearest and most consistent gains observed for imaging extraction and antibiotic timeline reconstruction. Diagnosis generation proved the most challenging task, suggesting ceiling effects imposed by documentation variability and evaluation constraints. Conclusion Our results suggest that RAG remains a competitive and efficient approach for clinical tasks over large amounts of EHR, even as newer models become capable of handling increasingly longer amounts of text.

Topics

Electronic Health Records; Large Language Models; Humans; Information Storage and Retrieval; Generative Artificial Intelligence; Natural Language Processing; Diagnostic Imaging; Anti-Bacterial Agents

DOI: 10.1093/jamia/ocag139 · PubMed: 42710003

Spotted a mistake? Suggest a correction

More in Digital Health & AI

ResearchLancet Digit Health · Nov 23, 2026 · Digital Health & AI

ClinicalAge biomarker associated with mortality and disease risk in UK datasets

ClinicalAge, a framework for modelling ageing trajectories from longitudinal electronic health records in the UK: a model development and validation study

ResearchLancet Digit Health · Nov 23, 2026 · Digital Health & AI

Facial photographs used to estimate age and predict survival in cancer patients

Foundation artificial intelligence models for health recognition by use of face photographs (FAHR-Face): a model development and validation study

ResearchLancet Digit Health · Nov 23, 2026 · Digital Health & AI

New model predicts severe fetal compromise risk at birth with 33.4% sensitivity

A prognostic model for use at labour onset to estimate the risk of severe fetal compromise at birth: a retrospective, model development and validation study

ResearchNPJ Digit Med · Nov 21, 2026 · Digital Health & AI

ECG foundation models performed well on general data but less so on athletes' data

ECG foundation models for cardiovascular screening in a cohort of young competitive athletes

ResearchJ Med Internet Res · Nov 20, 2026 · Digital Health & AI

Six large language models showed similar question-answering accuracy on medical exam questions

Medical Reasoning in Large Language Models: Development and Evaluation of the MedEvalArena Benchmark