cs.LGOct 28, 2026

MUSE: Multi-Level Memory with Selective Runtime Injection for Scientific Coding Agents

Authors: Haoran Jin, Defu Lian, Xiting Wang, Hong Xie

Organizations: University of Science and Technology of China · State Key Laboratory of Cognitive Intelligence, Hefei, Anhui, China · Gaoling School of Artificial Intelligence, Renmin University of China

Abstract

Historical experience can guide scientific coding at multiple levels, but task-level retrieval may miss implementation lessons that become relevant during execution. We introduce MUSE, a memory management framework combining multi-level memory with selective runtime injection for scientific coding agents. MUSE builds global, approach-level, and implementation-level memory from historical trajectories. At initialization, the agent receives global memory and problem-matched approach-level memory. During execution, current interactions are used to retrieve implementation-level memory. An LLM gate selects relevant experience and generates specific review advice, or skips injection. Across four benchmarks spanning numerical problem solving, kernel optimization, and scientific software repair, MUSE outperforms retrieval and memory baselines on all evaluation metrics. Ablations support the multi-level design and gated injection, while transfer experiments show that memory remains useful across kernel benchmarks. These results show that multi-level memory and selective runtime injection enable effective reuse of experience in scientific coding. Code is available at https://github.com/hr-jin/MUSE.

Figures & tables

Explore similar work

CardsList
  1. REM: What to Store, When to Recall, What to Forget in Experience Memory for Coding Agents

    Oct 19, 2026Xinyi Lisa Chen, Pedro Herrero-Vidal, Xiaohan Chen +6Memory Management for LLM AgentsAgent Memory

  2. VibeMemBench: Evaluating Memory Systems for Coding Agents on Real Repository Coding Tasks

    Sep 20, 2026Liyang Fan, Yingcheng Shi, Yongbin Li +7Benchmark DesignSoftware Engineering Benchmarks