cs.SEFeb 25, 2026

Structurally Aligned Subtask-Level Memory for Software Engineering Agents

Authors: Kangning Shen, Jingyuan Zhang, Chenxi Sun, Wencong Zeng, Yang Yue

Organizations: Kuaishou Technology, Beijing, China

Abstract

Large Language Models (LLMs) have demonstrated significant potential as autonomous software engineering (SWE) agents. Recent work has further explored augmenting these agents with memory mechanisms to support long-horizon reasoning. However, these approaches typically operate at a coarse instance granularity, treating the entire problem-solving episode as the atomic unit of storage and retrieval. We empirically demonstrate that instance-level memory suffers from a fundamental granularity mismatch, resulting in misguided retrieval when tasks with similar surface descriptions require distinct reasoning logic at specific stages. To address this, we propose Structurally Aligned Subtask-Level Memory, a method that aligns memory storage, retrieval, and updating with the agent's functional decomposition. Extensive experiments on SWE-bench Verified demonstrate that our method consistently outperforms both vanilla agents and strong instance-level memory baselines across diverse backbones, improving mean Pass@1 over the vanilla agent by +4.7 pp on average (e.g., +6.8 pp on Gemini 2.5 Pro). Performance gains grow with more interaction steps, showing that leveraging past experience benefits long-horizon reasoning in complex software engineering tasks.

Figures & tables

Explore similar work

CardsList
  1. Enhancing Software Engineering Through Closed-Loop Memory Optimization

    Jun 4, 2026Xuehang Guo, Zora Zhiruo Wang, Qingyun Wang +2Software Engineering AgentsLLM Agent Evaluation

  2. SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agents

    Jun 26, 2026Shuzheng Gao, Wenhao Zeng, Zhaojian Yu +5Software Engineering AgentsMemory Management for LLM Agents

  3. Socratic-SWE: Self-Evolving Coding Agents via Trace-Derived Agent Skills

    Jun 5, 2026Chuan Xiao, Zhengbo Jiao, Shaobo Wang +5Software Engineering AgentsLLM Agent Skill Learning