Abstract
Memory constraints in long-running agents require structured management of accumulated facts while preserving essential information under bounded context limits. We introduce HTM-EAR, a hierarchical tiered memory substrate that integrates HNSW-based working memory (L1) with archival storage (L2), combining importance-aware eviction and hybrid routing. When L1 reaches capacity, items are evicted using a weighted score of importance and usage. Queries are first resolved in L1; if similarity or entity coverage is insufficient, retrieval falls back to L2, and candidates are re-ranked using a cross-encoder. We evaluate the system under sustained saturation (15,000 facts; L1 capacity 500; L2 capacity 5000) using synthetic streams across five random seeds and real BGL system logs. Ablation studies compare the full system against variants without cross-encoder re-ranking, without routing gates, with LRU eviction, and an oracle with unbounded memory. Under saturation, the full model preserves active-query precision (MRR = 1.000) while enabling controlled forgetting of stale history, approaching oracle active performance (0.997 +/- 0.003). In contrast, LRU minimizes latency (21.1 ms) but permanently evicts 2416 essential facts. On BGL logs, the full system achieves MRR 0.336, close to the oracle (0.370), while LRU drops to 0.069. Code is publicly available at: this https URL
Abstract (translated)
长期运行的代理程序中的内存限制要求对累积的事实进行结构化的管理,同时在有限的上下文范围内保持重要信息。我们引入了HTM-EAR,这是一种分层分级的记忆系统,结合了基于HNSW的工作记忆(L1)和归档存储(L2),并集成了感知重要性的驱逐机制和混合路由功能。 当工作记忆L1达到容量上限时,使用基于项目的重要性和使用的加权评分来移除项。查询首先在L1中解决;如果相似度或实体覆盖不足,则检索会退回到L2,并重新根据交叉编码器对候选对象进行排序。 我们通过合成流(五种随机种子)和实际BGL系统日志,在持续饱和条件下(总事实数:15000个,L1容量:500个,L2容量:5000个)来评估该系统的性能。消融实验比较了完整系统与没有交叉编码器重排名的变体、不使用路由门的变体、使用LRU驱逐策略的变体以及具有无界内存的理想情况。 在饱和条件下,完整的模型能够保持活跃查询精度(MRR = 1.000),同时实现对过时历史记录的有控制地遗忘,接近理想的活跃性能表现(0.997 ± 0.003)。相比之下,LRU策略虽然最小化了延迟(21.1 ms),但永久性地移除了2416个重要事实。在BGL日志上,完整系统实现了MRR为0.336,接近理想的性能(0.370),而使用LRU的变体则降到了0.069。 代码可在此处公开获取:[此URL] (请将"this https URL"替换为您实际提供的代码链接)。
URL
https://arxiv.org/abs/2603.10032