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

summary

Video file (mp4)

The gist

The gist The ContextWeaver framework introduces a selective and dependency-structured memory system for LLM agents that organizes interaction history into a graph of reasoning steps to select

In short

ContextWeaver is a memory framework for LLM agents that organizes interaction history into a reasoning step graph to select only relevant context for future actions. It uses dependency-based construction, compact summaries of reasoning paths, and execution feedback to preserve crucial information within token limits. This method improves agent performance on complex tasks by focusing on logical dependencies.

Key concepts

Dependency-Aware Context Construction
This core process builds a graph linking each new reasoning step back to the earlier steps it relies on. It uses an LLM-based analyzer to find which previous steps are logically necessary, then retrieves those ancestors via traversal. This ensures the agent only keeps context directly relevant to its current decision.
Dependency Summarizer
Instead of re-summarizing the entire history at every step, this component creates a compact summary for each node. This summary records the main reasoning dependency from the start of the task to that specific point. It allows ContextWeaver to incrementally build memory efficiently while preserving how earlier steps guide later logic.
Validation and Test Layer
This layer incorporates execution feedback by tracking outcomes from verification steps. It provides two signals: fine-grained evidence from tool observations and a node-level abstraction labeling each step as passed, failed, or unknown. Failed nodes are skipped when searching for parents, preventing reliance on broken states.
Context Weaving
This is the final step where context is selected for the next action. It constructs the context by retaining full triples (T-A-O) only for nodes within the identified dependency subgraph and compressing observations (O) for all other history entries, ensuring token budgets are respected.

Terminology used across episodes

This episode discusses

The paper

ContextWeaver: Selective and Dependency-Structured Memory Construction for LLM Agents · Read on arXiv

Yating Wu, Yuhao Zhang, Sayan Ghosh, Sourya Basu, Anoop Deoras, Jun Huan, Gaurav Gupta

UT Austin

Large language model (LLM) agents often struggle in long-context interactions. As the history grows, sliding windows and prompt compression may drop earlier information that later steps rely on. Retrieval-based memory systems surface relevant content but still overlook the causal and logical dependencies between steps. 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. ContextWeaver supports (1) dependency-based construction and traversal that link each step to the earlier steps it relies on; (2) compact dependency summaries of the reasoning paths; and (3) a lightweight validation layer that incorporates execution feedback. On five software-engineering and terminal benchmarks with a fixed budget per task, ContextWeaver improves the resolve rate over a sliding-window baseline on all five, with a significant gain when pooled across benchmarks, while using 13-18% fewer agent steps. It also performs favorably against alternative context-management approaches, with the largest gains on long-horizon repository tasks. On SWE-Bench Pro, ContextWeaver raises the resolve rate from 66.5% to 72.6%, with significant improvements across all three model backbones. The improvement also holds when the sliding window's budget is raised to cover the summary cost.

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: Today's paper: "ContextWeaver: Selective and Dependency-Structured Memory Construction for LLM Agents".

Jane: The gist The ContextWeaver framework introduces a selective and dependency-structured memory system for LLM agents that organizes interaction history into a graph of reasoning steps to select relevant context for…

Tom: First, who's behind it and why it matters.

Paper summary: Jane: So, focusing on the ContextWeaver paper itself, they claim their framework supports three main things. First, dependency-based construction and traversal that actually links each reasoning step to the earlier steps it relies on >

Tom: And second, they have these compact dependency summaries that condense those root-to-step reasoning paths into reusable units >

Lu: Then there's this lightweight validation layer that incorporates execution feedback, which is pretty smart because it adds a layer of checking during the process >

Meng: I wonder how much extra computation that validation layer adds to the inference time. If we’re shipping models, we need to know if that overhead is worth the improved reliability >

Lalam: The goal of these components is to preserve context most relevant to the agent's next action while still staying within token budgets >

Tom: It sounds like they are tackling the problem of forgetting earlier steps when you have a very long conversation or task >

Jane: Right. They use this graph structure to model explicit logical and causal relationships, which is different from just relying on semantic similarity between pieces of text >

Lu: This allows for more reliable pruning and a more interpretable memory organization because they are modeling the actual need for one step based on the output of another step >

Meng: That sounds like it could help when the agent has to reason through a complex, multi-step software engineering task where one small oversight can cascade into a failure >

Lalam: I think that’s what it does. It makes the memory structure reflect how the agent actually reasons rather than just storing everything linearly >

Tom: So, they are using this graph to organize past experience by constructing a dependency graph over executed steps, which is pretty different from standard text retrieval systems >

Conclusion: Jane: So, looking at the paper's title, ContextWeaver: Selective and Dependency-Structured Memory Construction for LLM Agents, it really emphasizes that this isn't just about storing more text; it’s about organizing that memory based on dependency >

Tom: And the authors are Yating Wu, Yuhao Zhang, Sayan Ghosh, Sourya Basu, Anoop Deoras, Jun Huan and Gaurav Gupta from UT Austin and AWS AI Labs >

Lu: The implication is that for agents working on long-horizon tasks in software engineering—the kind of stuff they use for repository context—this method of preserving explicit logical relationships can lead to much more reliable tool use >

Meng: From a deployment standpoint, if this framework helps the agent resolve tasks with fewer steps and less context overhead, that's definitely something we can talk about when we think about cost efficiency at scale >

Lalam: I think it means the agent doesn't have to re-read everything from scratch every time; it just accesses the relevant pieces of its reasoning path >

Jane: So, in simple terms, ContextWeaver is a system that builds a map of how an AI agent thinks step-by-step and only keeps the parts of that map needed for the next decision >

More episodes

← Home