arXiv:2610.20191cs.AIOct 2026

Manuscript Offprint

arXiv:2610.20191

HEM-Med: A Hierarchical Agentic Memory Framework for Safe Multi-Center Medication Recommendation

Min Xiao, Jin Li, Shoujin Wang, Yeguang Zhen, Yishuo Li, Wenpeng Lu

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

Min Xiao1,†^{1,\dagger}, Jin Li2,†^{2,\dagger}, Shoujin Wang2^{2}, Yeguang Zhen1^{1}, Yishuo Li1^{1}, Wenpeng Lu1,∗^{1,*}

1^{1} Key Laboratory of Computing Power Network and Information Security, Ministry of Education;

Shandong Computer Science Center (National Supercomputer Center in Jinan);

Qilu University of Technology (Shandong Academy of Sciences);

Shandong Provincial Key Laboratory of Computing Power Internet and Service Computing;

Shandong Fundamental Research Center for Computer Science, Jinan, Shandong, China

Email: min.xiao02@foxmail.com; zhenyeguang92@gmail.com;

yishuoli@foxmail.com; wenpeng.lu@qlu.edu.cn

2^{2} University of Technology Sydney

Email: Jin.Li-4@student.uts.edu.au; shoujinwang@foxmail.com

†^{\dagger} Equal Contributors * Corresponding author

Abstract—Medication recommendation (MR) is critical for clinical decision support. While existing MR methods are mostly designed for single-center learning, where only one independent hospital is involved, multi-center MR with hospitals of different scales has become increasingly demanding in practice. In multi-center settings, abundant data from large medical centers can improve recommendation performance for low-resource centers. Despite a few preliminary attempts on this task, two critical gaps remain. Gap 1: Existing multi-center methods fail to disentangle transferable cross-hospital clinical experience from hospital-specific prescribing patterns, limiting clinical feasibility and physician acceptance. Gap 2: They commonly overlook multi-label safety constraints of MR, including drug-drug interaction risks and local formulary feasibility, which are essential for safe real-world deployment. To address these gaps, we propose HEM-Med, a novel hierarchical agentic memory framework for multi-center MR. To address Gap 1, we design a disentangled hierarchical memory module that builds patient-level medication-context attribution records and disentangles them into cross-hospital experience memory and hospital-specific residual memory. To address Gap 2, we introduce a safety-aware medication set generation module, which integrates dual-level experience retrieval with safety-aware set decoding to produce clinically relevant, safer, and locally adaptive medication recommendations. Experiments on a real-world multi-center eICU dataset show that HEM-Med outperforms representative transfer learning, LLM-based, and MR baselines in terms of both recommendation accuracy and safety. 1^{1}

Index Terms—Multi-center Medication Recommendation, Experience Memory, Drug-Drug Interaction, Memory Disentanglement

I. INTRODUCTION

Medication recommendation (MR) is a key task in clinical decision support systems. The goal is to analyze a patient's complex Electronic Health Record (EHR) and generate a set of

(a) Different hospitals have different data distributions.

Figure

(b) Direct migration leads to performance degradation.

(c) Cross-hospital interference causes unsafe predictions.

Fig. 1: Motivating example of multi-center medication recommendation. Heterogeneous hospital prescribing patterns may cause negative transfer, and ignoring local feasibility and drug safety may lead to unsafe medication combinations.

candidate medications that are well aligned with the patient’s current physiological status and therapeutic needs [1], [2].

Early MR studies focused on model development within a single center, where training and evaluation are conducted using EHR data from the same hospital. Representative methods include GAMENet, SafeDrug, and DKGM [1]–[3]. Despite their effectiveness in single-center settings, these methods rely on local data and may perform poorly in low-resource hospitals owing to data sparsity and cold-start issues [4].

Recent studies address single-center limitations through two lines of research: cross-domain and multi-center transfer for cross-hospital knowledge sharing. The first line borrows ideas from General Cross-Domain Recommendation (CDR), which transfers or shares knowledge across related domains, such

1^{1}Our code is publicly available at: https://anonymous.4open.science/r/anonymous-HEM-Med-0935.

as EMCDR and DDTCDR [5], [6]. The second line targets multi-center healthcare scenarios. A representative method TEMPT [7] pre-trains on pooled multi-center prescription data and then relies solely on prompt fine-tuning to adapt to the target hospital distribution.

Despite recent progress, existing studies still suffer from two major gaps. Gap 1: Entangled cross-hospital knowledge. Existing multi-center MR methods often overlook that prescribing decisions reflect both generalizable medical knowledge and hospital-specific resources, clinical protocols, and prescribing preferences. As shown in Fig. 1 (a), medication distributions may vary across hospitals for the same disease [7]. Fig. 1 (b) further illustrates that transferring entangled cross-hospital knowledge in ICU settings with coexisting conditions may cause negative transfer and impair recommendation performance. Gap 2: Insufficient safety awareness. Existing transfer-based methods prioritize representation alignment but often overlook clinical safety constraints. Unlike general CDR, MR requires multi-label predictions that satisfy treatment needs, DDI constraints, and local formulary availability [2], [8], [9]. As illustrated in Fig. 1 (c), ignoring these constraints may yield inappropriate or unsafe medication combinations.

To address these gaps, we propose HEM-Med, a hierarchical agentic memory framework for multi-center MR. For Gap 1, a disentangled memory module separates transferable clinical experience from hospital-specific prescribing patterns into cross-hospital experience memory and hospital-specific residual memory. For Gap 2, a safety-aware medication set generation module combines dual-level retrieval with DDI-aware set decoding to generate clinically relevant, safer, and locally adaptive recommendations.

The contributions are summarized as follows:

• We propose HEM-Med, a hierarchical agentic memory framework for multi-center MR that explicitly disentangles cross-hospital experience from hospital-specific prescribing preferences.

• We develop a safety-aware module for ICU medication set generation, integrating dual-level retrieval and DDI-aware decoding to account for clinical relevance, local feasibility, and DDI risks.

• Experiments on the eICU dataset show that HEM-Med improves recommendation accuracy while maintaining competitive medication safety.

References (29)