Structured Turn Memory: Slot-Aware Storage, Compression, and Retrieval for Long-Horizon Language Agents
Abstract
Large Language Model (LLM)-based agents that operate over extended horizons must store, compress, and retrieve interaction histories to sustain coherent planning across sessions and long reasoning chains. Existing memory systems treat each turn as a monolithic text block, so compression loses critical information, particularly the tool-call outputs, action decisions, and reasoning traces that constitute the structural spine of agent workflows. We propose **Structured Turn Memory (STM)**, a framework that decomposes each agent turn into four semantically typed slots: *Observation*, *Reasoning*, *Action*, and *Outcome*, and uses these slots as the unit of storage, compression, and retrieval. A rate-distortion analysis shows that slot-aware compression needs a lower rate than task-agnostic monolithic summarization whenever the gain from task-weighted allocation exceeds the redundancy among slots, a condition that holds with a wide margin on real agent traces. On four benchmarks spanning inter-session memory (LoCoMo, multi-session WebArena) and intra-session long-horizon memory (SWE-Bench Pro, Terminal-Bench 2.0), STM yields consistent improvements over strong baselines including Mem0, A-Mem, REMem, and Agent Workflow Memory: memory recall F1 on LoCoMo, task success rate on WebArena, on SWE-Bench Pro, and on Terminal-Bench 2.0. STM also outperforms the recent context managers MEM1, AgentFold, and GAM, and compared with keeping the full context, it offers a better cost-quality trade-off when histories fit in the window and larger gains when they do not. Ablations show that every slot contributes, with the action slot most critical for agentic tasks, and slot typing also improves existing memory systems.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.