Skip to content

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

Sep 2026 · 0 citations · 31 references
Computer Science

TL;DR

It is argued that context assembly in ContextPipe is structurally isomorphic to query execution in a relational database: both execute under a hard budget, exploit a tiered cache, and leverage statistics.

Abstract

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.

View source

Similar papers

Preprint Aug 2026

Context as an Environment: Programmatic Context Management for Long-Horizon Agents

LLM agents increasingly take on long-running tasks whose history grows far beyond a single model context window. Existing approaches compress earlier interactions or extract selected information into fixed memory representations, committing to what to preserve before future needs are known. We present Scroll, a context...

Yin Lin, Elaine Ang, E. Zhu et al. · 3 citations
Jul 2026

ACM: Agentic Context Management for Long Horizon Tasks

This work proposes Agentic Context Management (ACM), a framework that equips agents with purpose-built context editing tools for lossless context management and develops a post-training pipeline that constructs high-quality demonstrations of context management and improves model performance on both agentic search and c...

Xiao-Chuan Li, Ryan Ming, Meng Chu et al. · 1 citation
Preprint Aug 2026

BulkPR-Bench: Benchmarking Queue-Level Governance of Interacting Pull Requests

BulkPR-Bench is introduced, an executable benchmark in which an agent must recover consequential PR relations and return a large safe subset in executable order in executable order under a rolling-release protocol.

Ze-Tong Xiong, Qiao Zhao, Jun Zhang et al. · 0 citations
Jul 2026

PRO-LONG: Programmatic Memory Enables Long-Horizon Reasoning

Pro-LONG, a minimal context management framework built around programmatic memory for LLM agents in long-horizon, exploratory settings, is proposed, which addresses the tradeoff of preserving more information makes retrieving relevant details less tractable.

A. Fox, Jun-Lin Wang, P. Rosu et al. · 2 citations · ⚡1
Jul 2026

Mergeable Model-Side Aggregation States for Long-Context Language Models

A model-side aggregation interface is introduced that maintains compact Hash-based HyperLogLog sketch states alongside a frozen language model that improves over direct full-context reasoning over chain-of-thought reasoning.

Da-Chuan Song, Ju Yin, Ze-Chen Hu et al. · 1 citation
Preprint Jul 2026

Akashic: A Low-Overhead LLM Inference Service with MemAttention

This work proposes Akashic, a low-overhead memory system built around MemAttention, which organizes context into bounded chunks and models semantic relationships across chunks, preserving cross-chunk evidence without repeatedly rewriting the full history.

Yang Liu, ZhaoKai Luo, Huayi Jin et al. · 0 citations

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.