--- title: "Time-Aware Query Expansion" created: 2026-06-25 updated: 2026-06-25 type: concept tags: ["memory", "retrieval", "temporal-reasoning", "optimization"] sources: - "[[longmem-eval-2025]]" --- # Time-Aware Query Expansion Time-Aware Query Expansion 是 LongMemEval 提出的时间感知查询展开策略:在记忆检索时,将显式时间戳关联到事实,并根据查询中的时间参考缩小搜索范围。 ## 动机 朴素的 time-agnostic 记忆设计在时间推理问题上表现极差: - "距离我上次去博物馆过去了几个月?" - 需要知道"上次去博物馆"的精确时间戳 → 与"现在"的时间差 - 若查询不做时间展开,BM25 和 dense 都无法有效检索 ## 做法 ``` 原始查询:"我上次去博物馆是什么时候?" ↓ LLM 时间展开 → "上次博物馆参观,时间范围:2024-01-01 至 2024-06-30" ↓ 检索 + 时间过滤 → 只返回时间范围内的记忆文档 ``` **索引侧**:存储时将时间戳与事实关联 **查询侧**:用 LLM 从查询中推断时间范围,构造带时间约束的检索 ## 效果 (LongMemEval 实验数据) | 场景 | Time-Agnostic | +Time Expansion | 增益 | |------|-------------|-----------------|------| | 时间推理召回 | baseline | +6.8%~11.3% | 显著(强 LLM 展开时) | 关键:展开质量依赖 LLM 能力——弱模型做时间推断不准,增益缩小。 ## 与 Per-Index Time Decay 的区别 | 技术 | 作用于 | 目的 | |------|--------|------| | Per-index gauss decay (Atlas) | 索引文档的权重 | 让旧记忆自然沉底 | | Time-aware query expansion | 查询的搜索范围 | 精确限定时间窗口 | 两者互补:decay 处理"旧信息不如新信息"的背景假设,time expansion 处理"我需要这个时间段的"的精确需求。 ## 参考 - [[longmem-eval-2025]] - [[memory-indexing-retrieval-reading]] - [[fact-augmented-key-expansion]] - [[per-index-time-decay]]