M-Plan: Comprehensive Planning For LLM Agents with Memory Arrangement
Authors: Ziyang Liu, Jiakang Yuan, Jiayuan Fan, Tao Chen
Organizations: College of Future Information Technology, Fudan University, Shanghai, China · College of Intelligent Robotics and Advanced Manufacturing, Fudan University, Shanghai, China · Shanghai Innovation Institute, Shanghai, China
Large language model (LLM)-based agents have recently demonstrated outstanding performance in single-turn tasks, yet they continue to struggle with long-horizon tasks, particularly in environments without prior training. A key limitation of single LLMs is their difficulty in processing long contexts, which stems from weaknesses in continuous decision-making and reasoning capabilities. Although existing multi-agent systems (MAS) equipped with long-term memory bases can partially address this gap, they mostly rely on knowledge reuse or summarization, an approach that is often constrained by directly retrieval without any adaptation for the current task, while the retrieved memory may contain much history noises waiting to be preprocessed. In contrast, MAS characterized by task-specific guidance often lack long-term memory specifically designed for the guidance. To address these challenges, we propose M-Plan, a closed-loop MAS framework that integrates long-term and short-term memory. By combining global-local and past-current guidance, M-Plan enhances agents' performance on multi-turn tasks while maintaining a plug-and-play design. During task execution, agents receive task-specific milestones and insights, and are provided with local hints only when confusion arises, which form global-local guidance together. These guidance generation and utilization construct the short-term memory as well. After task completion, relevant information about the current task is optimized or reorganized before being sent to the long-term memory storage for future retrieval. The designments mentioned above build a comprehensive framework different from other individual long-term or short-term memory works. Extensive experiments on multi-turn tasks including ALFWorld, Webshop, and PDDL across diverse models demonstrate that M-Plan outperforms multiple baseline methods in both accuracy and efficiency.
Figures & tables
Figure 1: The task-specific guidance consists of milestones and insights: milestones guide the action agent to follow a global task-solving path, while insights provide detailed considerations and important task-relevant knowledge; conditional hint when meeting action trap (invalid action). The hint will help correct the action in the next step.
Figure 2: The whole framework of M-Plan, containing long short-term memory, global-local guidance (milestones, insights, hints), and an optimizer module to form the closed-loop. More details can be seen in Section 3 .
Models
Methods
ALFWorld
Webshop
PDDL
SR.
SR.
AD
SR.
AD
Qwen3-32B
ReasoningBank
69.4±0.0
26.8±1.2
53.5±2.5
23.9±1.0
47.3±1.4
G-Memory
85.0±1.3
46.8±0.8
70.0±0.3
25.6±2.0
47.0±2.8
Hiplan
94.3±0.9
39.5±0.0
52.5±0.0
22.2±0.9
39.2±0.7
M-Plan
99.3±0.0
56.5±0.0
74.7±0.0
52.8±0.9
74.3±1.3
Qwen3-14B
ReasoningBank
65.7±0.0
28.2±0.6
60.7±1.7
17.2±0.9
37.9±0.3
Table 1: Results on ALFWorld, Webshop and PDDL. We report Success Rate ( SR. ) on all three benchmarks and Average Reward ( AD ) on Webshop and PDDL. Details about metrics can be seen in Sec. 4.1 . All SR. and AD values are reported in percentage (%).
Models
Methods
ALFWorld
Webshop
PDDL
AS.
ASS.
Meta-Step
ASS.
Meta-Step
AS.
ASS.
Meta-Step
Qwen3-32B
ReasoningBank
24.99
13.96
20.12
6.14
22.90
26.61
15.76
65.90
G-Memory
24.93
20.53
24.14
5.10
10.90
26.95
18.16
71.73
Hiplan
18.38
16.46
17.46
8.09
20.48
26.33
13.48
60.70
M-Plan
12.48
12.20
12.28
5.35
9.47
22.30
15.42
29.22
Qwen3-14B
ReasoningBank
26.30
13.91
21.17
5.90
20.93
28.16
19.33
112.42
Table 2: Comparison of average steps on ALFWorld, Webshop and PDDL. We report AS. , ASS. , and Meta-Step , while AS. is not considered for Webshop due to its specific characteristics, as discussed in Sec. 4.1 .
Models
Methods
ALFWorld
PDDL
At (M)
Ft
Ct (M)
At (M)
Ft
Ct (M)
Qwen3-32B
ReasoningBank
0.04
0.74
0.05
0.07
0.19
0.34
G-Memory
0.05
0.93
0.06
0.12
0.21
0.59
Hiplan
0.09
0.96
0.10
0.21
0.18
1.17
M-Plan
0.03
1.00
0.03
0.17
0.54
0.32
Qwen3-14B
ReasoningBank
0.04
0.69
0.06
0.07
0.13
0.54
Table 3: Token-efficiency comparison. We report At , Ft and Ct (see in Sec. 4.1 ), mainly focusing on the comparison of Ct . Webshop is not discussed for the fairness in Sec. 4.1 .
Methods
Modules
Performance
Optimizer
Retrieval
Insighter
Hinter
SR.
AD
AS.
Meta-Step.
Standard
✓
✓
✓
✓
52.8±0.9
74.3±1.3
22.30
29.22
w/o Optimizer
✗
✓
✓
✓
47.8±2.4
68.2±2.0
22.35
29.58
w/o Retrieval
✓
✗
✓
✓
42.5±0.8
61.4±0.9
23.63
35.12
w/o Insighter
✓
✓
✗
✓
48.3±2.9
66.8±1.5
22.81
31.44
w/o Hinter
✓
✓
✓
✗
41.1±1.9
61.6±1.8
24.01
37.64
Table 4: Ablation study of M-Plan on PDDL with Qwen3-32B. Retrieval indicates whether the short-term memory module receives cases from long-term memory. All SR. and AD values are reported in percentage (%).
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Models
Methods
ALFWorld
Webshop
AS.
ASS.
Meta-Step
ASS.
Meta-Step
Qwen3-32B
ReasoningBank
24.99±0.00
13.96±0.00
20.12±0.00
6.14±0.02
22.90±0.92
G-Memory
24.93±0.48
20.53±0.51
24.14±0.60
5.10±0.24
10.90±0.69
Hiplan
18.38±0.36
16.46±0.08
17.46±0.25
8.09±0.00
20.48±0.00
M-Plan
12.48±0.00
12.20±0.00
12.28±0.00
5.35±0.00
9.47±0.00
Qwen3-14B
ReasoningBank
26.30±0.00
13.91±0.00
21.17±0.00
5.90±0.13
20.93±0.02
Appendix
Table 5: Comparison of average steps on ALFWorld and Webshop. We report AS. , ASS. , and Meta-Step , while AS. is not considered for Webshop due to its specific characteristics, as discussed in Sec. 4.1 .
Models
Methods
PDDL
AS.
ASS.
Meta-Step
Qwen3-32B
ReasoningBank
26.61±0.31
15.76±1.84
65.90±0.15
G-Memory
26.95±0.69
18.16±1.90
71.73±0.43
Hiplan
26.33±0.14
13.48±0.10
60.70±0.07
M-Plan
22.30±0.13
15.42±0.03
29.22±0.01
Qwen3-14B
ReasoningBank
28.16±0.16
19.33±0.30
112.42±0.25
Appendix
Table 6: Comparison of average steps on PDDL. We report AS. , ASS. , and Meta-Step .
Models
Methods
ALFWorld
PDDL
At (M)
Ft
Ct (M)
At (M)
Ft
Ct (M)
Qwen3-32B
ReasoningBank
0.04±0.00
0.74±0.00
0.05±0.00
0.07±0.00
0.19±0.01
0.34±0.01
G-Memory
0.05±0.00
0.93±0.01
0.06±0.00
0.12±0.00
0.21±0.02
0.59±0.07
Hiplan
0.09±0.00
0.96±0.01
0.10±0.00
0.21±0.00
0.18±0.01
1.17±0.06
M-Plan
0.03±0.00
1.00±0.00
0.03±0.00
0.17±0.00
0.54±0.01
0.32±0.01
Qwen3-14B
ReasoningBank
0.04±0.00
0.69±0.00
0.06±0.00
0.07±0.00
0.13±0.01
0.54±0.03
Appendix
Table 7: Token-efficiency comparison. We report At , Ft and Ct (see in Sec. 4.1 ), mainly focusing on the comparison of Ct . Webshop is not discussed for the fairness in Sec. 4.1 .
Methods
Modules
Performance
Optimizer
Retrieval
Insighter
Hinter
SR.
AD
AS.
Meta-Step.
Standard
✓
✓
✓
✓
52.8±0.9
74.3±1.3
22.30±0.13
29.22±0.01
w/o Optimizer
✗
✓
✓
✓
47.8±2.4
68.2±2.0
22.35±0.04
29.58±0.02
w/o Retrieval
✓
✗
✓
✓
42.5±0.8
61.4±0.9
23.63±0.07
35.12±0.03
w/o Insighter
✓
✓
✗
✓
48.3±2.9
66.8±1.5
22.81±0.59
31.44±0.08
w/o Hinter
✓
✓
✓
✗
41.1±1.9
61.6±1.8
24.01±0.42
37.64±0.08
Appendix
Table 8: Ablation study of M-Plan on PDDL with Qwen3-32B. Retrieval indicates whether the short-term memory module receives cases from long-term memory. All SR. and AD values are reported in percentage (%).
Large Language Models (LLMs) show promise as tool-using agents but remain limited in long-horizon tasks that require remembering, organizing, and reusing knowledge. Prior memory approaches aim to resolve the situation, but mainly focus on storing factual information. Recent work on procedural memory improves task reuse, yet often reduces to replaying past successes without addressing failure cases or online scalability. We introduce a unified and automatic memory framework that integrates semantic, episodic, and procedural memory in a bi-level design combining short-term and long-term stores. A multi-agent architecture with actor, memory, and critic agents enables automatic memory generation, reward annotation, and adaptive retrieval. Long-term memory is managed through reward-based evaluation, merging, and pruning, ensuring scalability and continual improvement. Experiments across various environments show that our approach improves robustness and success on long multi-turn tasks compared to existing baselines. This work highlights the importance of comprehensive, adaptive memory for advancing LLM-based agents.
Large Language Model (LLM) agents increasingly rely on external memory to support long-horizon reasoning and decision making. Existing memory systems typically retrieve historical trajectories or summaries as independent context fragments, overlooking the procedural dependencies underlying multi-step execution. As memory scales, such flat retrieval introduces context fragmentation and cross-task interference, leading to structurally inconsistent reasoning trajectories. We propose ActiveMem, a hierarchical memory framework that recursively organizes agent experiences into dependency-aware latent execution trees. ActiveMem abstracts trajectories into reusable subtask nodes while explicitly preserving execution transitions, enabling coherent reasoning-path retrieval conditioned on the current execution state. To support continual adaptation, ActiveMem further learns dynamic memory expansion, retrieval, and pruning policies through reinforcement learning. Experiments across various agent benchmarks demonstrate that ActiveMem consistently improves task completion, reasoning stability, and memory efficiency over existing memory-based agents. Moreover, ActiveMem enables compact open-weight models to achieve competitive performance with substantially larger proprietary systems.
Large language model (LLM) agents struggle with long-horizon tasks due to their inherent statelessness, requiring all task-relevant information to be encoded in growing input contexts. The resulting degraded reasoning quality, increased inference cost, and higher latency necessitate efficient working memory mechanisms. However, existing approaches either rely on lossy compression or similarity-based retrieval, which often fail to capture temporal structure and causal dependencies required for multi-step agentic tasks. In this work, we present HORMA, a Hierarchical Organize-and-Retrieve Memory Agent that organizes experience into a file-system-like hierarchical structure, where summarized entities are linked to the corresponding raw trajectories, enabling efficient access without losing detailed information. HORMA decomposes working memory into two stages: structured memory construction and navigation-based retrieval. The construction module iteratively refines how experiences are structured by distinguishing between failures caused by missing information and those caused by misleading or overloaded context. The navigation module retrieves task-relevant context by traversing the hierarchy using a lightweight agent trained with reinforcement learning to select minimal yet sufficient context, thereby reducing latency along the critical execution path. Across ALFWorld, LoCoMo, and LongMemEval, HORMA improves task performance under constrained context budgets while requiring at most 22.17% of the baseline token usage in long conversation tasks. Compared to existing methods, it consistently achieves better efficiency-performance trade-offs and generalizes effectively to unseen tasks.