arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

ContextPipe:面向长视距智能体的类数据库上下文组装技术

ContextPipe: Database-Inspired Context Assembly for Long-Horizon Agents

Peng Xu, Zuyu Zhang, Yuze Sun, Feng Tian, Long Wang, Chen Zhang

arXiv 2609.00749首次发表:更新:

发表机构

MatrixOrigin; Tsinghua University(矩阵起源; 清华大学)

机构由 AI 辅助整理,请以论文原文为准。

AI 中文总结

ContextPipe将数据库查询执行范式应用于长视距LLM智能体的上下文组装,通过五阶段流水线减少了令牌量、LLM调用次数与响应时间,提升了上下文的可审计性等特性。

AI 中文摘要

长视距大语言模型(LLM)智能体需要上下文组装:在严格的上下文窗口预算和字节敏感的提示缓存约束下,运行时必须决定每个提示中包含的内容、顺序以及何时压缩历史记录。在生产级智能体系统中,该逻辑分散在提示构建器、临时压缩例程、缓存中断变通方案以及各提供商的适配层中。我们认为上下文组装在结构上与关系型数据库中的查询执行同构:两者均在严格预算下执行、利用分层缓存并借助统计信息。我们将该范式应用于ContextPipe:一个由结构化数据源目录、确定性缓存感知优化器以及EXPLAIN ANALYZE跟踪支持的五阶段流水线(计划、绑定、优化、执行、反馈)。结果表明,ContextPipe中的上下文具备可审计、可回放和故障隔离的特性。使用SWE-bench Pro Qutebrowser子集进行的初步评估显示,与仅追加的上下文构建策略相比,ContextPipe将总令牌量减少31%,LLM调用次数减少23%,响应时间缩短9%,代价是KV缓存命中率有所降低。

英文摘要

Long-horizon large language model (LLM) agents require context assembly: the runtime must decide what to include in each prompt, in what order, and when to compact history under a hard context-window budget and a byte-sensitive prompt cache. In production agentic systems, this logic is scattered across prompt builders, ad hoc compaction routines, cache-break workarounds, and per-provider shims. We argue that context assembly is structurally isomorphic to query execution in a relational database: both execute under a hard budget, exploit a tiered cache, and leverage statistics. We adopt this discipline in ContextPipe: a five-phase pipeline (Plan Bind Optimize Execute Feedback) backed by a structured data-source catalog, a deterministic cache-aware optimizer, and an EXPLAIN ANALYZE trace. We show that context in ContextPipe is auditable, replayable, and failure-isolated. A preliminary evaluation using the SWE-bench Pro Qutebrowser subset shows that, compared with the append-only context construction policy, ContextPipe reduces total token volume by 31%, LLM calls by 23%, and response time by 9%, at the cost of a lower KV cache-hit ratio.

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑