AI Agents Win by Throwing Away the Chat Log

AI Agents Win by Throwing Away the Chat Log

Agentic AI

A research team got AI agents to win at Slay the Spire 2 — a game where frontier models previously scored zero wins — not by using a better model, but by deleting the chat log.

90x
fewer tokens per point scored compared to competing agent systems, by replacing growing transcripts with structured memory layers

What Happened

Researchers at Alaya Lab, Shanghai Jiao Tong University, and collaborating institutions built AgenticSTS, an architecture that replaces the standard approach of appending all past tool calls, observations, and reflections to each new prompt. That conventional approach — used by ReAct, Reflexion, and most production agent frameworks — creates what the team calls “context rot”: The Decoder reports that context windows balloon past 527,000 tokens mid-game under this model, making agents slower, more expensive, and less accurate as the session lengthens.

AgenticSTS replaces the growing log with a five-layer structured memory system. L1 holds fixed protocol instructions. L2 carries state schemas with valid actions. L3 provides retrievable game rules. L4 stores summaries of previous runs. L5 contains strategy skills learned for specific situations. Each decision rebuilds the prompt from these organized slots rather than appending to a transcript — keeping the working context at a stable ~5,000 tokens throughout the session.

The results: agents went from 3 wins out of 10 on the base difficulty to 6 wins out of 10 with the skill library enabled. With active post-run memory, agents reached difficulty A6–A8 — compared to A2–A4 without structured memory. Human players win 16% on the lowest difficulty; frontier models won 0% before this work. The test bed involved 298 complete game runs with evaluation scripts published on Hugging Face.

Why It Matters

Slay the Spire 2 requires hundreds of sequential decisions across an unpredictable run — making it a meaningful proxy for real long-horizon agent tasks. The finding isn’t specific to games. The same context-rot dynamic degrades agent performance in any extended workflow: multi-step code generation, iterative research, customer support escalations, complex data pipelines.

The deeper implication: agent performance often depends less on model capacity than on memory management. A weaker model with a well-structured memory layer can outperform a stronger model drowning in its own transcript. This is precisely the kind of infrastructure gap that makes the gap between agent demos and production-grade agent deployments so wide in practice.

The modular design of AgenticSTS also matters. By isolating five distinct memory layers, researchers can measure which component drives each improvement — a reproducibility standard that most agent benchmark papers don’t meet.

What This Means for Builders

Agent developers using ReAct-style architectures should audit their prompt growth patterns across session length. If context size is unconstrained, performance will degrade on any task requiring more than a few dozen sequential tool calls — regardless of which model powers the agent.

The AgenticSTS pattern maps cleanly to production environments: fixed system instructions (L1), structured state schemas (L2), a retrieval layer for reference material (L3), and a summary/learnable layer for cross-run context (L4–L5). None of these require a novel architecture — they require deliberate engineering that most rapid-prototype agent builds skip.

The So What

The winning move in long-horizon agent tasks isn’t a bigger context window — it’s a smaller one that’s better organized. Throwing away the chat log and replacing it with structured slots cuts token costs by two orders of magnitude and doubles task completion rates. For teams building agents that run for hours rather than seconds, the memory architecture deserves the same engineering attention as the model choice.

Source: The Decoder

Content created with AI assistance and reviewed for accuracy.

💬

Join the conversation

Stack Insiders is our free community for readers who want to go deeper — share resources, ask questions, and connect with others across every vertical we cover.

Join Stack Insiders →

Newsletter coming soon.

Curated digests across AI, biohacking, photography, travel, and more. Be the first to know when we launch.