Context as an Environment: Programmatic Context Management for Long-Horizon Agents
- URL: http://arxiv.org/abs/2608.21690v1
- Date: Fri, 21 Aug 2026 23:39:19 GMT
- Title: Context as an Environment: Programmatic Context Management for Long-Horizon Agents
- Abstract summary: We present Scroll, a context manager that treats each agent session as an executable Session Environment.<n>The kernel maintains a typed across model calls, allowing tool outputs, retrieved history, and derived state to be bound to variables.
- Score: 47.21335299084925
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: 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 manager that treats each agent session as an executable Session Environment. The environment is backed by an append-only Event Log and a sandboxed, persistent Python kernel. The kernel maintains a typed namespace across model calls, allowing tool outputs, retrieved history, and derived state to be bound to variables rather than serialized into the prompt at each call. Model-written code searches, materializes, and transforms session state through exec; only explicitly printed projections enter the model's working view for the next call. Context management thus becomes a programming task that inherits the improving coding abilities of LLMs, while the Event Log preserves lossless historical ground truth. As the working view approaches its budget, stale spans are evicted but remain recoverable: an eviction index keeps compact landmarks tied to exact Event Log addresses, so that the agent navigates directly to evicted regions instead of searching the full log. With Qwen3.8-Max as the backbone, Scroll achieves 94.8% on LongMemEval_S; 73.1% on BEAM_10M, surpassing the best published memory system by 5.1 points; and 86.7% on LOCA_256K, exceeding the best published long-horizon agent by 37.4 points.
Related papers
- ESAA-Conversational: An Event-Sourced Memory Layer for Continuity, Handoff, and Curation Across Heterogeneous LLM Coding Agents [0.0]
This paper presents emphA-contextal, a domain of EventSourcing Agent Architecture (ESAA)<n>We show that heterogeneous agents can collaborate through a shared log without a direct agent-to-agent channel, while the public distribution preserves privacy by excluding the private conversational history.<n>A self-referential case study with 570 development-lab events shows that heterogeneous agents can collaborate through a shared log without a direct agent-to-agent channel, while the public distribution preserves privacy by excluding the private conversational history.
arXiv Detail & Related papers (2026-06-22T01:02:24Z) - PACMS: Submodular Context Selection as a Pluggable Engine for LLM Agents [0.9134244356393664]
LLM agents operate over a context window that fills from several directions simultaneously.<n>The prevailing mechanism is recency truncation, sometimes paired with periodic summarization.<n>Retrieval augmented generation fetches external documents into the prompt but does not arbitrate the agent's emphalready-present pooled context.
arXiv Detail & Related papers (2026-06-18T10:22:57Z) - OpenRath: Session-Centered Runtime State for Agent Systems [2.9568259440852]
OpenRath is a PyTorch-like programming model for multi-agent, multi-session systems.<n>Session is branchable, inspectable, replayable, backend-aware, and composable.<n>Report presents the programming model, architecture, audited milestones, and evidence protocol.
arXiv Detail & Related papers (2026-06-17T15:19:19Z) - TokenMizer: Graph-Structured Session Memory for Long-Horizon LLM Context Management [0.0]
We present TokenMizer, an open-source proxy system that models large language model sessions as a typed knowledge graph.<n>It produces resume blocks averaging 78 tokens (range: 42-124) - 2x smaller than evaluated baselines.<n>Across all sessions, TokenMizer mean task recall 51.0%, decision recall 46.6%, and file recall 58.7%.
arXiv Detail & Related papers (2026-06-04T16:12:28Z) - Scaling Self-Evolving Agents via Parametric Memory [69.96398842169002]
Existing memory-augmented LLM agents store past experience exclusively in prompt space.<n>We introduce textttTMEM, a self-evolving parametric memory framework.<n>textttTMEM consistently outperforms summary-based and retrieval-based baselines across different model scales.
arXiv Detail & Related papers (2026-06-03T07:18:31Z) - Mem-W: Latent Memory-Native GUI Agents [50.87647372904382]
We introduce Mem-W, a series of latent-memory-native GUI agents that treat memory as part of the agent's continuous context.<n>Across four web and mobile navigation benchmarks, Mem-W consistently improves diverse backbones and memory-enhanced baselines.
arXiv Detail & Related papers (2026-05-10T04:31:23Z) - ClawMark: A Living-World Benchmark for Multi-Turn, Multi-Day, Multimodal Coworker Agents [77.22389710754452]
We introduce bench, a benchmark for coworker agents built around multi-turn multi-day tasks.<n>The current release contains 100 tasks across 13 professional scenarios, executed against five stateful sandboxed services.<n>The strongest model reaches 75.8 weighted score, but the best strict Task Success is only 20.0%, indicating that partial progress is common.
arXiv Detail & Related papers (2026-04-26T16:05:02Z) - GenericAgent: A Token-Efficient Self-Evolving LLM Agent via Contextual Information Density Maximization (V1.0) [56.81743709880371]
Long-horizon large language model (LLM) agents are fundamentally limited by context.<n>We argue that long-horizon performance is determined not by context length, but by how much decision-relevant information is maintained within a finite context budget.<n>We present GenericAgent (GA), a general-purpose, self-evolving LLM agent system built around a single principle: information density and context.
arXiv Detail & Related papers (2026-04-18T17:59:15Z) - AgentSys: Secure and Dynamic LLM Agents Through Explicit Hierarchical Memory Management [47.49917373646469]
Existing defenses treat bloated memory as given and focus on remaining resilient.<n>We present AgentSys, a framework that defends against indirect prompt injection through explicit memory management.
arXiv Detail & Related papers (2026-02-07T06:28:51Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.