mlsanityData to 7 Oct 2026

ContextWeaver: Selective and Dependency-Structured Memory Construction for LLM Agents

arXiv 2604.23069 ↗First posted 24 Apr 2026cs.CLcited by 4

On the map: LLM agents and tool use → Agent memory systems

Abstract (arXiv)

Large language model (LLM) agents often struggle in long-context interactions. As the agent accumulates more interaction history, context management approaches such as sliding window and prompt compression may omit earlier structured information that later steps rely on. Recent retrieval-based memory systems surface relevant content but still overlook the causal and logical structure needed for multi-step reasoning. We introduce ContextWeaver, a selective and dependency-structured memory framework that organizes an agent's interaction trace into a graph of reasoning steps and selects the relevant context for future actions. Unlike prior context management approaches, ContextWeaver supports: (1) dependency-based construction and traversal that link each step to the earlier steps it relies on; (2) compact dependency summarization that condenses root-to-step reasoning paths into reusable units; and (3) a lightweight validation layer that incorporates execution feedback. On the SWE-Bench Verified and Lite benchmarks, ContextWeaver improves performance over a sliding-window baseline in pass@1, while reducing reasoning steps and token usage. Our observations suggest that modeling logical dependencies provides a stable and scalable memory mechanism for LLM agents that use tools.

Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 23 of its 29 references that are in the map. First posted on arXiv 24 Apr 2026.

Builds on

23 of 29 references.

Closest ancestors · 3

Same direction, newest first

  1. 2025ACON: Optimizing Context Compression for Long-horizon LLM Agents1 Oct
  2. 2025A-MEM: Agentic Memory for LLM Agents17 Feb
  3. 2024Evaluating Very Long-Term Conversational Memory of LLM Agents27 Feb

Other references · 20

  1. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  2. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
  3. 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
  4. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
  5. 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,500
  6. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  7. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  8. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,155
  9. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,628
  10. 2023MemGPT: Towards LLMs as Operating Systemscited by 1,295
  11. 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 956
  12. 2023Graph of Thoughts: Solving Elaborate Problems with Large Language Modelscited by 873
8 more
  1. 2022PAL: Program-aided Language Modelscited by 635
  2. 2023Learning to Compress Prompts with Gist Tokenscited by 379
  3. 2023Adapting Language Models to Compress Contextscited by 350
  4. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
  5. 2024Long-context LLMs Struggle with Long In-context Learningcited by 285
  6. 2023Compressing Context to Enhance Inference Efficiency of Large Language Modelscited by 185
  7. 2025The Complexity Trap: Simple Observation Masking Is as Efficient as LLM Summarization for Agent Context Managementcited by 40
  8. 2025The OpenHands Software Agent SDK: A Composable and Extensible Foundation for Production Agentscited by 39

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 4.

4 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Weighted Memory Tree: Remembering What Matters for Long-Horizon LLM Agents
  2. 2026MemWeaver: Weaving Hybrid Memories for Traceable Long-Horizon Agentic Reasoning
  3. 2026PRO-LONG: Programmatic Memory Enables Long-Horizon Reasoning
  4. 2025Hierarchical Memory for High-Efficiency Long-Term Reasoning in LLM Agents
  5. 2025Evaluating Long-Context Reasoning in LLM-Based WebAgents
  6. 2025Rethinking Memory in LLM based Agents: Representations, Operations, and Emerging Topics
  7. 2026Memory for Autonomous LLM Agents:Mechanisms, Evaluation, and Emerging Frontiers
  8. 2026MemGym: a Long-Horizon Memory Environment for LLM Agents