Learning Query-Aware Budget-Tier Routing for Runtime Agent Memory
This paper introduces BudgetMem, a runtime agent memory framework that employs a reinforcement learning-based router to dynamically select query-aware budget tiers across memory modules, effectively optimizing the trade-off between task performance and computational cost.
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. You have a massive filing cabinet filled with thousands of old case files, chat logs, and notes (this is your memory). A new question comes in: "Who stole the cookie?"
The Old Way: "Build Once, Use Always"
Most current AI systems work like a librarian who, every single night, reads every single file in the cabinet, summarizes them, and shoves the summaries into a tiny box.
- The Problem: If you ask a simple question like "What's the weather?", the librarian still spent all night reading the files about the cookie theft. It's a waste of time and energy. Worse, if the summary missed a tiny detail about the cookie, the librarian can't go back and check because the original files were already "processed" and thrown away.
The New Way: BudgetMem
The paper introduces BudgetMem, a smarter system that treats memory like a restaurant kitchen with a flexible budget.
Instead of pre-cooking everything, the kitchen waits until you place an order (the query). Then, it decides exactly how much effort to spend on preparing the ingredients for that specific order.
1. The Three Budget Tiers (Low, Mid, High)
Every step in the kitchen has three ways to cook the same dish:
- Low Budget (The Quick Snack): Use a simple rule or a fast, small helper. It's cheap and fast but might miss subtle flavors.
- Analogy: Using a basic keyword search or a small, quick robot to scan the files.
- Mid Budget (The Standard Meal): Use a slightly smarter tool or a bit more thinking. It costs a bit more but is more accurate.
- Analogy: Using a medium-sized AI model or a "Chain of Thought" (thinking step-by-step) approach.
- High Budget (The Fancy Feast): Use the biggest, most powerful chef and a complex, multi-step process. It's expensive and slow but gets the most details right.
- Analogy: Using a massive, super-smart AI model that reasons deeply and checks its own work.
2. The Smart Waiter (The Router)
The magic of BudgetMem is a lightweight router, which acts like a smart waiter.
- When you order "What's the weather?", the waiter looks at the request and says, "No need to call the fancy chef! Let's just use the Low Budget quick search. It's fast and cheap."
- When you order "Who stole the cookie and why?", the waiter sees this is a complex mystery. It says, "Okay, for the 'Who' part, let's use Mid Budget. But for the 'Why' part, we need the High Budget chef to really think it through."
The waiter learns this behavior using Reinforcement Learning (trial and error). It gets a "score" based on two things:
- Did you get the right answer? (Performance)
- Did we spend too much money? (Cost)
Over time, the waiter learns the perfect balance: spending just enough money to get the answer right, but not a penny more.
3. Three Ways to Change the Budget
The paper tested three different ways to create these "tiers" for the kitchen:
- Implementation Tiering: Changing who does the work. (Low = Simple rules; Mid = A small AI; High = A giant AI).
- Reasoning Tiering: Changing how they think. (Low = Guess immediately; Mid = Think step-by-step; High = Think, check, and re-think).
- Capacity Tiering: Changing the size of the brain. (Low = A tiny brain; Mid = A medium brain; High = A giant brain).
The Results
The researchers tested this system on three different "mystery games" (datasets):
- LoCoMo: Long conversations.
- LongMemEval: Remembering details over long periods.
- HotpotQA: Complex questions needing multiple clues.
What they found:
- When money is no object (High Budget): BudgetMem beat all the other systems, getting better answers than the "build once" methods.
- When money is tight (Low Budget): BudgetMem was still very good. It knew when to cut corners without ruining the answer, whereas other systems either wasted money or gave bad answers because they were too rigid.
- The "Sweet Spot": The system proved that you don't need to use the "High Budget" chef for every single question. By mixing Low, Mid, and High tiers intelligently, you can get the best results for the least amount of money.
In a Nutshell
BudgetMem is a system that stops AI from wasting energy. Instead of blindly processing everything, it uses a smart "waiter" to decide exactly how much brainpower to spend on each specific question, ensuring you get the best answer possible without paying for more than you need.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.