Organizations: National Key Laboratory of Cognition and Decision Intelligence for Complex Systems, Institute of Automation, Chinese Academy of Sciences · University of Chinese Academy of Sciences · Nanjing Artificial Intelligence Research of IA
Large language model (LLM) agents often perform poorly on complex, long-horizon tasks because their context becomes increasingly cluttered over time. As interactions accumulate, detailed execution traces and intermediate outputs dominate the context, making it difficult for the model to retain and use high-level planning information. Most existing methods address this issue through compression or retrieval applied to a single, flat context, which does not clearly separate different types of context information and often leads to degraded reasoning. To address this challenge, we propose HyMem, a hierarchical framework that explicitly separates the agent's context into distinct functional layers. HyMem organizes context by function to separate high-level planning from execution and complex analysis. Its isolated reasoning module handles complex subtasks without adding intermediate reasoning traces to the persistent planning context, while its memory management module preserves task progress across context refreshes through structured summaries. These components reduce redundant context accumulation, retain task-critical information, and support coherent long-horizon reasoning within a limited context window. Experiments on GAIA and Browsecomp-plus show that, with DeepSeek-V4, HyMem achieves average Pass@1 scores of 66.7% and 61.3%, outperforming the strongest baseline by 6.1 and 4.7 percentage points, respectively. Further analysis indicates that HyMem effectively controls the growth of the reasoning context, allowing the model to maintain focus and accuracy across complex, long-horizon tasks.
Figures & tables
Figure 1: Changes in task-critical information within the agent context. As the context length increases, effective task signals are diluted by redundant historical information, reducing the agent’s sensitivity to core constraint information. The left panel shows changes in task-critical information during task execution on GAIA by agents using ReAct and HyMem, respectively. The right panel illustrates the changes in the position and density of ReAct and HyMem within the context in a task example.
Figure 2: Overview of the HyMem framework. Upon query arrival, the PLanner Layer (a) performs task decomposition and iterative planning. Sub-tasks are routed to the Executor Layer (b) for execution within isolated reasoning spaces (c) based on complexity, returning refined results for strategic synthesis. Simultaneously, the framework maintains context efficiency by compressing historical trajectories into structured episode, working, and tool memories in (d), which are re-injected to ensure long-horizon task continuity and reasoning focus.
Backbone
Framework
GAIA
Browsecomp-plus
Level 1
Level 2
Level 3
Avg. P@1
Easy
Medium
Hard
Avg. P@1
No Agency
Qwen3-32B
Base
23.8
6.0
5.3
18.9
-
-
-
-
DeepSeek-V4
Base
35.7
27.2
15.8
28.3
14.0
10.0
0.0
8.0
Agentic Frameworks
Qwen3-32B
ReAct
19.0
10.6
0.0
11.8
70.0
24.0
2.0
32.0
Table 1: Experimental results on GAIA and Browsecomp-plus benchmarks. P@1 denotes Pass@1. The bolded numbers represent the top performers in their respective categories. (1) HyMem improves the reasoning capabilities of different backbone models. (2) HyMem delivers the largest overall performance improvement among the compared agent frameworks.
Figure 3: Resource Consumption and Task Performance across Different Methods. We compare the resource consumption and task performance of ReAct, ReSum, A-MEM, THREAD, and HyMem on the GAIA and BrowseComp-Plus tasks. HyMem achieves better task performance while maintaining acceptable resource utilization.
Figure 4: Relationship between Context Changes and Task Progress across Different Methods. We record the relationship between context growth trends and task progress for ReAct, A-MEM, ReSum, and HyMem. HyMem-Total denotes the overall context of HyMem, while HyMem refers to the context of the planner module.
Framework
Browsecomp-plus (DeepSeek-V4)
GAIA (Qwen3-32B)
Pass@1
Plan.
Conf.
Pass@1
Plan.
Conf.
HyMem (Full)
0.6300
12.98
0.77
0.3200
14.20
0.82
w/o Isolated Reasoning
0.5800 (-5.00pp)
10.26 (-2.72)
0.68 (-0.09)
0.1340 (-18.60pp)
11.50 (-2.70)
0.71 (-0.11)
w/o Memory Management
0.5400 (-9.00pp)
9.68 (-3.30)
0.69 (-0.08)
0.1340 (-18.60pp)
10.12 (-4.08)
0.70 (-0.12)
Table 2: Ablation study of HyMem. Red values (-) indicate the performance drop compared to the full framework.
Table 3: Execution trace of HyMem on a multi-hop reasoning task. The flow demonstrates the interaction between the Planner Layer (reasoning/task generation), Executor Layer (tool use), and the Isolated Reasoning mechanism for verification. Note the Memory Compression event which consolidates the context before the final answer.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Table 4: Full prompt template for HyMem Planner Layer.
Table 5: Full prompt template for HyMem Executor Layer.
Table 6: Full prompt template for the HyMem Isolated Reasoning Module, responsible for recursive sub-problem decomposition and independent analysis.
Table 7: The suite of prompts used in the Memory Management Module, including episode memory, working memory, and Tool memory.
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.
Memory is essential for enabling large language model (LLM) agents to handle long-horizon reasoning tasks. Existing memory mechanisms are largely centralized, typically organizing retrieved information and interaction history within a single model context. This design imposes a fundamental trade-off: scaling reasoning trajectories risks context overload, whereas aggressive content pruning may result in irreversible information loss. Seeking a better trade-off, we draw inspiration from human cognitive systems, especially the functional complementarity between the prefrontal cortex (executive control) and the hippocampus (memory management), suggesting that such a trade-off need not be inherent, but may instead stem from centralized memory organization. To this end, we propose ActiveMem, a heterogeneous framework that decouples agent memory from the core reasoning process. Specifically, a high-level Planner utilizes distilled semantic gists to execute reasoning, while a lightweight, distributed memory system operates in parallel to actively accumulate and consolidate these gists throughout the task. Experiments on BrowseComp-Plus and GAIA show that ActiveMem achieves state-of-the-art accuracy with significantly reduced overhead, demonstrating the effectiveness of distributed active memory for long-horizon reasoning.
Yunhan Jiang, Wenbin Duan, Shasha Guo +3
State Key Laboratory of AI Safety, Institute of Computing Technology, Chinese Academy of Sciences · University of Chinese Academy of Sciences
Large Language Models (LLMs) struggle with long-horizon tasks due to the "context bottleneck" and the "lost-in-the-middle" phenomenon, where accumulated noise from verbose environments degrades reasoning over multi-turn interactions. To address this issue, we introduce a symbiotic framework that decouples context management from task execution. Our architecture pairs a lightweight, specialized policy model, ContextCurator, with a powerful frozen foundation model, TaskExecutor. Trained via reinforcement learning, ContextCurator actively reduces information entropy in the working memory. It aggressively prunes environmental noise while preserving reasoning anchors, that is, sparse data points that are critical for future deductions. On WebArena, our framework improves the success rate of Gemini-3.0-flash from 36.4% to 41.2% while reducing token consumption by 8.8% (from 47.4K to 43.3K). On DeepSearch, it achieves a 57.1% success rate, compared with 53.9%, while reducing token consumption by a factor of 8. Remarkably, a 7B ContextCurator matches the context management performance of GPT-4o, providing a scalable and computationally efficient paradigm for autonomous long-horizon agents.
Xiaozhe Li, Tianyi Lyu, Yizhao Yang +6
Tongji University · CurrentsAI Research · Stanford University +1