ContextWeaver: Selective and Dependency-Structured Memory Construction for LLM Agents
Yating Wu, Yuhao Zhang, Sayan Ghosh, Sourya Basu, Anoop Deoras, Jun Huan, Gaurav Gupta

TL;DR
ContextWeaver introduces a dependency-structured memory system for LLM agents, enhancing long-context reasoning by organizing interactions into a graph and selectively retrieving relevant information.
Contribution
It presents a novel memory framework that models logical dependencies and summarizes reasoning paths, improving performance and efficiency in LLM agent interactions.
Findings
Outperforms sliding-window baseline in pass@1 on SWE-Bench benchmarks.
Reduces reasoning steps and token usage.
Supports dependency-based construction, summarization, and validation.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
