AI agents win at Slay the Spire 2 after researchers replace growing chat logs with structured memory

AI Agents Master Slay the Spire 2 by Ditching Growing Chat Logs for Structured Memory

Researchers have developed AI agents that achieved superior performance in Slay the Spire 2 by replacing the traditional approach of accumulating lengthy chat logs with a structured memory system. The breakthrough demonstrates how limiting and organizing information can dramatically improve an AI’s decision-making in complex, turn-based strategy games.

The study, conducted by a team of AI researchers, focused on the popular deck-building roguelike Slay the Spire 2. Previous AI attempts relied on continuously expanding chat logs, which quickly became unwieldy and degraded performance. The new structured memory approach stores only the most relevant tactical information, enabling the agent to plan many moves ahead with far less computational overhead.

The Memory Problem

Standard AI agents in strategy games often use a growing log of past observations and actions. This approach suffers from two major flaws:

  • Information overload — As the game progresses, the chat log expands linearly, burying critical decisions under thousands of irrelevant entries. The agent cannot easily distinguish what matters.
  • Attention dilution — Models that process long sequences struggle to maintain focus on key context. The agent’s “working memory” becomes cluttered, leading to suboptimal plays.

In Slay the Spire 2, where each turn involves choosing cards, managing health, and predicting enemy patterns, this memory clog becomes a death sentence. The AI would often lose track of enemy attack patterns or miss synergies between cards because relevant data was buried in the log.

Structured Memory Solution

The researchers replaced the monolithic chat log with a structured memory module that stores only essential game state information in a compact, queryable format. This module functions like a human player’s mental notes:

  • Key data points are extracted — Health totals, enemy intent, deck composition, and relic effects are stored in named fields rather than free-form text. This makes retrieval instant and reliable.
  • Irrelevant history is discarded — Past turns that no longer influence the current state are pruned. Only the last few turns plus persistent game elements remain.
  • Context is rebuilt each turn — The agent receives a concise summary of the relevant past plus the current board state, rather than a raw feed of everything that ever happened.

“The structured memory allows the agent to focus on the tactical present without forgetting crucial long-term information,” the researchers noted. “It mimics how a human player naturally forgets early-game card draws but remembers their current hand and enemy behavior.”

This design reduced the input token count for the AI’s decision-making model by over 80%. Instead of processing tens of thousands of tokens per turn, the agent now worked with a compact few hundred.

Results and Implications

The structured-memory agents consistently outperformed their growing-chat-log counterparts across multiple difficulty levels in Slay the Spire 2. Key results include:

  • Higher win rates — The new agents completed runs at Ascension 15 (the highest difficulty) with a 62% success rate, compared to 18% for the log-based approach.
  • Faster decision time — Turn processing speed improved by 3.5x because the model had less data to parse. The AI could evaluate more potential moves in the same time frame.
  • Better resource management — The agent learned to conserve health and cards more effectively, demonstrating human-like strategic patience rather than frantic survival tactics.

The researchers argue this approach has implications far beyond card games. Structured memory could improve AI in domains like robotics, where sensors produce endless streams of irrelevant data, or in autonomous planning, where too much history leads to analysis paralysis.

By intentionally forgetting the unnecessary, the AI gains clarity. The lesson for developers is clear: more data is not always better. Organizing and pruning memory to preserve only what matters can unlock intelligence that raw scale cannot.

What are your thoughts on this? I’d love to hear about your own experiences in the comments below.

Gnoppix is the leading open-source AI Linux distribution and service provider. Since implementing AI in 2022, it has offered a fast, powerful, secure, and privacy-respecting open-source OS with both local and remote AI capabilities. The local AI operates offline, ensuring no data ever leaves your computer. Based on Debian Linux, Gnoppix is available with numerous privacy- and anonymity-enabled services free of charge.