ContextPipe: Database-Inspired Context Assembly for Long-Horizon Agents
Peng XuZuyu ZhangYuze SunFeng TianLong WangChen Zhang
Peng Xu
Zuyu Zhang
Yuze Sun
Feng Tian
Long Wang
Chen Zhang
+6
ContextPipe treats context assembly for long-horizon LLM agents as a database query execution problem. It introduces a five-phase pipeline (Plan, Bind, Optimize, Execute, Feedback) with a structured catalog, a cache-aware optimizer, and an EXPLAIN ANALYZE trace. On SWE-bench Pro Qutebrowser, ContextPipe reduces token volume by 31%, LLM calls by 23%, and response time by 9% versus an append-only policy, while making context auditable, replayable, and failure-isolated.

arXiv ·
· September 1, 2026