MemTact: Query-Aligned and Cost-Aware Dynamic Memory for LLM Agents
Abstract
Long-term memory allows large language model agents to reuse past information without repeatedly reading an ever-growing interaction history. Yet memory systems must solve two fundamentally different problems: they must make relevant evidence easy to find, and they must make frequently used information cheap to consume. These objectives are often entangled in a single compressed representation, even though retrieval and direct reading impose different requirements and costs. Moreover, the right representation cannot be determined once at storage time: future queries reveal both how information is searched for and which evidence is worth keeping readily accessible. We introduce MemTact, a use-oriented framework that treats navigation and information residency as distinct cost decisions. Navigation uses source-linked semantic hierarchies to connect concrete evidence with queries at broader levels of abstraction. Residency adapts to observed query usage, weighing retrieval, recovery, reading, and update costs. The framework distinguishes recoverable, findable, and resident service states; the current implementation combines a fixed hierarchical index with query-driven residency updates. Because queries can require complementary evidence, we formulate joint evidence placement and derive an exact maximum-weight-closure solution under conjunctive demands, additive state costs, and no hard capacity constraint. Across 460 questions from RULER, EventQA, and LongMemEval, MemTact achieves 61.52% accuracy, exceeding RAPTOR and A-MEM by 19.35 and 11.09 percentage points, respectively. It uses 62.6% fewer online API tokens than A-MEM and 66.4% fewer than QueryLink, demonstrating a favorable balance between answer accuracy and serving cost.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.