NeFut Logo NeFut
Admin Login

[CS.AI] ContextPipe: Database-Inspired Context Assembly for Long-Horizon Agents

Published at: 2026-09-03 22:00 Last updated: 2026-09-04 02:14
#optimization #LLM #Artificial Intelligence

Long‑horizon large language model (LLM) agents must decide at runtime which pieces of information to include in each prompt, in what order, and when to compress history under a hard context‑window budget and a byte‑sensitive prompt cache. In production 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 operate under a strict budget, exploit a tiered cache, and rely on statistics.

Guided by this analogy, ContextPipe adopts 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‑style trace. This makes the context assembly auditable, replayable, and failure‑isolated.

A preliminary evaluation on the SWE‑bench Pro Qutebrowser subset shows that, compared with the traditional 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 slightly lower KV cache‑hit ratio.

Review

Original Source: https://arxiv.org/abs/2609.00749

[h] Back to Home