Stop Dumping Agent Memory Into The Prompt

Most developers build agent loops by appending everything to the next prompt.

You add prior observations, tool calls, and reasoning traces. You keep adding data until the prompt becomes a junk drawer. The model sees more, but you lose control. You no longer know which piece of memory caused a specific decision.

A new paper called AgenticSTS suggests a different path. It treats memory as an interface instead of a contest for the largest context window.

The paper uses the game Slay the Spire 2 as a testbed. This environment requires hundreds of strategic decisions. It is not a simple chat bot.

The core idea is this: Memory is a contract about what a future decision is allowed to see.

Instead of raw transcripts, the authors compose fresh prompts using five specific layers:

  • Fixed protocol instructions
  • Current state and action schemas
  • Retrieved game rules
  • Summaries from prior runs
  • Triggered strategic skills

This structure changes everything. You can inspect, freeze, or disable each layer. You turn memory from a pile of data into selected evidence.

Many production agent failures are not model failures. They are context failures. The agent mixes old state with new state or carries outdated reflections forward. If your only policy is to append more text, debugging feels like archaeology.

A typed memory interface gives you something to compare.

For long-running agents, a huge context window is a trap. It becomes a mix of facts, outdated facts, and failed attempts. The bigger the window, the easier it is to mistake sediment for memory.

To build better agents, follow these patterns:

  • Separate stable instructions from current state
  • Keep rules in a retrieval layer
  • Store experience as explicit records, not chat residue
  • Turn repeated fixes into triggered skills
  • Make every memory layer removable for testing

If you cannot turn a memory layer off, you do not know if it actually helps. You only know the whole pile works sometimes.

Stop treating agent memory as a vibes layer. Move toward a system where you know exactly what goes into the next decision, where it came from, and how to disable it.

If your agent cannot explain what it was allowed to remember, it does not have memory. It just has a prompt with a basement.

Source: https://dev.to/komo/stop-dumping-agent-memory-into-the-prompt-58ka

Optional learning community: https://t.me/GyaanSetuAi