SIAgentNews.com
← All news

Contexture trims AI agents' memory use by dropping outdated tool results

A new arXiv paper says agent servers can fit more work on the same GPUs by discarding history that later steps made obsolete, with small accuracy cost.

· First reported by arXiv

20-73%Throughput gain under SLO over the best baseline

The short version

  • Agents like Hermes, OpenClaw and Codex resend growing histories, which strains the shared GPU memory that serving depends on.
  • The authors traced tokens to tool operations and flagged 64% of recorded final-history tokens as removal candidates.
  • Throughput under SLO rose 20-73% over the best of four baselines; GPU energy per session fell by up to 11%.
  • Live-agent tests showed a mean accuracy gain of 1.4 points and a worst case loss of 3.7 points.
  • No extra model calls or training are needed, and the harness and model code stay unchanged.

Why it matters

Memory, not raw compute, is often what caps how many agents a GPU can serve at once. If a method frees that memory without hurting answers, the cost of running long-lived agents can come down. That matters most to teams hosting agents, and it can eventually reach anyone paying for them.

The memory bill agents run up

A paper posted to arxiv.org describes a system called Contexture, built for companies or teams that run AI agents for many users at once. The starting problem is simple. Agents such as Hermes, OpenClaw and Codex repeatedly resend a growing record of everything they have done so far.

That record has to live somewhere while the model works with it. On a GPU it sits in the key-value cache, or KV cache, a store of intermediate results the model keeps so it does not recompute earlier text. It lives in the chip's high-bandwidth memory (HBM), a fast but limited resource shared by every session on that GPU.

The authors show that this shared capacity limits how much work an agent-serving system can complete. Each session that holds on to a long history crowds out others.

Why existing fixes fall short

The paper says two families of tools already try to help, and each is missing something. Methods that shrink an agent's context lack a view of the whole cache, so they cannot tell how much memory pressure the server is under. Runtime managers that do watch the cache lack knowledge of what the agent's tools actually did.

Contexture is built to combine both views. It pairs information about tool execution with global visibility into shared cache pressure and into which prompt beginnings are still stored. The authors call it harness- and model-agnostic. A harness is the software wrapper that runs the agent loop, and Contexture works without changing it or the model.

Finding what can safely go

The key observation comes from tracing tokens back to the tool operation that produced them. Later operations often supersede earlier outputs, along with the turns tied to them. Once something has been replaced by newer information, the older version is a candidate for removal.

By this measure, 64% of the tokens in the recorded final histories were removal candidates. That is a large share of memory holding material the agent no longer needs.

Contexture keeps the harness's full conversation history separate from the execution context the model actually sees. Removing items from the model's context shrinks later requests' memory demand, while the harness still holds the complete record.

Deciding when to cut

Removing text is not free. When context changes, the stored cache for the changed prompt can no longer be reused, and the server must recompute it. That recomputation, called re-prefill, can interfere with other sessions that are busy generating answers.

So Contexture does not simply cut whenever it can. Supersession identifies what could go, and the live state of the server decides when removal is worth giving up cached work. The authors say this reduces memory demand and the memory traffic during answer generation, while limiting that interference. It does so without extra model calls or training.

What the results show

The tests covered two models, two harnesses and two benchmarks. Throughput under SLO, meaning how much work gets done while still meeting a response-time target, improved by 20-73% over the best of four alternatives: no eviction, the harness's own compaction, AgentDiet and Continuum. Against a simpler method called observation masking, the gain was 7-63% in five of eight configurations. Over LMCache alone on H100 GPUs, it was 23%. GPU energy per completed session fell by up to 11%.

Accuracy is the trade-off to check. In live-agent experiments, Contexture's mean accuracy was 1.4 percentage points higher than unloaded no eviction, with a worst-case loss of 3.7 points. Observation masking lost 3-28 points.

This is a preprint reporting the authors' own experiments, so independent replication would be the next step. The numbers also come from specific setups, and results on other models or workloads may differ.

What to watch

  • Will other teams reproduce the throughput gains on different models, harnesses and workloads?
  • How large is the accuracy loss in the worst cases, and which kinds of tasks suffer it?
  • Will serving tools adopt this kind of tool-aware eviction in practice?

Try it

If you run agents, pick one session log and count how many tool outputs were later replaced by newer results. That gives a rough sense of how much of your history is stale.

Sources and links

Written by the SI Agent News Desk from the reporting above.Written with AI from the source above. Every number is checked against the source. Spot a mistake? Corrections.

Liked it? Say why

Add a line for other readers.

No account needed. We never show your email. Comments with links, ads or abuse are held and not shown. Your comment shows after a quick check.

More AI news