nex_docus/docs/sdd/architecture/decisions/ADR-0005-rag-citations.md

16 lines
601 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# ADR-0005RAG 答案可溯源(编号引用 + 支撑句对齐)
- **状态**Accepted
## 决策
- 每条知识使用必须紧跟 `[n]` 编号引用。
- 采用“答案论断句 ↔ 原文候选句”向量对齐(`align_citation_quotes`),为每次 `[n]` 出现回填支撑句(`quote_occurrences`)。
- 同文件多个分块命中在展示层合并为同一 `citation_id` 并重新编号(`_canonicalize_message_citations`)。
## 后果
- 提升可验证性,但依赖 embedding 可用对齐失败时降级为不返回支撑句NFR-10
## 关联
DV-0007, DV-0011。