- AI Engineering
- Posts
- Programmable Context for Long-Running Agents
Programmable Context for Long-Running Agents
... PLUS: Give Every AI Agent Its Own Browser Space
In today’s newsletter:
Programmable Context for Long-Running Agents
Give Every AI Agent Its Own Browser Space
Reading time: 5 minutes.
Long-running agents eventually have to decide which parts of their history to keep. Most harnesses make that decision by summarizing old turns, dropping tool outputs, or extracting selected facts into a memory store.
Alibaba researchers built Scroll around a different rule. Scroll keeps the full session outside the prompt and lets the agent write Python to decide which parts should enter the next model call.
The important difference is timing. Most memory systems decide what survives when information is stored. Scroll waits until the agent knows what the current task requires.
Memory Systems Decide Too Early
The obvious response is that a better summary or memory schema should preserve the important information.
The problem is that you don't know what will be important later. A memory pipeline might store a user's latest preference while discarding the previous value. If the agent is later asked when that preference changed, it needs both values in their original order.
Scroll avoids that early commitment with an append-only Event Log. Every user message, model response, tool call, and tool result receives a stable address and remains recoverable in its original form.
Summaries can still help the agent navigate. They just never replace the underlying records.
The Session Becomes an Executable Environment
Keeping the complete history creates another problem. The model still can't read millions of tokens on every call.
Scroll solves this with a sandboxed Python kernel that persists throughout the session. Retrieved records, tool outputs, and derived state remain available as typed variables instead of being converted back into prompt text after every step.
The agent constructs its working context through four operations:
Locate. Search the Event Log for relevant records.
Materialize. Load exact events or complete ranges using their addresses.
Compute. Filter, join, compare, or aggregate the retrieved state with Python.
Expose. Print only the result that should enter the next model call.
That last boundary is what keeps the prompt small. A tool might return thousands of flight options, but the full result stays inside the kernel. The agent can filter those options against preferences from earlier conversations and print only the few that matter.
The prompt becomes a temporary view over the session rather than the place where the entire session must live.
Eviction Leaves a Map Back
The working view still fills up during a long task, so Scroll evicts older spans when the token budget gets tight. The original events remain untouched in the Event Log.
An eviction index leaves compact headlines tied to the exact addresses of removed events. Instead of searching the entire history and hoping for a keyword match, the agent can navigate directly back to the relevant region and recover the original records.
The reported results show where this design helps:
LongMemEval_S. Scroll scored 94.8% with Qwen3.8-Max.
BEAM_10M. Scroll scored 73.1, which is 5.1 points above the best previously published memory-system result.
LOCA_256K. Scroll reached 86.7% while a summarization agent using the same model scored 65.3% and a retrieval agent scored 66.7%.
Scroll also processed a median of 105K input tokens per BEAM_10M task. That is roughly 1% of the complete 10-million-token history.
Stronger coding models benefited more from Scroll on complex tasks because they wrote better retrieval and aggregation programs. Scroll therefore moves context selection from fixed ingestion rules into code written when the question arrives.
As coding models improve, the same harness can become better at finding, combining, and exposing session history without requiring another memory schema rewrite.
Browser agents usually force you to choose between two awkward setups. A separate browser protects your tabs but loses your logged-in sessions. An extension can reuse those sessions, but the agent competes with you for the same tabs and focus.
Ego Lite takes a different route. It runs agent tasks inside isolated Spaces within the same local Chromium browser, allowing agents to reuse authenticated sessions without taking over the pages you’re using.
That browser architecture changes how agents authenticate, run tasks in parallel, and spend tokens on browser automation.
One Browser With Separate Agent Spaces
Each task runs inside its own native BrowserContext. The agent gets separate tabs, cookies, and storage while sharing Ego Lite’s browser process and login environment.
The obvious question is why you wouldn’t launch a separate Chromium instance for every task. The problem is that every instance adds processes and usually needs a copied browser profile to access your existing sessions.
The Ego Lite team tested six concurrent blank sessions using both approaches:
Separate browser instances. About 15GB of additional memory, 84 processes, and 2.5 seconds to start.
Ego Lite Spaces. About 0.9GB of additional memory, six processes, and 0.6 seconds to start.
Spaces also give the human and agent a clear handoff. The agent can pause when it reaches a CAPTCHA, payment confirmation, or login challenge. You take control inside that Space, complete the blocked step, and return control without exposing a password or verification code to the model.
Use Fewer Browser Round Trips
Browser automation usually puts the agent in a costly loop. It inspects the page, calls one tool, reads the result, and returns to the model before taking the next action.
Ego Lite lets the agent group several browser actions into one program. Its Snapshot system also converts the accessibility tree into a few hundred tokens of semantic text instead of sending the full page HTML.
Fewer model round trips and smaller page snapshots reduce both runtime and token usage.
That’s all for today. Thank you for reading today’s edition. See you in the next issue with more AI Engineering insights.
PS: We curate this AI Engineering content for free, and your support means everything. If you find value in what you read, consider sharing it with a friend or two.
Your feedback is valuable: If there’s a topic you’re stuck on or curious about, reply to this email. We’re building this for you, and your feedback helps shape what we send.
WORK WITH US
Looking to promote your company, product, or service to 200K+ AI developers? Get in touch today by replying to this email.

