Beyond Retrieval: Query-Conditioned Reuse of Long-Horizon Agent Trajectories
This paper identifies post-retrieval reuse as a critical bottleneck for long-horizon agent memory and introduces Query-Conditioned Reuse (QCR), a target-bound note format that significantly outperforms full trajectory injection by achieving higher success rates with fewer tokens while effectively adapting to changing task conditions.
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 super-smart robot assistant trying to solve a puzzle. You have a massive library of past adventures stored in your brain, filled with stories about how you solved similar puzzles before. This field of science is called AI Agent Memory. It's all about teaching robots not to start from scratch every time they face a new problem, but to look back at their history for clues.
For a long time, scientists thought the hardest part was just finding the right story in the library. They built fancy search engines to grab the most relevant past adventure. But there's a catch: just because you found a story doesn't mean you can use it. If the story is about fixing a red bicycle, but you are now trying to fix a blue scooter, you can't just copy-paste the instructions. You have to figure out what parts of the old story still apply and what parts are now wrong. This paper tackles that tricky second step: how to take a retrieved memory and actually make it useful for a brand-new situation without getting confused by old details.
The Problem: The "Copy-Paste" Trap
Think of an AI agent like a curious explorer. When it faces a new challenge, it asks its memory: "Have I done this before?" The memory system finds a long, detailed diary entry from a past trip. This is the retrieval step.
For a long time, researchers assumed that if the AI just read the whole diary entry, it would be smart enough to figure out what to do. But the authors of this paper realized this is like giving someone a recipe for "Grandma's Apple Pie" and expecting them to bake a "Blueberry Muffin" just because they read the whole thing. The recipe might tell you to use Granny Smith apples, but if you try to bake muffins with those specific apples, you might end up with a mess.
The paper argues that for long, complex tasks (like navigating a website or managing a database), simply dumping the whole past history into the AI's mind is actually a bottleneck. It's too much information, and it's full of "stale" details—old names, old dates, and old settings that don't fit the current job. The AI gets confused, tries to use the old values, and fails.
The Solution: The "Travel Guide" Instead of the "Diary"
To fix this, the team introduced a new method called Query-Conditioned Reuse (QCR).
Imagine you are going on a hiking trip.
- The Old Way (Full Trajectory): You take your friend's entire 500-page diary from their last hike. It includes every step they took, every rock they tripped over, and the specific brand of water bottle they used. You read it all, but you get lost because the trail has changed, and you're trying to use their water bottle brand.
- The New Way (QCR): Instead of the whole diary, you get a tiny, custom-made Travel Guide written just for your trip. This guide says: "The path goes up the hill, then turns left at the big oak tree." It tells you what to do (the workflow), but it leaves a blank space where the specific details go, like "Bring your own water bottle" and "Check the weather for today."
The QCR system takes the old memory and strips away the specific, outdated details (like the old user names or file paths). It keeps the "workflow invariant"—the core logic of how to solve the problem—and creates a "to-do list" of things the AI needs to find out right now for the current task. It's like a coach saying, "Remember the game plan, but don't use the old player names; find out who is playing today."
What They Found: Less is More
The researchers tested this idea on three different "video game" worlds: WebArena, WorkArena, and AppWorld. These are environments where AI agents have to perform real tasks, like booking a flight or organizing files. They compared four approaches:
- No Memory: The AI tries to solve it alone.
- Generic Summary: The AI gets a short, boring summary of the old task.
- Full Trajectory: The AI gets the entire, raw history of the old task.
- QCR: The AI gets the custom "Travel Guide" (the query-conditioned note).
The results were surprising. The Full Trajectory approach (reading the whole diary) was actually the least efficient. It used a lot of computer "tokens" (think of these as the energy or money the AI spends to think) and didn't solve the problems as well as the new method.
The QCR method was the clear winner.
- It achieved a 62.3% success rate, which was 10.7 percentage points higher than the Full Trajectory method.
- It used 48.9% fewer online tokens than the Full Trajectory method.
In simple terms, the AI solved more problems, made fewer mistakes, and did it with almost half the effort when it used the "Travel Guide" instead of the "Diary."
Why Length and Changes Matter
The paper also looked at what happens when the old memory is very long or when the new task is very different from the old one.
- The Length Problem: As the old diary entries got longer, the "Full Trajectory" method got worse and worse. It's like trying to find a needle in a haystack; the more hay you add, the harder it is to find the useful part. The QCR method, however, stayed strong even with very long memories because it filtered out the noise.
- The Change Problem: When the new task was very different from the old one (like changing the user or the location), the old method failed spectacularly because it kept trying to use the old values. The QCR method recognized that the values had changed and forced the AI to look up the new ones, preventing it from making "stale binding" errors.
The Big Takeaway
The paper concludes that retrieving a memory is only half the battle. The real magic happens in reusing it.
Just because an AI can find a past experience doesn't mean it can use it. To be truly helpful, the memory system needs to do a little bit of editing. It needs to take the old story, remove the parts that don't fit the new situation, and hand the AI a clear, concise instruction on how to think about the problem, rather than just what happened before.
The authors suggest that future AI systems should keep their full, detailed diaries in storage for safety and record-keeping, but when it's time to act, they should only show the agent a compact, "target-bound" note that tells them the procedure and reminds them to check the current details. This simple shift from "dumping data" to "conditioning reuse" makes the AI smarter, faster, and much less likely to get confused by its own past.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.