TokenWorth Teaches AI Agents to Forget: Best Results on Three Environments With the Fewest Tokens
A team of researchers has published TokenWorth, an online memory framework for agents that keep learning after deployment. The authors found that under tight limits on generation, interaction and memory, many sophisticated long-term memory methods barely beat plain retrieval, and sometimes fail to beat an agent with no memory at all. TokenWorth estimates how useful a specific memory is for a specific query, relying on sparse feedback from task outcomes. On three LifelongAgentBench environments, in both local and API modes, the method achieved the highest task success rate with the lowest output-token usage. The code is open. • A relevant memory is not necessarily a useful one. • A memory's value depends on the query. • Best results with the fewest tokens.
AI-processed from Hugging Face Daily Papers; edited by Hamidun News
An agent that accumulates experience after deployment has to decide which of that experience is worth storing and injecting into its context. Researchers show that under tight budgets, this decision determines the outcome. Their method, TokenWorth, achieved the highest task success rate on three LifelongAgentBench environments, with both local models and APIs, while using the fewest output tokens of all the approaches compared.
When memory gets in the way
The idea that an agent learns from past tasks has become almost standard for long-horizon scenarios. In the lab, budgets are generous: the agent can reason at length, take many interaction steps and keep a large archive of experience. Production is different. Limits on generation, on the number of calls to the environment and on memory size all apply at once.
Under these constraints, the authors saw an unflattering picture. Several advanced long-term memory methods offered little advantage over simple retrieval of similar episodes. Some did not even beat an agent with no memory. The explanation is that every memory decision becomes expensive. If the context fits only two or three episodes, and only a few attempts remain for reasoning and error correction, a single example that matches the topic but is useless takes up space and throws off execution.
How TokenWorth works
The key shift is in how the question is framed: relevance and usefulness are different quantities. An episode can closely resemble the current query and still not help. TokenWorth estimates the "worth" of a memory for a specific query. It learns this estimate online, from sparse feedback: whether the task in which that experience was used finished successfully.
The same estimate works at two levels. It ranks memories during retrieval, and it decides what to keep and what to evict when storage is limited. There are no separate heuristics for retrieval and for memory management. The authors call the framework lightweight: it needs neither a heavy layer on top of the agent nor fine-tuning of the model itself.
What is known from the description of the work:
- Test bed: three LifelongAgentBench environments.
- Deployment modes: local models and API.
- Learning signal: sparse feedback from task execution.
- Result: the highest success rate among the evaluated methods.
- Cost: the fewest output tokens.
- The code is open, in the AIGNLAI/TokenWorth repository on GitHub.
The abstract gives no specific percentage gains and does not name the competing methods, so the size of the advantage can only be judged from the full text of the paper and by running the code.
What agent developers should take from this
The most interesting point is that better quality and token savings arrive together. Accuracy usually costs longer reasoning. If a method filters out harmful memories, the agent spends fewer steps wrestling with unnecessary context, and the API bill falls as the success rate rises.
Here is the practical takeaway for anyone building agents with long-term memory. First, measure the effect of memory against baselines: plain retrieval and a run with no memory. If a complex scheme does not beat them at your budget, it only complicates the system. Second, log which episodes entered the context and how the task ended: that is a ready-made signal for estimating value. Third, tie the eviction policy to that same signal rather than to recency or access frequency. Finally, verify the result on your own tasks: three environments from a single benchmark do not guarantee the same effect in production. The open code lets you do this at low cost.
Delegate Deep Research, Coding & Workflows to an AI Agent
Deploy autonomous multi-step execution with NomadNet Agent (agent.nomadnet.ai) — automated web research, data synthesis, code generation, and complex task orchestration.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.