mlsanityData to 14 Oct 2026

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

arXiv 2608.21690 ↗First posted 21 Aug 2026cs.AIcited by 4

On the map: LLM agents and tool use → Agent memory systems

Abstract (arXiv)

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.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 24 of its 40 references that are in the map. First posted on arXiv 21 Aug 2026.

Builds on

24 of 40 references.

Closest ancestors · 7

Same direction, newest first

  1. 2026Mandol: An Agglomerative Agent Memory System for Long-Term Conversations29 Jun
  2. 2026The Log is the Agent: Event-Sourced Reactive Graphs for Auditable, Forkable Agentic Systems21 May
  3. 2025Remember Me, Refine Me: A Dynamic Procedural Memory Framework for Experience-Driven Agent Evolution11 Dec
  4. 2025AgentFold: Long-Horizon Web Agents with Proactive Context Management28 Oct
  5. 2025ACON: Optimizing Context Compression for Long-horizon LLM Agents1 Oct
  6. 2025MEM1: Learning to Synergize Memory and Reasoning for Efficient Long-Horizon Agents18 Jun
  7. 2025Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory28 Apr

Other references · 17

  1. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  2. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  3. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,737
  4. 2023MemGPT: Towards LLMs as Operating Systemscited by 1,389
  5. 2024LongMemEval: Benchmarking Chat Assistants on Long-Term Interactive Memorycited by 707
  6. 2025BrowseComp: A Simple Yet Challenging Benchmark for Browsing Agentscited by 647
  7. 2024Executable Code Actions Elicit Better LLM Agentscited by 564
  8. 2023Cognitive Architectures for Language Agentscited by 429
  9. 2025DeepResearcher: Scaling Deep Research via Reinforcement Learning in Real-world Environmentscited by 286
  10. 2025NoLiMa: Long-Context Evaluation Beyond Literal Matchingcited by 126
  11. 2025A Survey of Context Engineering for Large Language Modelscited by 126
  12. 2025Recursive Language Modelscited by 104
5 more
  1. 2025Beyond a Million Tokens: Benchmarking and Enhancing Long-Term Memory in LLMscited by 60
  2. 2026MEMENTO: Teaching LLMs to Manage Their Own Contextcited by 18
  3. 2026LOCA-bench: Benchmarking Language Agents Under Controllable and Extreme Context Growthcited by 14
  4. 2026User as Code: Executable Memory for Personalized Agentscited by 7
  5. 2026LCM: Lossless Context Managementcited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 4.

4 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Beyond Compaction: Structured Context Eviction for Long-Horizon Agents
  2. 2026LLM Agents Are Latent Context Managers: Eliciting Self-Managed Context via State Proprioception
  3. 2025Context as a Tool: Context Management for Long-Horizon SWE-Agents
  4. 2026ContextRender: From Execution Dependencies to Agent Context
  5. 2026ContextWeaver: Selective and Dependency-Structured Memory Construction for LLM Agents
  6. 2026PRO-LONG: Programmatic Memory Enables Long-Horizon Reasoning
  7. 2026ContextPipe: Database-Inspired Context Assembly for Long-Horizon Agents
  8. 2025AgentProg: Empowering Long-Horizon GUI Agents with Program-Guided Context Management