Skip to content

LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。

TypeScript

docs: promote community detection and graph insights to standalone sections

nash_su89f75861b5dc
diff --git a/README.md b/README.md
index e43c836c..12b178e1 100644
--- a/README.md
+++ b/README.md
@@ -121,19 +121,6 @@ The original mentions `[[wikilinks]]` for cross-references but has no graph anal
| Adamic-Adar | ×1.5 | Pages sharing common neighbors (weighted by neighbor degree) |
| Type affinity | ×1.0 | Bonus for same page type (entity↔entity, concept↔concept) |
-**Louvain Community Detection:**
-- Automatic knowledge cluster discovery via graphology-communities-louvain
-- Type / Community coloring mode toggle — see pages by type or by discovered topic clusters
-- Per-community cohesion score (intra-edge density), low-cohesion clusters flagged with warning
-- 12-color palette, community legend with top node labels and member counts
-
-**Graph Insights Panel:**
-- Right-side expandable panel showing automatically discovered insights
-- **Surprising connections** — cross-community, cross-type, peripheral↔hub edges scored by composite metric; dismissable
-- **Knowledge gaps** — isolated pages (degree ≤ 1), sparse communities (cohesion < 0.15), bridge nodes (connecting 3+ clusters)
-- Click any insight to highlight corresponding nodes and edges in the graph
-- **Deep Research integration** — knowledge gaps and bridge nodes have a one-click Deep Research button that generates domain-aware search topics via LLM
-
**Graph Visualization (sigma.js + graphology + ForceAtlas2):**
- Node colors by page type or community, sizes scaled by link count (√ scaling)
- Edge thickness and color by relevance weight (green=strong, gray=weak)
@@ -142,7 +129,36 @@ The original mentions `[[wikilinks]]` for cross-references but has no graph anal
- Position caching prevents layout jumps when data updates
- Legend switches between type counts and community info based on coloring mode
-### 5. Optimized Query Retrieval Pipeline
+### 5. Louvain Community Detection
+
+Not in the original. Automatic discovery of knowledge clusters using the **Louvain algorithm** (graphology-communities-louvain):
+
+- **Auto-clustering** — discovers which pages naturally group together based on link topology, independent of predefined page types
+- **Type / Community toggle** — switch between coloring nodes by page type (entity, concept, source...) or by discovered knowledge cluster
+- **Cohesion scoring** — each community scored by intra-edge density (actual edges / possible edges); low-cohesion clusters (< 0.15) flagged with warning
+- **12-color palette** — distinct visual separation between clusters
+- **Community legend** — shows top node label, member count, and cohesion per cluster
+
+### 6. Graph Insights — Surprising Connections & Knowledge Gaps
+
+Not in the original. The system **automatically analyzes graph structure** to surface actionable insights:
+
+**Surprising Connections:**
+- Detects unexpected relationships: cross-community edges, cross-type links, peripheral↔hub couplings
+- Composite surprise score ranks the most noteworthy connections
+- Dismissable — mark connections as reviewed so they don't reappear
+
+**Knowledge Gaps:**
+- **Isolated pages** (degree ≤ 1) — pages with few or no connections to the rest of the wiki
+- **Sparse communities** (cohesion < 0.15, ≥ 3 pages) — knowledge areas with weak internal cross-references
+- **Bridge nodes** (connecting 3+ clusters) — critical junction pages that hold multiple knowledge areas together
+
+**Interactive:**
+- Click any insight card to **highlight** corresponding nodes and edges in the graph; click again to deselect
+- Knowledge gaps and bridge nodes have a **Deep Research button** — triggers LLM-optimized research with domain-aware topics (reads overview.md + purpose.md for context)
+- Research topic shown in **editable confirmation dialog** before starting — user can refine topic and search queries
+
+### 7. Optimized Query Retrieval Pipeline
The original describes a simple query where the LLM reads relevant pages. We built a **4-phase retrieval pipeline** with budget control:
@@ -169,7 +185,7 @@ Phase 4: Context Assembly
- LLM instructed to cite pages by number: [1], [2], etc.
```
-### 6. Multi-Conversation Chat with Persistence
+### 8. Multi-Conversation Chat with Persistence
The original has a single query interface. We built **full multi-conversation support**:
@@ -182,7 +198,7 @@ The original has a single query interface. We built **full multi-conversation su
- **Regenerate** — re-generate the last response with one click (removes last assistant + user message pair, re-sends)
- **Save to Wiki** — archive valuable answers to `wiki/queries/`, then auto-ingest to extract entities/concepts into the knowledge network
-### 7. Thinking / Reasoning Display
+### 9. Thinking / Reasoning Display
Not in the original. For LLMs that emit `<think>` blocks (DeepSeek, QwQ, etc.):
@@ -190,7 +206,7 @@ Not in the original. For LLMs that emit `<think>` blocks (DeepSeek, QwQ, etc.):
- **Collapsed by default** — thinking blocks hidden after completion, click to expand
- **Visual separation** — thinking content shown in distinct style, separate from the main response
-### 8. KaTeX Math Rendering
+### 10. KaTeX Math Rendering
Not in the original. Full LaTeX math support across all views:
@@ -199,7 +215,7 @@ Not in the original. Full LaTeX math support across all views:
- **Auto-detection** — bare `\begin{aligned}` and other LaTeX environments automatically wrapped with `$$` delimiters
- **Unicode fallback** — 100+ symbol mappings (α, ∑, →, ≤, etc.) for simple inline notation outside math blocks
-### 9. Review System (Async Human-in-the-Loop)
+### 11. Review System (Async Human-in-the-Loop)
The original suggests staying involved during ingest. We added an **asynchronous review queue**:
@@ -208,7 +224,7 @@ The original suggests staying involved during ingest. We added an **asynchronous
- **Search queries generated at ingest time** — LLM pre-generates optimized web search queries for each review item
- User handles reviews at their convenience — doesn't block ingest
-### 10. Deep Research
+### 12. Deep Research
<p align="center">
<img src="assets/1-deepresearch.jpg" width="100%" alt="Deep Research">
@@ -226,7 +242,7 @@ Not in the original. When the LLM identifies knowledge gaps:
- **Task queue** with 3 concurrent tasks
- **Research Panel** — dedicated sidebar panel with dynamic height, real-time streaming progress
-### 11. Browser Extension (Web Clipper)
+### 13. Browser Extension (Web Clipper)
<p align="center">
<img src="assets/4-chrome_extension_webclipper.jpg" width="100%" alt="Chrome Extension Web Clipper">
@@ -242,7 +258,7 @@ The original mentions Obsidian Web Clipper. We built a **dedicated Chrome Extens
- **Clip watcher** — polls every 3 seconds for new clips, processes automatically
- **Offline preview** — shows extracted content even when app is not running
-### 12. Multi-format Document Support
+### 14. Multi-format Document Support
The original focuses on text/markdown. We support structured extraction preserving document semantics:
@@ -256,7 +272,7 @@ The original focuses on text/markdown. We support structured extraction preservi
| Video/Audio | Built-in player |
| Web clips | Readability.js + Turndown.js → clean Markdown |
-### 13. File Deletion with Cascade Cleanup
+### 15. File Deletion with Cascade Cleanup
The original has no deletion mechanism. We added **intelligent cascade deletion**:
@@ -266,7 +282,7 @@ The original has no deletion mechanism. We added **intelligent cascade deletion*
- **Index cleanup** — removed pages are purged from index.md
- **Wikilink cleanup** — dead `[[wikilinks]]` to deleted pages are removed from remaining wiki pages
-### 14. Configurable Context Window
+### 16. Configurable Context Window
Not in the original. Users can configure how much context the LLM receives:
@@ -274,7 +290,7 @@ Not in the original. Users can configure how much context the LLM receives:
- **Proportional budget allocation** — larger windows get proportionally more wiki content
- **60/20/5/15 split** — wiki pages / chat history / index / system prompt
-### 15. Cross-Platform Compatibility
+### 17. Cross-Platform Compatibility
The original is platform-agnostic (abstract pattern). We handle concrete cross-platform concerns:
@@ -283,7 +299,7 @@ The original is platform-agnostic (abstract pattern). We handle concrete cross-p
- **Tauri v2** — native desktop on macOS, Windows, Linux
- **GitHub Actions CI/CD** — automated builds for macOS (ARM + Intel), Windows (.msi), Linux (.deb / .AppImage)
-### 16. Other Additions
+### 18. Other Additions
- **i18n** — English + Chinese interface (react-i18next)
- **Settings persistence** — LLM provider, API key, model, context size, language saved via Tauri Store
diff --git a/README_CN.md b/README_CN.md
index 43b8dc04..9e5b9067 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -121,19 +121,6 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
| Adamic-Adar | ×1.5 | 共享共同邻居的页面(按邻居度数加权) |
| 类型亲和 | ×1.0 | 相同页面类型的加分(实体↔实体,概念↔概念) |
-**Louvain 社区检测:**
-- 基于 graphology-communities-louvain 自动发现知识聚类
-- 类型 / 社区 着色模式一键切换 —— 按页面类型或按发现的主题集群查看
-- 每个社区计算 cohesion(内聚度)评分,低内聚社区标警告
-- 12 色调色板,社区图例显示核心节点标签和成员数
-
-**图谱洞察面板:**
-- 右侧展开式面板,自动发现知识结构中的洞察
-- **惊奇连接** —— 跨社区、跨类型、边缘↔核心的意外关联,复合评分排序,可消除
-- **知识空白** —— 孤立页面(度 ≤ 1)、稀疏社区(cohesion < 0.15)、桥接节点(连接 3+ 个集群)
-- 点击洞察卡片高亮图谱中对应节点和边
-- **深度研究集成** —— 知识空白和桥接节点一键触发 Deep Research,LLM 自动生成领域精准的搜索主题
-
**图谱可视化(sigma.js + graphology + ForceAtlas2):**
- 按页面类型或社区着色节点,按链接数缩放节点大小(√ 缩放)
- 边的粗细和颜色按关联权重变化(绿色=强,灰色=弱)
@@ -142,7 +129,36 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- 位置缓存防止数据更新时布局跳动
- 图例根据着色模式自动切换类型计数或社区信息
-### 5. 优化的查询检索管线
+### 5. Louvain 社区检测
+
+原始设计中没有。基于 **Louvain 算法**(graphology-communities-louvain)自动发现知识聚类:
+
+- **自动聚类** —— 根据链接拓扑发现哪些页面自然归为一组,独立于预定义的页面类型
+- **类型 / 社区 一键切换** —— 按页面类型(实体、概念、资料...)或按发现的知识集群着色
+- **内聚度评分** —— 每个社区按内部边密度(实际边数 / 可能边数)评分;低内聚社区(< 0.15)标警告
+- **12 色调色板** —— 集群之间视觉区分清晰
+- **社区图例** —— 显示核心节点标签、成员数和内聚度
+
+### 6. 图谱洞察 —— 惊奇连接与知识空白
+
+原始设计中没有。系统**自动分析图谱结构**,呈现可操作的洞察:
+
+**惊奇连接:**
+- 检测意外关联:跨社区边、跨类型链接、边缘↔核心耦合
+- 复合惊奇度评分排序最值得关注的连接
+- 可消除 —— 标记为已查看后不再重复出现
+
+**知识空白:**
+- **孤立页面**(度 ≤ 1)—— 与 Wiki 其余部分缺少连接的页面
+- **稀疏社区**(cohesion < 0.15,≥ 3 页)—— 内部交叉引用薄弱的知识领域
+- **桥接节点**(连接 3+ 个集群)—— 维系多个知识领域的关键枢纽页面
+
+**交互:**
+- 点击洞察卡片**高亮**图谱中对应节点和边;再次点击取消
+- 知识空白和桥接节点附带 **Deep Research 按钮** —— 触发 LLM 智能主题生成(读取 overview.md + purpose.md 获取领域上下文)
+- 研究主题在**可编辑确认对话框**中展示 —— 用户可修改主题和搜索查询后再启动
+
+### 7. 优化的查询检索管线
原始设计描述了 LLM 读取相关页面的简单查询。我们构建了带预算控制的**四阶段检索管线**:
@@ -169,7 +185,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- LLM 被指示按编号引用页面:[1]、[2] 等
```
-### 6. 多对话聊天与持久化
+### 8. 多对话聊天与持久化
原始设计只有单一查询接口。我们构建了**完整的多对话支持**:
@@ -182,7 +198,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- **重新生成** —— 一键重新生成最后一条回复(移除最后的助手+用户消息对,重新发送)
- **保存到 Wiki** —— 将有价值的回答归档到 `wiki/queries/`,然后自动摄入提取实体/概念到知识网络
-### 7. 思维链 / 推理过程展示
+### 9. 思维链 / 推理过程展示
原始设计中没有。针对会输出 `<think>` 块的 LLM(DeepSeek、QwQ 等):
@@ -190,7 +206,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- **默认折叠** —— 生成完成后思维块隐藏,点击展开
- **视觉分离** —— 思维内容以独特样式显示,与主回复分开
-### 8. KaTeX 数学公式渲染
+### 10. KaTeX 数学公式渲染
原始设计中没有。跨所有视图的完整 LaTeX 数学支持:
@@ -199,7 +215,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- **自动检测** —— 裸 `\begin{aligned}` 等 LaTeX 环境自动补上 `$$` 定界符
- **Unicode 降级** —— 100+ 符号映射(α, ∑, →, ≤ 等)用于数学块外的简单行内符号
-### 9. 审核系统(异步人机协作)
+### 11. 审核系统(异步人机协作)
原始设计建议在摄入时全程参与。我们新增了**异步审核队列**:
@@ -208,7 +224,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- **摄入时生成搜索查询** —— LLM 预先为每个审核项生成优化的网络搜索查询
- 用户可在方便时处理审核 —— 不阻塞摄入流程
-### 10. 深度研究
+### 12. 深度研究
<p align="center">
<img src="assets/1-deepresearch.jpg" width="100%" alt="深度研究">
@@ -226,7 +242,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- **任务队列** —— 最多 3 个并发任务
- **研究面板** —— 专用侧边面板,动态高度,实时流式进度
-### 11. 浏览器扩展(网页剪藏)
+### 13. 浏览器扩展(网页剪藏)
<p align="center">
<img src="assets/4-chrome_extension_webclipper.jpg" width="100%" alt="Chrome 扩展网页剪藏">
@@ -242,7 +258,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- **剪藏监听** —— 每 3 秒轮询新剪藏,自动处理
- **离线预览** —— 即使应用未运行也能显示提取的内容
-### 12. 多格式文档支持
+### 14. 多格式文档支持
原始设计聚焦于纯文本/Markdown。我们支持保留文档语义的结构化提取:
@@ -256,7 +272,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
| 视频/音频 | 内置播放器 |
| 网页剪藏 | Readability.js + Turndown.js → 干净的 Markdown |
-### 13. 文件删除级联清理
+### 15. 文件删除级联清理
原始设计没有删除机制。我们新增了**智能级联删除**:
@@ -266,7 +282,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- **索引清理** —— 被移除的页面从 index.md 中清除
- **Wiki 链接清理** —— 指向已删除页面的失效 `[[wikilinks]]` 从其余 Wiki 页面中移除
-### 14. 可配置上下文窗口
+### 16. 可配置上下文窗口
原始设计中没有。用户可配置 LLM 接收多少上下文:
@@ -274,7 +290,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- **比例预算分配** —— 更大的窗口按比例获得更多 Wiki 内容
- **60/20/5/15 分配** —— Wiki 页面 / 聊天历史 / 索引 / 系统提示
-### 15. 跨平台兼容
+### 17. 跨平台兼容
原始设计与平台无关(抽象模式)。我们处理了具体的跨平台问题:
@@ -283,7 +299,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- **Tauri v2** —— macOS、Windows、Linux 原生桌面
- **GitHub Actions CI/CD** —— 自动构建 macOS(ARM + Intel)、Windows(.msi)、Linux(.deb / .AppImage)
-### 16. 其他新增
+### 18. 其他新增
- **国际化** —— 中英文界面(react-i18next)
- **设置持久化** —— LLM 提供商、API 密钥、模型、上下文大小、语言通过 Tauri Store 保存