Manuscript Offprint

arXiv:2608.29528

MedCache: Efficient and Temporally Valid Memory for Longitudinal Clinical Agents

Hei Ting, Chan, Chenwei Wu, Xueshen Liu, Boyuan Zheng, Liyue Shen, Jiasi Chen, Z. Morley Mao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Longitudinal clinical agents must maintain an evolving patient state from evidence distributed across visits, time points, and specialties. However, how agent memory should be designed for this setting remains unclear. We introduce a benchmark of multi-visit, multi-specialty patient records that evaluates long-context evidence retrieval, cross-time evidence aggregation, and cross-specialty clinical reasoning. Using this benchmark, we systematically study four memory design choices: curation, organization, retrieval, and memory-augmented reasoning. We find that temporal validity is more important than simply retaining more history; specialty-factorized memory reduces context but can hide shared evidence; and multiple agents help when specialists must reason together, not merely when evidence comes from multiple memories. Guided by these findings, we propose MedCache, a hybrid framework that constructs temporally valid patient memory, organizes evidence into overlapping specialty views, routes each query to relevant memories, and adaptively invokes one or multiple specialists. Experiments show that MedCache improves reasoning accuracy and memory efficiency over strong single-agent and multi-agent baselines, while generalizing across model backbones and external datasets.

Introduction

Personalized medical AI agents are rapidly moving beyond single-shot question-answering prototypes toward long-term care systems for continuous patient support and longitudinal disease management (Ant Group 2025; Universal Health Services 2025; Shi et al. 2026). In real-world deployment, agents must maintain an evolving representation of patient state from information distributed across visits, specialties, and care settings. Their decisions may depend on long-range clinical history, including medication changes and physiological trajectories, while forgetting patient-specific constraints or relying on outdated information can lead to unsafe recommendations. Reliable, longitudinal agent memory is therefore a foundational requirement for safe, personalized, and continuous clinical reasoning.

Agent-memory research has made notable progress in general domains beyond medical applications (Zhang et al. 2025), such as long conversations and extended coding sessions, through both single-agent and multi-agent approaches. Single-agent systems (SAS) leverage approaches like retrieval-augmented generation (Arslan et al. 2024), summarization (Yu et al. 2025), or structured memory (Chhikara et al. 2025) to give one agent unified access to past information. Multi-agent systems (MAS) instead divide memory and reasoning across role-specialized agents, allowing each agent to focus on a smaller and more relevant context (Zhang et al. 2026; Wu and Shu 2026). Longitudinal medical records, however, introduce additional challenges. Laboratory values, diagnoses, and medications may change over time, while clinically relevant evidence may be spread across departments and recorded months or years apart. A single-agent system can preserve a holistic view of the patient, but it may need to process a large amount of outdated, irrelevant, and clinically diverse information in one context. A multi-agent system may better match the multi-specialty structure of patient history, but how to efficiently organize this long-context memory with MAS is nontrivial: it can split shared evidence across agents, repeat the same information across multiple calls, or produce conflicting specialist recommendations. An important research question remains understudied: how to design effective and efficient agent-memory mechanisms for longitudinal medical care?

To better understand existing memory approaches' advantages and limitations in longitudinal medical care, we present LEMMA-Bench (Longitudinal EHR Memory for Medical Agents Benchmark), the first benchmark to evaluate memory designs for both SAS and MAS in longitudinal medical care settings. This benchmark, curated from de-identified longitudinal patient records, targets multi-visit, multiple EHR data types and multi-department settings in real-world clinical practice. The benchmark evaluates long-context evidence retrieval, cross-time evidence aggregation, and cross-specialty clinical reasoning. We compare strong SAS and MAS baselines while systematically analyzing four dimensions of agent memory: memory curation, including how evolving facts are updated and temporally validated; memory organization, including shared and specialty-distributed storage; memory retrieval, including how agents retrieve different memory segments; and memory-augmented reasoning, including single-agent and coordinated specialist-based multi-agent reasoning.

Our study yields several critical findings. First, retaining

∗^{*}These authors contributed equally.

more history does not guarantee better memory curation: longitudinal reasoning requires curating a valid patient state, as raw long-context and semantic retrieval can still contain outdated or superseded evidence that confuses agents. Second, distributing memory into focused clinical specialist views substantially reduces the context processed per query, but strict specialty boundaries can hide evidence relevant to multiple domains. Finally, memory-augmented MAS reasoning is not uniformly better than SAS despite increased inference costs. A single agent can usually integrate evidence retrieved from several memories, while multiple specialists are more helpful in the scenario when distinct clinical constraints must be evaluated and reconciled. Together, these findings show that no fixed memory or agent configuration in existing works is consistently optimal across varying longitudinal clinical queries.

Motivated by these findings, we propose MedCache, a hybrid framework that curates temporally valid patient memory, organizes evidence into overlapping specialty views, and routes each query to the relevant memories. MedCache then adaptively invokes either a single reader or multiple coordinated specialists according to the reasoning requirements of the query. Extensive evaluation shows that MedCache improves reasoning accuracy and memory efficiency and generalization.

Our main contributions are threefold:

• We introduce a benchmark for longitudinal clinical agent memory using multi-visit, multi-specialty patient records, covering long-context evidence retrieval, cross-time evidence aggregation, and cross-specialty clinical reasoning.

• We systematically study four key memory design choices—memory curation, memory organization, memory retrieval, and memory-augmented reasoning and derive useful principles for effective longitudinal clinical memory.

• Guided by these findings, we propose MedCache, a hybrid framework that combines temporally valid memory, overlapping specialty views, routed access, and adaptive specialist reasoning. Extensive experiments demonstrate improved accuracy and memory efficiency.

References (26)