← Latest papers
🤖 AI

SAM: State-Adaptive Memory for Long-Horizon Reasoning Agent

The paper proposes State-Adaptive Memory (SAM), a standalone framework that enhances long-horizon agentic reasoning by consolidating interaction histories into compact, intent-driven memory cues that allow agents to dynamically reconstruct distant information without retraining the underlying model, achieving superior performance across diverse benchmarks.

Original authors: Yuyang Hu, Hongjin Qian, Shuting Wang, Jiongnan Liu, Ziliang Zhao, Jiejun Tan, Zheng Liu, Zhicheng Dou

Published 2026-05-26
📖 5 min read🧠 Deep dive

Original authors: Yuyang Hu, Hongjin Qian, Shuting Wang, Jiongnan Liu, Ziliang Zhao, Jiejun Tan, Zheng Liu, Zhicheng Dou

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Problem: The "Too Long to Read" Notebook

Imagine you are a detective trying to solve a very complex mystery that takes days to crack. Every time you find a clue, talk to a witness, or check a document, you write it down in a giant notebook.

As the days go by, your notebook becomes huge—hundreds of pages long. When you need to make a decision today, you have to flip through all those pages to find the one tiny clue you found three days ago.

The current problem: Most AI agents (computer programs that act like humans) try to solve this by either:

  1. Throwing away old pages: They delete the beginning of the notebook to make room for new ones. But sometimes, the answer was in the part they threw away!
  2. Writing a summary: They try to condense the whole history into a short paragraph. But summaries often miss the tiny, specific details needed to solve the puzzle later.

The Solution: SAM (State-Adaptive Memory)

The authors propose a new system called SAM. Think of SAM not as a notebook, but as a smart filing cabinet with a magical index card system.

Here is how it works, broken down into three simple steps:

1. The "Filing" (Consolidation)

Instead of keeping the raw, messy pages of your conversation in your immediate workspace, SAM takes a chunk of your recent history (say, the last 50 pages) and files it away in a storage cabinet.

  • The Raw Pages: The actual details are kept safe in the cabinet, untouched.
  • The Index Card: SAM writes a tiny, high-quality "index card" (called a memory cue) that summarizes what happened in those 50 pages. It highlights the important stuff: "We found a suspect," "We ruled out the butler," or "We are stuck on this clue."
  • The Result: Your immediate workspace stays clean and light, but you still have a list of index cards telling you what's in the cabinet.

2. The "Search" (Intent-Driven Recall)

This is the magic part. In old systems, if you needed information, you might just grab the most recent pages or read the whole summary.
With SAM, the agent asks itself: "What do I need right now to solve this specific problem?"

  • If the agent is stuck on a clue about a "red car," it looks at its index cards.
  • It picks the specific card that mentions the red car.
  • It asks the filing cabinet: "Bring me the exact pages related to that red car."
  • The system retrieves only those specific pages, re-reads them, and gives the agent a fresh, focused summary of just that information.

The Analogy: Imagine you are cooking a complex meal. Instead of reading the entire 500-page cookbook every time you need to know how to chop an onion, you have a set of index cards. When you need to chop an onion, you pull the "Onion" card, which tells you exactly which pages to flip to in the big book to get the recipe. You don't read the whole book; you only read what you need.

3. The "Training" (Learning to be a Better Librarian)

The paper also explains how they taught this system to be smart. They didn't just tell the AI to "summarize." They trained it in two ways:

  • The Expert Teacher: They used super-smart AI models to show the system how to write the best possible index cards and how to find the right pages.
  • The "Try and Learn" Game: They let the system play the detective game thousands of times. If the system picked the wrong card or missed a clue, it got a "bad score." If it picked the right card and solved the mystery, it got a "good score." Over time, it learned exactly how to manage its memory to win the game.

Why This Matters (The Results)

The authors tested SAM on four difficult "long-horizon" tasks (like searching the web for complex facts or solving scientific puzzles).

  • The Outcome: SAM consistently beat other methods.
  • The Reason: It didn't just throw away old info, and it didn't just summarize it. It kept the raw data safe and created a smart way to retrieve exactly what was needed based on the current situation.
  • The Analogy: It's like the difference between a student who memorizes a textbook (and forgets details) versus a student who has a perfect library system where they can instantly find the exact paragraph they need to answer a specific question.

Summary

SAM is a new way for AI to handle long conversations. Instead of trying to remember everything at once or forgetting the past, it organizes history into a filing system. It keeps the raw details safe and uses smart index cards to pull up only the specific information needed for the current decision. This allows the AI to solve much harder, longer problems without getting confused or losing track of the clues.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →