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

Update README for source watch and search providers

nash_su9cbf94b05aa1
diff --git a/README.md b/README.md
index 74b72345..6a08b16f 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
</p>
<p align="center">
- English | <a href="README_CN.md">中文</a>
+ English | <a href="README_CN.md">中文</a> | <a href="README_JA.md">日本語</a>
</p>
---
@@ -38,7 +38,8 @@
- **Vector Semantic Search** — optional embedding-based retrieval via LanceDB, supports any OpenAI-compatible endpoint
- **Persistent Ingest Queue** — serial processing with crash recovery, cancel, retry, and progress visualization
- **Folder Import** — recursive folder import preserving directory structure, folder context as LLM classification hint
-- **Deep Research** — LLM-optimized search topics, multi-query web search, auto-ingest results into wiki
+- **Source Folder Auto-Watch** — detects external changes in `raw/sources/` and keeps ingest/delete cleanup in sync
+- **Deep Research** — LLM-optimized search topics, multi-query web search via Tavily, SerpApi, or SearXNG, auto-ingest results into wiki
- **Async Review System** — LLM flags items for human judgment, predefined actions, pre-generated search queries
- **Chrome Web Clipper** — one-click web page capture with auto-ingest into knowledge base
@@ -116,12 +117,14 @@ Additional ingest enhancements beyond the original:
- **SHA256 incremental cache** — source file content is hashed before ingest; unchanged files are skipped automatically, saving LLM tokens and time
- **Persistent ingest queue** — serial processing prevents concurrent LLM calls; queue persisted to disk, survives app restart; failed tasks auto-retry up to 3 times
- **Folder import** — recursive folder import preserving directory structure; folder path passed to LLM as classification context (e.g., "papers > energy" helps categorize content)
+- **Source folder auto-watch** — files added, edited, or deleted in `raw/sources/` outside the app are picked up automatically and reuse the same ingest/delete lifecycle as in-app actions
- **Queue visualization** — Activity Panel shows progress bar, pending/processing/failed tasks with cancel and retry buttons
- **Auto-embedding** — when vector search is enabled, new pages are automatically embedded after ingest
- **Source traceability** — every generated wiki page includes a `sources: []` field in YAML frontmatter, linking back to the raw source files that contributed to it
- **overview.md auto-update** — global summary page regenerated on every ingest to reflect the latest state of the wiki
- **Guaranteed source summary** — fallback ensures a source summary page is always created, even if the LLM omits it
- **Language-aware generation** — LLM responds in the user's configured language (English or Chinese)
+- **Progressive Sources view** — large source folders render progressively while scrolling, keeping big source collections responsive
### 4. Knowledge Graph with Relevance Model
@@ -266,7 +269,8 @@ The original suggests staying involved during ingest. We added an **asynchronous
Not in the original. When the LLM identifies knowledge gaps:
-- **Web search** (Tavily API) finds relevant sources with full content extraction (no truncation)
+- **Web search** via Tavily, SerpApi, or SearXNG finds relevant sources with full content extraction (no truncation)
+- **Provider-specific configuration** — Tavily and SerpApi use independent API keys; SerpApi supports selectable engines, while SearXNG uses a configured instance URL and search categories
- **Multiple search queries** per topic — LLM-generated at ingest time, optimized for search engines
- **LLM-optimized research topics** — when triggered from Graph Insights, LLM reads overview.md + purpose.md to generate domain-specific topics and queries (not generic keywords)
- **User confirmation dialog** — editable topic and search queries shown for review before research starts
@@ -361,7 +365,7 @@ The original is platform-agnostic (abstract pattern). We handle concrete cross-p
| i18n | react-i18next |
| State | Zustand |
| LLM | Streaming fetch (OpenAI, Anthropic, Google, Ollama, Custom) |
-| Web Search | Tavily API |
+| Web Search | Tavily, SerpApi, SearXNG JSON API |
## Installation
@@ -394,12 +398,13 @@ npm run tauri build # Production build
1. Launch the app → Create a new project (choose a template)
2. Go to **Settings** → Configure your LLM provider (API key + model)
-3. Go to **Sources** → Import documents (PDF, DOCX, MD, etc.)
-4. Watch the **Activity Panel** — LLM automatically builds wiki pages
-5. Use **Chat** to query your knowledge base
-6. Browse the **Knowledge Graph** to see connections
-7. Check **Review** for items needing your attention
-8. Run **Lint** periodically to maintain wiki health
+3. Optional: configure **Web Search** providers and source folder auto-watch in Settings
+4. Go to **Sources** → Import documents (PDF, DOCX, MD, etc.)
+5. Watch the **Activity Panel** — LLM automatically builds wiki pages
+6. Use **Chat** to query your knowledge base
+7. Browse the **Knowledge Graph** to see connections
+8. Check **Review** for items needing your attention
+9. Run **Lint** periodically to maintain wiki health
## Project Structure
diff --git a/README_CN.md b/README_CN.md
index 8d5dee89..75ff6142 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -19,7 +19,7 @@
</p>
<p align="center">
- <a href="README.md">English</a> | 中文
+ <a href="README.md">English</a> | 中文 | <a href="README_JA.md">日本語</a>
</p>
---
@@ -38,7 +38,8 @@
- **向量语义搜索** — 可选的 embedding 检索,基于 LanceDB,支持任意 OpenAI 兼容端点
- **持久化摄入队列** — 串行处理,崩溃恢复,取消/重试,进度可视化
- **文件夹导入** — 递归导入保留目录结构,文件夹路径作为 LLM 分类上下文
-- **深度研究** — LLM 智能生成搜索主题,多查询网络搜索,研究结果自动摄入 Wiki
+- **Source 文件夹自动监听** — 检测 `raw/sources/` 的外部变更,并同步触发摄入或删除清理
+- **深度研究** — LLM 智能生成搜索主题,通过 Tavily、SerpApi 或 SearXNG 进行多查询网络搜索,研究结果自动摄入 Wiki
- **异步审核系统** — LLM 在摄入时标记需人工判断的项,预定义操作,预生成搜索查询
- **Chrome 网页剪藏** — 一键捕获网页内容,自动摄入知识库
@@ -116,12 +117,14 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
- **SHA256 增量缓存** —— 摄入前检查源文件内容哈希,未变更则自动跳过,节省 LLM token 和时间
- **持久化摄入队列** —— 串行处理防止并发 LLM 调用;队列持久化到磁盘,应用重启后自动恢复;失败任务自动重试最多 3 次
- **文件夹导入** —— 递归导入保留目录结构;文件夹路径作为分类上下文传给 LLM(如 "papers > energy" 帮助分类)
+- **Source 文件夹自动监听** —— 在应用外新增、修改或删除 `raw/sources/` 文件时会被自动检测,并复用应用内相同的摄入/删除生命周期
- **队列可视化** —— 活动面板显示进度条、排队/处理中/失败任务,支持取消和重试
- **自动 Embedding** —— 开启向量搜索时,新页面摄入后自动生成 embedding
- **来源可追溯** —— 每个生成的 Wiki 页面在 YAML frontmatter 中包含 `sources: []` 字段,链接回贡献的原始资料文件
- **overview.md 自动更新** —— 全局概要页面在每次摄入后重新生成,反映 Wiki 最新状态
- **保证资料摘要生成** —— 兜底机制确保资料摘要页面始终被创建,即使 LLM 遗漏
- **语言感知生成** —— LLM 按用户配置的语言(中文或英文)响应
+- **资料源渐进渲染** —— 大型资料目录会随滚动分批渲染,保持 Sources 页面流畅
### 4. 知识图谱与关联度模型
@@ -266,7 +269,8 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
原始设计中没有。当 LLM 识别出知识空白时:
-- **网络搜索**(Tavily API)查找相关资料,返回完整内容(非截断摘要)
+- **网络搜索** 支持 Tavily、SerpApi 或 SearXNG,查找相关资料并返回完整内容(非截断摘要)
+- **Provider 独立配置** —— Tavily 和 SerpApi 使用各自 API Key;SerpApi 支持选择搜索引擎,SearXNG 使用实例 URL 和搜索分类
- **多条搜索查询** —— 摄入时由 LLM 生成,针对搜索引擎优化
- **LLM 智能主题生成** —— 从图谱洞察触发时,LLM 读取 overview.md + purpose.md 生成领域精准的研究主题和查询(非泛泛关键词)
- **用户确认对话框** —— 研究主题和搜索查询可编辑,确认后才开始研究
@@ -361,7 +365,7 @@ LLM Wiki 是一个跨平台桌面应用,能将你的文档自动转化为有
| 国际化 | react-i18next |
| 状态管理 | Zustand |
| LLM | 流式 fetch(OpenAI、Anthropic、Google、Ollama、自定义) |
-| 网络搜索 | Tavily API |
+| 网络搜索 | Tavily、SerpApi、SearXNG JSON API |
## 安装
@@ -394,12 +398,13 @@ npm run tauri build # 生产构建
1. 启动应用 → 创建新项目(选择模板)
2. 进入 **设置** → 配置 LLM 提供商(API 密钥 + 模型)
-3. 进入 **资料源** → 导入文档(PDF、DOCX、MD 等)
-4. 观察 **活动面板** —— LLM 自动构建 Wiki 页面
-5. 使用 **聊天** 查询你的知识库
-6. 浏览 **知识图谱** 查看关联
-7. 查看 **审核** 处理需要你关注的项目
-8. 定期运行 **Lint** 维护 Wiki 健康度
+3. 可选:在 **设置** 中配置网络搜索 Provider 和 source 文件夹自动监听
+4. 进入 **资料源** → 导入文档(PDF、DOCX、MD 等)
+5. 观察 **活动面板** —— LLM 自动构建 Wiki 页面
+6. 使用 **聊天** 查询你的知识库
+7. 浏览 **知识图谱** 查看关联
+8. 查看 **审核** 处理需要你关注的项目
+9. 定期运行 **Lint** 维护 Wiki 健康度
## 项目结构
diff --git a/README_JA.md b/README_JA.md
new file mode 100644
index 00000000..00e03891
--- /dev/null
+++ b/README_JA.md
@@ -0,0 +1,207 @@
+# LLM Wiki
+
+<p align="center">
+ <img src="logo.jpg" width="128" height="128" style="border-radius: 22%;" alt="LLM Wiki Logo">
+</p>
+
+<p align="center">
+ <strong>自分で育つパーソナル知識ベース。</strong><br>
+ LLM が文書を読み、構造化された Wiki を作成し、継続的に更新します。
+</p>
+
+<p align="center">
+ <a href="#これは何ですか">これは何ですか?</a> •
+ <a href="#主な機能">主な機能</a> •
+ <a href="#技術スタック">技術スタック</a> •
+ <a href="#インストール">インストール</a> •
+ <a href="#クレジット">クレジット</a> •
+ <a href="#ライセンス">ライセンス</a>
+</p>
+
+<p align="center">
+ <a href="README.md">English</a> | <a href="README_CN.md">中文</a> | 日本語
+</p>
+
+---
+
+<p align="center">
+ <img src="assets/overview.jpg" width="100%" alt="概要">
+</p>
+
+## 主な機能
+
+- **2 段階 Ingest**: LLM がまず分析し、その後 source traceability 付きの Wiki ページを生成します。
+- **マルチモーダル画像 Ingest**: PDF などから埋め込み画像を抽出し、Vision LLM で事実ベースのキャプションを生成します。
+- **4 シグナル知識グラフ**: 直接リンク、source overlap、Adamic-Adar、type affinity による関連度モデル。
+- **Louvain コミュニティ検出**: 知識クラスタを自動検出し、凝集度を評価します。
+- **Graph Insights**: 意外な接続や知識ギャップを検出し、Deep Research を開始できます。
+- **ベクトル意味検索**: LanceDB ベースの任意の OpenAI-compatible embedding endpoint を利用できます。
+- **永続 Ingest Queue**: 直列処理、クラッシュ復旧、キャンセル、リトライ、進捗表示に対応します。
+- **フォルダインポート**: ディレクトリ構造を保った再帰インポートと、フォルダ文脈による分類ヒント。
+- **Source フォルダ Auto-Watch**: `raw/sources/` の外部変更を検出し、ingest/delete cleanup と同期します。
+- **Deep Research**: Tavily、SerpApi、SearXNG を使った複数クエリ検索と、結果の自動 Wiki 化。
+- **非同期 Review System**: LLM が判断待ち項目を作成し、ユーザーが後から確認できます。
+- **Chrome Web Clipper**: Web ページをワンクリップで取り込み、知識ベースへ自動 ingest します。
+
+## これは何ですか?
+
+LLM Wiki は、手元の文書を整理された相互リンク付きの知識ベースへ変換するクロスプラットフォームのデスクトップアプリです。従来の RAG のように毎回ゼロから検索して回答するのではなく、LLM が文書から**永続的な Wiki を増分的に構築・維持**します。
+
+このプロジェクトは [Andrej Karpathy の LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) に基づいています。抽象的な設計パターンを、実際に使えるデスクトップアプリとして実装し、多数の拡張を加えています。
+
+<p align="center">
+ <img src="assets/llm_wiki_arch.jpg" width="100%" alt="LLM Wiki アーキテクチャ">
+</p>
+
+## クレジット
+
+基礎となる方法論は **Andrej Karpathy** の [llm-wiki.md](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) です。本プロジェクトは、その設計を具体的なアプリケーションとして実装したものです。
+
+## 主な設計
+
+### 1. 3 層アーキテクチャ
+
+- **Raw Sources**: インポートした元資料。
+- **Wiki**: LLM が生成する構造化ページ。
+- **Schema / Purpose**: Wiki の構造ルールと目的。
+
+生成される Wiki は `[[wikilink]]`、YAML frontmatter、`index.md`、`log.md` を使い、Obsidian vault としても扱えます。
+
+### 2. 2 段階 Ingest
+
+```
+Step 1: Analysis
+ - 主要な entity / concept / argument を抽出
+ - 既存 Wiki との関連や矛盾を分析
+ - Wiki 構造の提案を作成
+
+Step 2: Generation
+ - source summary、entity、concept ページを生成
+ - index.md、log.md、overview.md を更新
+ - Review item と Deep Research 用クエリを生成
+```
+
+追加機能:
+
+- **SHA256 incremental cache**: 未変更の source は自動スキップ。
+- **Persistent ingest queue**: アプリ再起動後も queue を復元。
+- **Source folder auto-watch**: アプリ外で `raw/sources/` に追加・変更・削除されたファイルを検出し、同じ ingest/delete lifecycle で処理します。
+- **Progressive Sources view**: 大きな source フォルダでも、スクロールに合わせて段階的に表示します。
+- **Source traceability**: 生成ページは frontmatter の `sources: []` で元資料に紐づきます。
+
+### 3. Knowledge Graph
+
+知識グラフは sigma.js / graphology / ForceAtlas2 で描画されます。
+
+| Signal | Weight | Description |
+|--------|--------|-------------|
+| Direct link | ×3.0 | `[[wikilink]]` による直接リンク |
+| Source overlap | ×4.0 | 同じ raw source を共有するページ |
+| Adamic-Adar | ×1.5 | 共通近傍による関連性 |
+| Type affinity | ×1.0 | 同じ page type への加点 |
+
+Graph Insights は、意外な関連、孤立ページ、弱いコミュニティ、bridge node を検出し、必要に応じて Deep Research を開始できます。
+
+### 4. Search / Retrieval
+
+- Tokenized search は `wiki/` と `raw/sources/` を検索します。
+- 任意で embedding と LanceDB による vector semantic search を有効化できます。
+- 検索結果は知識グラフで拡張され、context budget に収まるよう優先順位付けされます。
+
+### 5. Deep Research
+
+Deep Research は、LLM が search topic と複数の search query を生成し、Web 検索結果を統合して Wiki ページとして保存します。
+
+対応 provider:
+
+- **Tavily**: 汎用 Web search。
+- **SerpApi**: Google、News、Scholar、Images、Videos、YouTube などの engine を選択可能。
+- **SearXNG**: 自前または利用可能な SearXNG instance URL と categories を設定して検索。
+
+### 6. Deletion / Cleanup
+
+source を削除すると、関連する source summary、`sources[]`、`index.md`、本文の `[[wikilink]]`、`related:` 参照が整理されます。複数 source に共有されている entity / concept ページは、ページ自体を消さずに削除された source だけを外します。
+
+## 技術スタック
+
+| Layer | Technology |
+|-------|------------|
+| Desktop | Tauri v2 (Rust backend) |
+| Frontend | React 19 + TypeScript + Vite |
+| UI | shadcn/ui + Tailwind CSS v4 |
+| Editor | Milkdown |
+| Graph | sigma.js + graphology + ForceAtlas2 |
+| Search | Tokenized search + graph relevance + optional LanceDB vector search |
+| Vector DB | LanceDB |
+| PDF | pdf-extract |
+| Office | docx-rs + calamine |
+| i18n | react-i18next |
+| State | Zustand |
+| LLM | Streaming fetch (OpenAI, Anthropic, Google, Ollama, Custom) |
+| Web Search | Tavily, SerpApi, SearXNG JSON API |
+
+## インストール
+
+### ビルド済みバイナリ
+
+[Releases](https://github.com/nashsu/llm_wiki/releases) からダウンロードできます。
+
+- **macOS**: `.dmg` (Apple Silicon + Intel)
+- **Windows**: `.msi`
+- **Linux**: `.deb` / `.AppImage`
+
+### ソースからビルド
+
+```bash
+# Requirements: Node.js 20+, Rust 1.70+
+git clone https://github.com/nashsu/llm_wiki.git
+cd llm_wiki
+npm install
+npm run tauri dev # Development
+npm run tauri build # Production build
+```
+
+### Chrome Extension
+
+1. `chrome://extensions` を開く
+2. Developer mode を有効にする
+3. Load unpacked をクリック
+4. `extension/` ディレクトリを選択
+
+## クイックスタート
+
+1. アプリを起動し、新しい project を作成します。
+2. **Settings** で LLM provider、API key、model を設定します。
+3. 必要に応じて **Web Search** provider と source folder auto-watch を設定します。
+4. **Sources** から PDF、DOCX、Markdown などをインポートします。
+5. **Activity Panel** で Wiki ページ生成の進捗を確認します。
+6. **Chat** で知識ベースに質問します。
+7. **Knowledge Graph** で関連を探索します。
+8. **Review** と **Lint** で Wiki の品質を保ちます。
+
+## Project Structure
+
+```
+my-wiki/
+├── purpose.md # 目的、問い、研究範囲
+├── schema.md # Wiki 構造ルール
+├── raw/
+│ ├── sources/ # 元資料
+│ └── assets/ # ローカル画像
+├── wiki/
+│ ├── index.md # コンテンツ目録
+│ ├── log.md # 操作履歴
+│ ├── overview.md # 全体概要
+│ ├── entities/ # 人物、組織、製品など
+│ ├── concepts/ # 理論、手法、概念
+│ ├── sources/ # source summary
+│ ├── queries/ # 保存した chat / research
+│ ├── synthesis/ # 横断的な分析
+│ └── comparisons/ # 比較ページ
+├── .obsidian/ # Obsidian vault 設定
+└── .llm-wiki/ # アプリ設定、chat history、review items
+```
+
+## ライセンス
+
+このプロジェクトは **GNU General Public License v3.0** でライセンスされています。詳細は [LICENSE](LICENSE) を参照してください。