Source-led article
AI Agents Master ‘Slay the Spire 2’ with Structured Memory, Reducing Token Use by 90x

A new research project, AgenticSTS, has enabled AI agents to achieve significant success in the complex digital card game ‘Slay the Spire 2’ by rethinking how these agents manage information. Instead of relying on ever-expanding chat logs, the AgenticSTS project utilizes a structured memory architecture with five distinct layers, dramatically improving efficiency and performance.
The conventional approach for Large Language Model (LLM) agents, such as ReAct or Reflexion, involves appending past observations, tool calls, and self-reflections to subsequent prompts. This leads to context windows that continuously grow, eventually overflowing or diluting the model’s attention. AgenticSTS counters this problem by keeping prompts consistently short, around 5,000 tokens, even as game sessions lengthen, a stark contrast to other agents that can see prompts balloon past 500,000 tokens.
The Memory Architecture Explained
The core innovation of AgenticSTS lies in its five-layered memory system. Each decision an agent makes is informed by a prompt freshly built from these distinct slots:
- L1: Fixed Protocol Instructions – Core operational guidelines for the agent.
- L2: State Schemas – Information on currently valid actions within the game.
- L3: Retrieved Game Rules – Specific rules relevant to the current game state.
- L4: Summaries of Previous Runs – Episodic memories from past game sessions.
- L5: Strategy Skills – Tactical rules triggered for specific game situations.
This structured approach ensures that only relevant information is presented to the agent for each decision, preventing context overload and diluting attention. Any information the agent needs to carry forward must be explicitly written into one of these storage areas.
Performance Against Traditional Agents
In tests conducted on ‘Slay the Spire 2,’ a game notorious for its difficulty even for human players (with a 16% win rate on the lowest difficulty A0), frontier models in the AGI-Eval assessment failed to win a single game. AgenticSTS, however, demonstrated a remarkable win rate. Without any memory layers, the agent won 3 out of 10 games. Crucially, with the L5 skill library activated, storing tactical rules for recurring situations, the win rate jumped to 6 out of 10 games. This performance holds whether skills were manually written or generated from templates.
The project also compared AgenticSTS to two publicly available ‘Slay the Spire 2’ agents, STS2MCP and CharTyr, which follow the classic growing-transcript pattern. While all agents used Gemini 3.1 Pro for strategic decisions, neither competitor won any of their 5 runs.
Key facts:
| Feature | AgenticSTS | Traditional LLM Agents (e.g., STS2MCP) |
|---|---|---|
| Memory Management | Structured, five layers | Growing chat logs |
| Token Usage (approx.) | 5,000 tokens (consistent) | 500,000+ tokens (grows with game) |
| Win Rate (Slay the Spire) | 60% (with L5 skills) | 0% (in comparative tests) |
| Processing Time | Significantly faster (4x less than others) | Slower due to context window growth |
Efficiency and Cost Implications
Beyond winning games, AgenticSTS showcased significant efficiency gains. For every point scored by the competing agents, they sent 66 to 90 times more tokens to the language model than AgenticSTS. This massive reduction in token usage translates directly into lower operational costs and faster processing times. The accumulating agents took four times longer to reach the same game level, with 96% of that time loss attributed to model latency.
While the study acknowledges that STS2MCP and CharTyr also differ in routing and decision batching, the stark contrast in token use and performance highlights the benefits of the structured memory approach. The research team has made 298 complete game runs, frozen memory snapshots, and evaluation scripts available on Hugging Face, allowing other researchers to explore alternative memory architectures.
This development is important for Indian businesses and AI developers because it points to a practical solution for optimizing AI agent performance and reducing computational costs. As India’s AI landscape expands, efficient memory management will be crucial for deploying scalable and affordable AI applications across various sectors. The ‘context rot’ problem, where growing chat logs make models slower, more expensive, and less accurate, is a known challenge that this research directly addresses.
Source: The Decoder (https://the-decoder.com/ai-agents-win-at-slay-the-spire-2-after-researchers-replace-growing-chat-logs-with-structured-memory/)