1.2 KiB
1.2 KiB
title, created, updated, type, tags, sources
| title | created | updated | type | tags | sources | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Verbatim Pre-Recall | 2026-06-24 | 2026-06-24 | concept |
|
|
Verbatim Pre-Recall
Verbatim Pre-Recall 是 Atlas 记忆系统的关键设计:在 LLM 看到用户消息之前,先用用户原话(一字不改)跑一次检索。这是保障 BM25 词法腿价值的关键。
问题
LLM 在调用 recall_memory 前会将精确查询泛化:
- "postgres v15.3 + pgvector 0.5.1" → "PostgreSQL 数据库"
- 版本号、扩展名、错误码全部丢失
- BM25 匹配不到精确 token → 词法腿报废
方案
在 messages.append(user_msg) 和 LLM 调用之间插入:
- 用
user_message原串调用 recall_memory - 结果以合成 assistant tool_call 注入对话历史
- LLM 后续调用时同时看到用户消息和 pre-recall 结果
为什么重要
Ablation 证实 query expansion(LLM paraphrase)反而降低性能——BM25 已捕获精确 token,dense 已捕获语义改写,额外 LLM 改写层引入噪音。