Structured memory helps AI agents beat Slay the Spire 2
AgenticSTS replaces a growing chat history with five organized memory layers, helping AI agents perform better in Slay the Spire 2. The results suggest that long-running agents may need cleaner memory systems more than larger prompts.
AI agents have struggled with Slay the Spire 2, a deck-building roguelike where a single run can stretch across hundreds of decisions. The AgenticSTS project, built at Alaya Lab with Shanghai Jiao Tong University and other institutions, tests a different idea: instead of showing the model its entire past conversation, rebuild each decision from structured memory.
Why the game is a hard test for AI agents
Slay the Spire 2 is useful as a benchmark because it creates long chains of choices. An agent has to choose cards, plan fights, select map routes, and decide when to buy items. The rules can be represented in text, but the game still includes high randomness and long runs.
That combination exposes a weakness in many language-model agents. A system may handle a single choice well, then become less reliable as more observations, tool calls, and reflections accumulate in the prompt. The more the agent carries forward, the more expensive and harder to manage the context becomes.
The baseline is also demanding. Human players win 16 percent of the time on the lowest difficulty level, A0, according to the developers. Frontier models used in the AGI-Eval assessment did not win a single game across five tested setups.
How AgenticSTS changes the memory problem
Common agent designs such as ReAct or Reflexion keep appending prior information to the next prompt. AgenticSTS takes the opposite route. The agent does not see its own chat log. Each decision is assembled from five named slots that hold different kinds of information.
- L1 stores fixed protocol instructions.
- L2 stores state schemas and currently valid actions.
- L3 stores retrieved game rules.
- L4 stores summaries of earlier runs.
- L5 stores strategy skills for specific situations.
That design forces any useful information from earlier decisions to be written into a specific place before it can matter later. It also keeps the active prompt from expanding just because a run is long. For researchers, the structure has another advantage: each layer can be studied separately, making it easier to see what is actually helping.
The skill layer made the biggest difference
In the main comparison, the team tested five setups, with ten runs each at A0. With no memory layers, the agent won 3 out of 10 games. When the L5 skill library was enabled, it won 6 out of 10 games.
The skill library stored tactical rules for repeated situations. The improvement appeared whether those skills were written by hand or generated from templates. The authors also cautioned that, with only ten runs per condition, the apparent doubling could be noise.
The L4 layer, which stores episodic memories from earlier runs, did not help at A0. It mattered more in a second test mode where the agent moved to the next higher difficulty after each win. With active memory that updated between runs, the agent reached levels A6 through A8. Without that active memory, runs stalled at A2 through A4.
The researchers also tested whether one model's memory could help another. They froze a memory stack accumulated by Gemini 3.1 Pro and gave it unchanged to two other models. Qwen 3.6-27B improved its average score by 84.5 percent, while Deepseek V4-Pro dropped by 18.1 percent. Neither model won a game, which suggests the stored memory may be closely tied to the model that produced it.
Token use shows why structure matters
The clearest contrast came from comparing AgenticSTS with two publicly available Slay the Spire 2 agents, STS2MCP and CharTyr. All agents used Gemini 3.1 Pro for strategic decisions. Neither competing agent won any of its 5 runs.
The resource gap was much larger than the win gap. For each point scored, the two competing agents sent 66 to 90 times as many tokens to the language model as AgenticSTS. In STS2MCP, one model call near the end of a game reached about 527,000 tokens because the full game history was resent for each decision. AgenticSTS kept the actual user text at around 5,000 tokens regardless of run length.
The accumulating agents also took four times as long to reach the same level. According to the provider's stats, 96 percent of that delay came from model latency rather than the surrounding control software.
The authors do not present this as a perfect ablation. STS2MCP and CharTyr differ from AgenticSTS in routing and decision batching as well as memory design. That means the comparison reflects the current public agent landscape, not the isolated effect of structured memory alone.
What remains unproven
The most important missing test is an accumulating-context agent inside the same codebase, scored the same way. The reported key metrics are based on 50 runs, and the experiments so far used one character, Silent, on one game version. Whether the approach holds for other characters and patches remains open.
The team is publishing 298 complete game runs, frozen memory snapshots, and evaluation scripts on Hugging Face. That should make it easier for other groups to test alternative memory architectures in the same environment.
The broader lesson is practical. Long-running AI agents do not only need more context. They need a way to decide what belongs in memory, where it should live, and when it should be retrieved. AgenticSTS points to one answer: replace the ever-growing transcript with clearly separated memory layers that keep decisions focused and measurable.
This fits a wider research push around efficient memory for AI agents. Growing chat logs can make systems slower, more costly, and less accurate, a problem researchers call context rot. AgenticSTS joins other approaches that move important information outside the active context window and bring it back only when needed.
Read next