HEM-Med: A Hierarchical Agentic Memory Framework for Safe Multi-Center Medication Recommendation
Organizations: 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 · University of Technology Sydney
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.
Figures & tables
| Item | Number |
|---|---|
| # of records / hospitals | 90,545 / 149 |
| Avg. / max / min # of records per hospital | 607.68 / 3,315 / 1 |
| Diag. / proc. / med. vocabulary size | 2,958 / 1,852 / 161 |
| Lab vocabulary size | 12 |
| Avg. / max / min # of diagnoses per record | 4.04 / 91 / 1 |
| Avg. / max / min # of procedures per record | 6.60 / 102 / 1 |
| Model | PRAUC | F1 | Jaccard | DDI Rate | SafeScore |
|---|---|---|---|---|---|
| EMCDR | |||||
| DDTCDR | |||||
| TEMPT | |||||
| Reason4Rec | |||||
| EXP3RT | |||||
| SafeDrug |
| Variant | PRAUC | F1 | Jaccard | DDI Rate | SafeScore |
|---|---|---|---|---|---|
| HEM-Med w/o MD | |||||
| HEM-Med w/o DDI-Dec | |||||
| HEM-Med w/o RERANKER | |||||
| HEM-Med w/o WAM | |||||
| HEM-Med |
| Method | Case A: H452 | Case B: H444 |
| Ground Truth | Dex; Fur; NaCl; KCl; MgSO 4 | Enox; Hyd; Lor; NaCl; KCl |
| DDTCDR | 3/5 NaCl ; MgSO 4 ; CaGlu ; KCl ; APAP Miss: Dex; Fur | 3/5 KCl ; Ond ; APAP ; NaCl ; Lor Miss: Enox; Hyd |
| SafeDrug | 4/5 NaCl ; CaGlu ; MgSO 4 ; KCl ; Dex Miss: Fur | 4/5 KCl ; Lor ; Eso ; NaCl ; Enox Miss: Hyd |
| TEMPT | 3/5 NaCl ; Lor ; Dex ; KCl ; Glu Miss: Fur; MgSO 4 | 4/5 Enox ; Lor ; NaCl ; KCl ; Eso Miss: Hyd |
| RES-MR | 4/5 NaCl ; KCl ; MgSO 4 ; CaGlu ; Dex Miss: Fur | 4/5 KCl ; Lor ; NaCl ; Eso ; Enox Miss: Hyd |
| HEM-Med | 5/5 NaCl ; KCl ; MgSO 4 ; Dex ; Fur Miss: None | 5/5 Lor ; Enox ; KCl ; Hyd ; NaCl Miss: None |