feat(knowledge): 可跳转 wikilink + 真实相关 note + 一对话多页
- [[wikilink]] 解析器:note id / vault_path / 标题 / vault 元页 / missing
- 前端 MarkdownRenderer 把非数字 [[...]] 渲染成可点链接,元页弹窗查看,缺失置灰
- vault 脚手架补建项目 hub 页,三个结构性链接(index/taxonomy/hub)始终可跳
- capture 时按标题+摘要+区分性标签检索同主题 note,注入真实 [[标题]] 到 Related + 记 related 图谱边
- LLM 提取支持 notes[] 数组,一次对话拆 1~4 页并按标题互链(multi_note_enabled 开关)
- 新增接口 POST /resolve、GET /notes/{id}/wikilinks、GET /vault-page
- 新增配置 related_notes_enabled / related_notes_limit / multi_note_enabled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
92a46003f8
commit
df3fac1032
13 files changed
+668
-72
No files matched your search
@@ -105,10 +105,18 @@ def _summary(turns: list[dict[str, str]], *, limit: int = 280) -> str:
|
||||
|
||||
|
||||
def related_links(project_name: str | None) -> list[str]:
|
||||
"""At least two wikilinks per note (wiki-capture requirement)."""
|
||||
"""Structural wikilinks every note carries (wiki-capture requirement).
|
||||
|
||||
These point at vault meta/hub pages (``index`` / ``_meta/taxonomy`` / the
|
||||
project hub) that always exist, so they resolve to navigable pages. Content-
|
||||
specific "related notes" are injected separately by the service layer (which
|
||||
has DB access) on top of these.
|
||||
"""
|
||||
from deerflow.knowledge.markdown_vault import slugify
|
||||
|
||||
links = ["[[index]]", "[[_meta/taxonomy]]"]
|
||||
if project_name:
|
||||
links.append(f"[[projects/{project_name}/synthesis/product-knowledge-base]]")
|
||||
links.append(f"[[projects/{slugify(project_name)}/synthesis/product-knowledge-base]]")
|
||||
return links
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user