Files
myWiki/concepts/verbatim-pre-recall.md

1.2 KiB
Raw Blame History

title, created, updated, type, tags, sources
title created updated type tags sources
Verbatim Pre-Recall 2026-06-24 2026-06-24 concept
information-retrieval
agent-design
bm25
query-processing
atlas-agent-memory-architecture-2026

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 调用之间插入:

  1. user_message 原串调用 recall_memory
  2. 结果以合成 assistant tool_call 注入对话历史
  3. LLM 后续调用时同时看到用户消息和 pre-recall 结果

为什么重要

Ablation 证实 query expansionLLM paraphrase反而降低性能——BM25 已捕获精确 tokendense 已捕获语义改写,额外 LLM 改写层引入噪音。

参考