feat(knowledge): 出处标记渲染 + 相关笔记按标签精确匹配 + LLM 回退落草稿
A) 前端把 ^[inferred]/^[ambiguous] 渲染成「推测」「存疑」小角标(原先原样显示文本) B) 相关笔记只按"区分性标签"精确匹配(去掉标题/摘要关键词检索——中文分词导致 助手/知识图谱/页面 等泛词误关联,如「AI助手打招呼」被错误拉进 Related); 无区分性标签则不关联、不渲染 ## Related 段 C) LLM 提炼启用但失败时不再静默回退成"原文堆砌": - 回退笔记落为 draft(草稿)而非 approved,便于复核 - capture_thread 记 WARNING 并返回 llm_fallback;router 透出该标志 - llm_extractor 在 JSON 解析失败/无 notes 时补充可诊断的 WARNING 日志 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e7ff07debd
commit
4aef81284a
4 files changed
+80
-36
No files matched your search
@@ -252,10 +252,17 @@ async def extract_thread_llm_multi(
|
||||
return []
|
||||
|
||||
if not data:
|
||||
logger.warning("Knowledge LLM extraction for thread %s returned no parsable JSON; using rule-based fallback", thread_id)
|
||||
return []
|
||||
|
||||
note_dicts = _notes_from_data(data)
|
||||
if not note_dicts:
|
||||
logger.warning(
|
||||
"Knowledge LLM extraction for thread %s produced no notes (should_ingest=%s, reason=%r); using rule-based fallback",
|
||||
thread_id,
|
||||
data.get("should_ingest"),
|
||||
str(data.get("reason") or "")[:200],
|
||||
)
|
||||
return []
|
||||
if not allow_multi:
|
||||
note_dicts = note_dicts[:1]
|
||||
|
||||
Reference in new issue
Block a user