跳到正文
arXiv:cs.CL· Yating Wu, Yuhao Zhang, Sayan Ghosh, Sourya Basu, Anoop Deoras, Jun Huan, Gaurav Gupta·· 4 小时前

ContextWeaver:为 LLM 智能体构建选择性依赖结构化记忆

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

AI 导读

ContextWeaver 是一种选择性、依赖结构化的记忆框架,将 LLM 智能体的交互轨迹组织为推理步骤图,并据此为后续动作选取相关上下文。在五个软件工程与终端基准上固定预算测试,其 resolve rate 全部优于滑动窗口基线,且智能体步数减少 13-18%。在 SWE-Bench Pro 上,resolve rate 从 66.5% 提升至 72.6%。

正文

View PDF HTML (experimental)

Abstract: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.
Subjects: Computation and Language (cs.CL)
Cite as: arXiv:2604.23069 [cs.CL]
  (or arXiv:2604.23069v2 [cs.CL] for this version)
  https://doi.org/10.48550/arXiv.2604.23069

arXiv-issued DOI via DataCite

Submission history

From: Yating Wu [view email]
[v1] Fri, 24 Apr 2026 23:39:49 UTC (542 KB)
[v2] Wed, 14 Oct 2026 04:04:03 UTC (160 KB)

来源:arXiv:cs.CL · arxiv.org