ContextWeaver: Selective and Dependency-Structured Memory Construction for LLM Agents
- URL: http://arxiv.org/abs/2604.23069v1
- Date: Fri, 24 Apr 2026 23:39:49 GMT
- Title: ContextWeaver: Selective and Dependency-Structured Memory Construction for LLM Agents
- Abstract summary: ContextWeaver is a selective and dependency-structured memory framework for large language model (LLM) agents.<n>It organizes an agent's interaction trace into a graph of reasoning steps and selects the relevant context for future actions.<n>It improves performance over a sliding-window baseline in pass@1, while reducing reasoning steps and token usage.
- Score: 19.133532974091953
- License: http://creativecommons.org/licenses/by/4.0/
- 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 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.
Related papers
- Organize then Retrieve: Hierarchical Memory Navigation for Efficient Agents [29.28371047415946]
HORMA is a hierarchical organize-and-Retrieve Memory Agent for large language models.<n>It decomposes working memory into two stages: structured memory construction and navigation-based retrieval.<n>It consistently achieves better efficiency-performance trade-offs and generalizes effectively to unseen tasks.
arXiv Detail & Related papers (2026-06-10T05:49:14Z) - Memory is Reconstructed, Not Retrieved: Graph Memory for LLM Agents [51.30250860677378]
We propose MRAgent, a framework that combines an associative memory graph with an active reconstruction mechanism.<n>Running on a Cue-Tag-Content graph, our active reconstruction mechanism integrates reasoning directly into memory access.<n>Experiments on the LoCoMo benchmark and LongMemEval benchmark demonstrate significant improvements over strong baselines.
arXiv Detail & Related papers (2026-06-04T11:29:46Z) - Mem-$π$: Adaptive Memory through Learning When and What to Generate [65.31077328444077]
We present a framework for adaptive memory in large language model (LLM) agents, where useful guidance is generated on demand.<n>Mem-$$ consistently outperforms retrieval-based and prior RL-optimized memory baselines.
arXiv Detail & Related papers (2026-05-20T17:51:05Z) - TA-Mem: Tool-Augmented Autonomous Memory Retrieval for LLM in Long-Term Conversational QA [8.036549927091286]
Large Language Model (LLM) has exhibited strong reasoning ability in text-based contexts across various domains.<n>The limitation of context window poses challenges for the model on long-range inference tasks.<n>We introduce a tool-augmented autonomous memory retrieval framework (TA-Mem)<n>The TA-Mem is evaluated on the LoCoMo dataset, achieving significant performance improvements over existing baseline approaches.
arXiv Detail & Related papers (2026-03-10T07:27:01Z) - E-mem: Multi-agent based Episodic Context Reconstruction for LLM Agent Memory [4.8183840404266185]
E-mem is a framework shifting from Memory Preprocessing to Episodic Context Reconstruction.<n>E-mem achieves over 54% F1, surpassing the state-of-the-art GAM by 7.75%, while reducing token cost by over 70%.
arXiv Detail & Related papers (2026-01-29T13:42:42Z) - DYCP: Dynamic Context Pruning for Long-Form Dialogue with LLMs [8.451732843394973]
Large Language Models (LLMs) exhibit increased response latency and degraded answer quality as dialogue length grows.<n>We introduce DyCP, a lightweight context management method that dynamically segment and retrieve relevant memory at query time.
arXiv Detail & Related papers (2026-01-12T20:47:50Z) - Memory Matters More: Event-Centric Memory as a Logic Map for Agent Searching and Reasoning [55.251697395358285]
Large language models (LLMs) are increasingly deployed as intelligent agents that reason, plan, and interact with their environments.<n>To effectively scale to long-horizon scenarios, a key capability for such agents is a memory mechanism that can retain, organize, and retrieve past experiences.<n>We propose CompassMem, an event-centric memory framework inspired by Event Theory.
arXiv Detail & Related papers (2026-01-08T08:44:07Z) - CAM: A Constructivist View of Agentic Memory for LLM-Based Reading Comprehension [55.29309306566238]
Current Large Language Models (LLMs) are confronted with overwhelming information volume when comprehending long-form documents.<n>This challenge raises the imperative of a cohesive memory module, which can elevate vanilla LLMs into autonomous reading agents.<n>We draw inspiration from Jean Piaget's Constructivist Theory, illuminating three traits of the agentic memory -- structured schemata, flexible assimilation, and dynamic accommodation.
arXiv Detail & Related papers (2025-10-07T02:16:30Z) - RCR-Router: Efficient Role-Aware Context Routing for Multi-Agent LLM Systems with Structured Memory [57.449129198822476]
RCR is a role-aware context routing framework for multi-agent large language model (LLM) systems.<n>It dynamically selects semantically relevant memory subsets for each agent based on its role and task stage.<n>A lightweight scoring policy guides memory selection, and agent outputs are integrated into a shared memory store.
arXiv Detail & Related papers (2025-08-06T21:59:34Z) - Data Dependency-Aware Code Generation from Enhanced UML Sequence Diagrams [54.528185120850274]
We propose a novel step-by-step code generation framework named API2Dep.<n>First, we introduce an enhanced Unified Modeling Language (UML) API diagram tailored for service-oriented architectures.<n>Second, recognizing the critical role of data flow, we introduce a dedicated data dependency inference task.
arXiv Detail & Related papers (2025-08-05T12:28:23Z) - Task Memory Engine (TME): Enhancing State Awareness for Multi-Step LLM Agent Tasks [0.0]
We propose a lightweight and structured memory module that tracks task execution using a hierarchical Task Memory Tree (TMT)<n>TME is designed to be graph-aware, supporting reusable substeps, converging task paths, and shared dependencies.
arXiv Detail & Related papers (2025-04-11T13:38:36Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.