MESA:Task-Adaptive Multi-Structure Evidence Selection for Long-Horizon Agent Memory
MESA is a task-adaptive framework that dynamically selects and fuses a query-specific subset of complementary memory structures for long-horizon agents, significantly improving performance and efficiency on the AMA-Bench by avoiding the noise of fixed-context approaches while enabling the composition of diverse evidence.
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
Imagine you are a detective trying to solve a mystery that happened over several days. You have a massive notebook filled with every single thing you did, saw, thought, and said. Some pages are just a quick summary of the day, others are a raw list of every footstep you took, some are a map of who you talked to, and others are a list of keywords you searched for. If you try to read the entire notebook to answer one simple question like "What time did I lose my keys?", your brain would get overwhelmed by too much information. But if you only read one specific page, you might miss a crucial clue hidden in a different section. This is the challenge facing modern "AI agents"—computer programs that act like digital assistants. They need to remember long chains of events to solve complex problems, but they often get lost in their own memories. Scientists have been trying to figure out the best way to organize these memories: should the AI read everything? Should it pick just one type of note? Or is there a smarter way?
This paper introduces a clever new system called MESA (Multi-structure Evidence Selection for long-horizon Agent) that acts like a super-smart librarian for these AI detectives. Instead of forcing the AI to read its entire notebook or blindly guessing which single page to look at, MESA learns to pick the perfect combination of notes for each specific question. Think of it like a chef who doesn't just grab the first spice jar they see or dump the whole spice rack into the pot. Instead, they taste the dish, realize it needs a little salt and a pinch of pepper, and grab exactly those two jars. The researchers tested this on a benchmark called AMA-Bench, which is like a giant test of how well AI can remember and reason over long periods. They found that MESA is much better at answering questions than previous methods. In fact, it got the right answer 8.5% more often than the best existing system, and it did so while reading 41% fewer words (or "tokens") from the memory. This suggests that being selective and mixing different types of memory views is the key to solving long-term puzzles, rather than just reading everything or picking just one thing.
The Problem: Too Much Noise, Not Enough Signal
Imagine you are playing a video game where you have to solve a puzzle that requires remembering something you did 50 steps ago. Your character has been running around, fighting monsters, talking to NPCs, and collecting items. If you ask the game, "Why did the door lock?" the answer might be buried in a tiny detail from 40 steps ago, like a specific key you dropped.
In the world of AI, these "steps" are called trajectories. They are long, messy chains of actions, observations, and thoughts. The problem is that these chains can be hundreds of steps long. If you feed the whole chain to an AI, it gets expensive and confusing. If you try to summarize it, you might lose the tiny detail that matters.
Scientists have tried to fix this by organizing memories into different "structures," or formats, just like organizing a messy room into different bins:
- Summaries: Like a diary entry that gives the "gist" of the day but skips the small details.
- Temporal Stores: Like a timeline or a calendar that keeps events in strict order.
- Knowledge Graphs: Like a web of connections between people and things, showing how they relate.
- Vector Databases: Like a search engine that finds things based on "vibe" or meaning, even if the words are different.
- Raw Traces: Like a security camera recording that shows every single move, but it's full of noise and hard to scan.
The big question was: Which bin should the AI open?
The Old Ways: Too Much or Too Little
Before MESA, there were two main ways AI tried to handle this:
- The "Read Everything" Approach: The AI would open all the bins at once and dump every single note into its brain. This is like trying to read your entire diary, your calendar, your map, and your security footage all at the same time to find out what you had for breakfast. It's too much information, and the important clues get lost in the noise.
- The "Pick One" Approach: The AI would try to guess which single bin was the best and only read that one. This is like deciding to only look at your calendar to find out what you ate for breakfast. You might miss the fact that you wrote a note about it in your diary.
The researchers discovered that neither of these extremes works well. Sometimes you need the timeline; sometimes you need the map; often, you need a mix of both. But the "best mix" changes depending on the question. A question about "what happened first" needs the timeline, while a question about "who talked to whom" needs the map.
The Solution: MESA, the Adaptive Librarian
MESA is a system that learns to be a dynamic librarian. It doesn't just pick one bin or open them all. Instead, it looks at the question and says, "Ah, this question needs a little bit of the timeline and a little bit of the map, but I can skip the raw video footage."
Here is how it works in simple terms:
- The Library: First, the AI builds all five different types of memory structures (Summary, Timeline, Map, Search, and Raw Video) from its history. These are all created beforehand and stay the same.
- The Selector: When a question comes in, a special "selector" part of the system (which MESA trains) decides which structures to use. It's like a smart assistant who looks at the question and picks the right tools.
- The Learning: The tricky part is teaching the selector. The system doesn't have a teacher telling it exactly which bins to pick for every question. Instead, it learns from the final result: "Did the AI get the right answer?" If the answer was wrong, the system tweaks its selection strategy. It uses a clever math trick called UCB (Upper Confidence Bound) to balance between trying new combinations (exploration) and sticking with what works (exploitation).
What They Found
The researchers tested MESA on AMA-Bench, a dataset full of long, complex tasks. They compared it against the best existing methods.
- Better Accuracy: MESA got the right answer 65.1% of the time, beating the previous best system (AMA-Agent) by 8.5%.
- Smarter Efficiency: Even though MESA was more accurate, it actually used 41% fewer words (tokens) from the memory to do it. This means it wasn't just reading more; it was reading better.
- No Single Winner: The study confirmed that there is no "one size fits all" memory structure. The best combination of memory types changes depending on the specific task and the specific question.
Why This Matters
This paper suggests that the future of AI memory isn't about building bigger and bigger libraries or just picking one type of note. It's about flexibility. Just like a human detective knows to check the calendar for dates, the map for locations, and the diary for feelings, an AI needs to know how to mix and match its different memory views to solve a problem.
MESA shows that by teaching an AI to be selective and adaptive, we can make it smarter and more efficient without needing to change how it thinks or how it stores its memories. It's a step toward AI that doesn't just have a lot of data, but knows exactly how to find the right piece of data when it matters most.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.