ReCAP: Recursive Context-Aware Reasoning and Planning for Large Language Model Agents
Zhenyu Zhang, Tianyi Chen, Weiran Xu, Alex Pentland, Jiaxin Pei
Abstract
Long-horizon tasks requiring multi-step reasoning and dynamic re-planning remain challenging for large language models (LLMs). Sequential prompting methods are prone to context drift, loss of goal information, and recurrent failure cycles, while hierarchical prompting methods often weaken cross-level continuity or incur substantial runtime overhead. We introduce ReCAP (Recursive Context-Aware Reasoning and Planning), a hierarchical framework with shared context for reasoning and planning in LLMs. ReCAP combines three key mechanisms: (i) plan-ahead decomposition, in which the model generates a full subtask list, executes the first item, and refines the remainder; (ii) structured re-injection of parent plans, maintaining consistent multi-level context during recursive return; and (iii) memory-efficient execution, bounding the active prompt so costs scale linearly with task depth. Together these mechanisms align high-level goals with low-level actions, reduce redundant prompting, and preserve coherent context updates across recursion. Experiments demonstrate that ReCAP substantially improves subgoal alignment and success rates on various long-horizon reasoning benchmarks, achieving a 32% gain on synchronous Robotouille and a 29% improvement on asynchronous Robotouille under the strict pass@1 protocol.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 5b07f8e5-6dc8-42c3-89ce-37ca95d46c36Cited by top-tier papers2
- Embodied Task Planning via Graph-Informed Action Generation with Large Language ModelsXiang Li, Ning Yan, Masood MortazaviICML 2026 · 2 citations
- : Hierarchical Multi-Agent Decision-Making with LLM-Based Agents in Interactive EnvironmentsSangeun Park, Minhae KwonICML 2026
Builds on11
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Reflexion: language agents with verbal reinforcement learningNoah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan et al.NeurIPS 2023 · 5,828 citations
- Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran et al.NeurIPS 2023 · 5,068 citations
- SWE-bench: Can Language Models Resolve Real-world Github Issues?Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao et al.ICLR 2024 · 2,082 citations
- SWE-agent: Agent-Computer Interfaces Enable Automated Software EngineeringJohn Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret et al.NeurIPS 2024 · 2,059 citations
Related papers
- Robotouille: An Asynchronous Planning Benchmark for LLM AgentsGonzalo Gonzalez-Pumariega, Leong Su Yean, Neha Sunkara, Sanjiban ChoudhuryICLR 2025
- REAP: Enhancing RAG with Recursive Evaluation and Adaptive Planning for Multi-Hop Question AnsweringYijie Zhu, Haojie Zhou, Wanting Hong, Tailin Liu et al.AAAI 2026
- Long-Context Reasoning Through Proxy-Based Chain-of-Thought TuningMiao Li, Irina Saparina, Alexander Gurung, Mirella LapataACL 2026
- PPA-Plan: Proactive Pitfall Avoidance for Reliable Planning in Long-Context LLM ReasoningByeongjin Kim, Gyuwan Kim, Seo Yeon ParkACL 2026
- HyperTree Planning: Enhancing LLM Reasoning via Hierarchical ThinkingRunquan Gui, Zhihai Wang, Jie Wang, Chi Ma et al.ICML 2025
