开源项目 GitHub Trending 2026-09-10T12:01 正文 ok 3978 words

LLM Wiki:自动构建和维护个人知识库的跨平台桌面应用

英文标题:🔥 nashsu/llm_wiki

LLM Wiki 是一款跨平台桌面应用,可将 PDF、Office 文档、网页剪藏、图片和 URL 等资料自动整理为持续更新、相互关联的个人 Wiki。它采用两步式 LLM 导入流程、SHA256 增量缓存与持久化队列,相比每次查询都重新检索生成的传统 RAG,能够一次编译知识并长期维护。项目还提供四信号知识图谱、Louvain 社区发现、向量语义搜索、Deep Research、Chrome Web Clipper,以及内置本地 HTTP API、MCP Server 和 Agent Skill。对开发者而言,LLM Wiki 可作为兼容 Obsidian 的本地知识管理基础设施,并可接入任何兼容 OpenAI API 的模型与嵌入端点。
打开原文相关 4 · 机会 3
media29.8 KB media608.4 KB media556.5 KB media295.9 KB media329.8 KB media500.4 KB media592.4 KB media511.5 KB media1.5 MB media63.2 KB media63.1 KB media79.9 KB

中文

LLM Wiki 标志

一个能够自行构建的个人知识库。
LLM 会读取你的文档,构建结构化 Wiki,并持续保持其最新状态。

English | 中文 | 日本語 | 한국어


概览

  • 两步式思维链导入——LLM 先进行分析,再生成 Wiki 页面,并支持来源可追溯性和增量缓存
  • 多模态图像导入——从 PDF 中提取嵌入图像,通过视觉 LLM 生成基于事实的图注;在具备图像感知能力的搜索结果中展示图像,并提供灯箱预览和跳转至来源功能
  • 多格式文档解析——可导入 PDF、Office 文档、EPUB/MOBI、Org mode、图像、媒体、网页剪藏和批量 URL;内置云端或本地 MinerU PDF 处理能力
  • 灵活的模型配置——可按项目配置模型,独立路由 Chat 与 Ingest,并管理自定义 Provider、请求头和流式输出
  • 基于来源的检索——使用 Read Sources Only 模式,仅依据原始导入材料回答问题
  • 项目管理与迁移——可在设备间导出和导入完整项目归档,并可从现有页面重建 Wiki 索引
  • 四信号知识图谱——通过直接链接、来源重叠、Adamic-Adar 和类型亲和度构成关联性模型
  • Louvain 社区发现——自动发现知识集群并计算内聚度评分
  • 图谱洞察——发现意外连接与知识缺口,并可一键启动 Deep Research
  • 向量语义搜索——可选用 LanceDB 实现基于嵌入的检索,支持任意 OpenAI 兼容端点
  • 持久化导入队列——串行处理,支持崩溃恢复、取消、重试和进度可视化
  • 文件夹导入——递归导入文件夹并保留目录结构,将文件夹上下文作为 LLM 分类提示
  • 来源文件夹自动监控——检测 raw/sources/ 中的外部变更,并同步执行导入与删除清理
  • Deep Research——由 LLM 优化搜索主题,通过 Tavily、SerpApi 或 SearXNG 进行多查询网页搜索,并将结果自动导入 Wiki
  • Rust 后端 Chat Agent——支持使用工具的聊天运行时,具备 Wiki/来源/图谱/网页检索、工作区文件生成、Shell 审批、取消任务及流式工具事件能力
  • Agent Skills——扫描并启用本地 SKILL.md 文件夹,使用 /skill 选择技能,并让 Agent 按需读取技能说明
  • 生成结果预览——Agent 创建的 Markdown、HTML、图像及其他工作区文件将显示为输出结果,支持预览和快速打开所在文件夹
  • Mermaid 图表渲染——直接在聊天和预览中渲染 Mermaid 代码块;若出现语法错误,将显示紧凑错误卡片,而非原始解析器输出
  • 异步审阅系统——LLM 标记需要人工判断的项目,并提供预定义操作和预生成搜索查询
  • Chrome Web Clipper——一键捕获网页,并自动导入知识库
  • 本地 HTTP API + MCP Server + AI Agent Skill——内置 127.0.0.1:19828 JSON API 和随附 MCP Server,可用于混合搜索、文件读取、图谱遍历和来源重新扫描;现成的 agent skill 可通过一条命令安装至 Claude Code / Codex(npx skills add …)

LLM Wiki 是一款跨平台桌面应用,可自动将你的文档转化为有组织、相互链接的知识库。不同于传统 RAG(每次都从头检索和回答),LLM 会根据你的来源增量构建并维护一个持久化 Wiki。知识只需编译一次并持续更新,而不是在每次查询时重新推导。

本项目基于 Karpathy 的 LLM Wiki 模式——一种使用 LLM 构建个人知识库的方法论。llm_wiki 由 nash_su 创建和维护,其将核心理念实现为完整的桌面应用,并进行了大量增强。

LLM Wiki 架构

基础方法论来自 Andrej Karpathy 的 llm-wiki.md,该文描述了使用 LLM 增量构建和维护个人 Wiki 的模式。原始文档是一种抽象设计模式;本项目则是带有大量扩展的具体实现。

我们保留自原始方案的内容

核心架构忠实遵循 Karpathy 的设计:

  • 三层架构:原始来源(不可变)→ Wiki(由 LLM 生成)→ Schema(规则与配置)
  • 三个核心操作:Ingest、Query、Lint
  • index.md 作为内容目录和 LLM 导航入口
  • log.md 作为采用可解析格式的按时间顺序操作记录
  • 使用 [[wikilink]] 语法进行交叉引用
  • 每个 Wiki 页面均使用 YAML frontmatter
  • 兼容 Obsidian——Wiki 目录可作为 Obsidian vault 使用
  • 人类策展,LLM 维护——这一根本性的角色分工

Obsidian 兼容性

1. 从 CLI 到桌面应用

原始方案是一份为复制粘贴给 LLM Agent 而设计的抽象模式文档。我们将其构建为一款完整的跨平台桌面应用,具备:

  • 三栏布局:知识树/文件树(左)+ Chat(中)+ 预览(右)
  • 图标侧边栏,可在 Wiki、Sources、Search、Graph、Lint、Review、Deep Research 和 Settings 之间切换
  • 可自定义调整大小的面板——可拖拽调整左右面板宽度,并设置最小/最大限制
  • 活动面板——显示实时处理状态和逐文件导入进度
  • 所有状态均持久化——对话、设置、审阅项目和项目配置在重启后仍会保留
  • 场景模板——Research、Reading、Personal Growth、Business、General;每个模板都会预配置 purpose.md 和 schema.md

2. Purpose.md —— Wiki 的灵魂

原始方案包含 Schema(Wiki 的工作方式),但没有正式定义 Wiki 为何存在的位置。我们加入了 purpose.md:

  • 定义目标、关键问题、研究范围和持续演进的论点
  • LLM 在每次导入和查询时读取它,以获得上下文
  • LLM 可根据使用模式建议更新
  • 它不同于 schema——schema 是结构规则,purpose 是方向意图

3. 两步式思维链导入

原始方案描述的是单步导入,LLM 同时进行阅读与写作。我们将其拆分为两个连续的 LLM 调用,以显著提升质量:

Step 1 (Analysis): LLM reads source → structured analysis
  - Key entities, concepts, arguments
  - Connections to existing wiki content
  - Contradictions & tensions with existing knowledge
  - Recommendations for wiki structure

Step 2 (Generation): LLM takes analysis → generates wiki files
  - Source summary with frontmatter (type, title, sources[])
  - Entity pages, concept pages with cross-references
  - Updated index.md, log.md, overview.md
  - Review items for human judgment
  - Search queries for Deep Research

除原始方案外,导入功能还进行了以下增强:

  • SHA256 增量缓存——导入前会对来源文件内容进行哈希;未发生变化的文件将被自动跳过,从而节省 LLM Token 和时间
  • 持久化导入队列——串行处理可防止并发 LLM 调用;队列会持久化至磁盘,应用重启后仍可恢复;失败任务最多自动重试 3 次
  • 文件夹导入——递归导入文件夹并保留目录结构;文件夹路径会作为分类上下文传递给 LLM(例如,papers > energy 有助于内容分类)
  • 来源文件夹自动监控——在应用外部向 raw/sources/ 添加、编辑或删除文件时,系统会自动识别,并复用与应用内操作相同的导入/删除生命周期
  • 队列可视化——Activity Panel 显示进度条、待处理/处理中/失败任务,并提供取消和重试按钮
  • 自动嵌入——启用向量搜索后,新页面将在导入后自动生成嵌入
  • 来源可追溯性——每个生成的 Wiki 页面都会在 YAML frontmatter 中包含 sources: [] 字段,链接回为其提供内容的原始来源文件
  • overview.md 自动更新——每次导入时重新生成全局摘要页面,以反映 Wiki 的最新状态
  • 保证生成来源摘要——即使 LLM 遗漏来源摘要页面,回退机制也会确保始终创建该页面
  • 语言感知生成——LLM 使用用户配置的语言(英语或中文)响应
  • 渐进式 Sources 视图——大型来源文件夹会在滚动时渐进渲染,确保大型来源集合仍具备良好响应速度

4. 带关联性模型的知识图谱

知识图谱

原始方案提及使用 [[wikilinks]] 进行交叉引用,但没有图谱分析。我们构建了完整的知识图谱可视化与关联性引擎:

四信号关联性模型:

信号 权重 说明
直接链接 ×3.0 通过 [[wikilinks]] 链接的页面
来源重叠 ×4.0 共享相同原始来源的页面(通过 frontmatter sources[])
Adamic-Adar ×1.5 共享共同邻居的页面(按邻居度数加权)
类型亲和度 ×1.0 相同页面类型的加分项(实体↔实体、概念↔概念)

图谱可视化(sigma.js + graphology + ForceAtlas2):

  • 节点按页面类型或社区着色,大小按链接数量缩放(√ 缩放)
  • 边的粗细和颜色按关联性权重显示(绿色=强,灰色=弱)
  • 悬停交互:邻居节点保持可见,非邻居变暗,边会高亮并显示关联性分数标签
  • 缩放控件(ZoomIn、ZoomOut、Fit-to-screen)
  • 位置缓存可防止数据更新时布局跳动
  • 图例会根据着色模式,在类型计数与社区信息之间切换

5. Louvain 社区发现

原始方案中没有此功能。系统使用 Louvain 算法(graphology-communities-louvain)自动发现知识集群:

  • 自动聚类——根据链接拓扑发现哪些页面会自然聚合,与预定义页面类型无关
  • 类型/社区切换——可按页面类型(实体、概念、来源等)或按已发现的知识集群切换节点着色
  • 内聚度评分——每个社区根据内部边密度(实际边数/可能边数)评分;低内聚度集群(< 0.15)会被标记警告
  • 12 色调色板——在集群之间实现清晰的视觉区分
  • 社区图例——展示每个集群的顶部节点标签、成员数和内聚度

Louvain 社区发现

6. 图谱洞察——意外连接与知识缺口

原始方案中没有此功能。系统会自动分析图谱结构,以呈现可执行的洞察:

意外连接:

  • 检测非预期关系:跨社区边、跨类型链接、边缘节点↔枢纽节点耦合
  • 使用复合惊喜度评分,对最值得关注的连接进行排序
  • 支持忽略——可将连接标记为已审阅,使其不再出现

知识缺口:

  • 孤立页面(度数 ≤ 1)——与 Wiki 其余部分几乎没有或完全没有连接的页面
  • 稀疏社区(内聚度 < 0.15,且页面数 ≥ 3)——内部交叉引用较弱的知识领域
  • 桥接节点(连接 3 个以上集群)——将多个知识领域连接起来的关键枢纽页面

交互:

  • 点击任意洞察卡片即可在图谱中高亮相应的节点和边;再次点击可取消选择
  • 知识缺口和桥接节点均提供 Deep Research 按钮——可触发由 LLM 优化、具备领域感知能力的研究流程(读取 overview.md + purpose.md 以获取上下文)
  • 启动前会在可编辑的确认对话框中展示研究主题——用户可优化主题和搜索查询

图谱洞察

7. 优化的查询检索管线

原始方案描述的是简单查询,即 LLM 读取相关页面。我们构建了一个多阶段检索管线,支持可选向量搜索与预算控制:

Phase 1: Tokenized Search
  - English: word splitting + stop word removal
  - Chinese: CJK bigram tokenization (每个 → [每个, 个…])
  - Title match bonus (+10 score)
  - Searches both wiki/ and raw/sources/

Phase 1.5: Vector Semantic Search (optional)
  - Embedding via any OpenAI-compatible /v1/embeddings endpoint
  - Stored in LanceDB (Rust backend) for fast ANN retrieval
  - Cosine similarity finds semantically related pages even without keyword overlap
  - Results merged into search: boosts existing matches + adds new discoveries

Phase 2: Graph Expansion
  - Top search results used as seed nodes
  - 4-signal relevance model finds related pages
  - 2-hop traversal with decay for deeper connections

Phase 3: Budget Control
  - Configurable context window: 4K → 1M tokens
  - Proportional allocation: 60% wiki pages, 20% chat history, 5% index, 15% system
  - Pages pr

English / 原文

LLM Wiki Logo

A personal knowledge base that builds itself.
LLM reads your documents, builds a structured wiki, and keeps it current.

What is this? • Features • Tech Stack • Installation • Credits • License

English | 中文 | 日本語 | 한국어


Overview

  • Two-Step Chain-of-Thought Ingest — LLM analyzes first, then generates wiki pages with source traceability and incremental cache
  • Multimodal Image Ingestion — extract embedded images from PDFs, generate factual captions with a vision LLM, surface them in image-aware search results with lightbox preview and jump-to-source
  • Multi-format Document Parsing — ingest PDF, Office documents, EPUB/MOBI, Org mode, images, media, web clips, and batches of URLs, with built-in, cloud, or local MinerU PDF processing
  • Flexible Model Configuration — configure models per project, route Chat and Ingest independently, and manage custom providers, headers, and streaming output
  • Source-grounded Retrieval — use Read Sources Only mode to answer exclusively from original imported material
  • Project Management & Migration — export and import complete project archives across devices, and rebuild the Wiki index from existing pages
  • 4-Signal Knowledge Graph — relevance model with direct links, source overlap, Adamic-Adar, and type affinity
  • Louvain Community Detection — automatic knowledge cluster discovery with cohesion scoring
  • Graph Insights — surprising connections and knowledge gaps with one-click Deep Research
  • 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
  • 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
  • Rust Backend Chat Agent — tool-using chat runtime with wiki/source/graph/web retrieval, workspace file generation, shell approval, cancellation, and streaming tool events
  • Agent Skills — scan and enable local SKILL.md folders, select skills with /skill, and let the Agent read skill instructions on demand
  • Generated Outputs Preview — Agent-created Markdown, HTML, images, and other workspace files appear as outputs with preview and quick folder access
  • Mermaid Diagram Rendering — render Mermaid code blocks directly in chat and preview, with compact syntax-error cards instead of raw parser output
  • 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
  • Local HTTP API + MCP Server + AI Agent Skill — built-in 127.0.0.1:19828 JSON API and bundled MCP server for hybrid search, file read, graph traversal, and source rescan; ready-made agent skill installs into Claude Code / Codex with one command (npx skills add …)

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. Knowledge is compiled once and kept current, not re-derived on every query.

This project is based on Karpathy's LLM Wiki pattern — a methodology for building personal knowledge bases using LLMs. llm_wiki is created and maintained by nash_su, who implemented the core ideas as a full desktop application with significant enhancements.

LLM Wiki Architecture

The foundational methodology comes from Andrej Karpathy 's llm-wiki.md, which describes the pattern of using LLMs to incrementally build and maintain a personal wiki. The original document is an abstract design pattern; this project is a concrete implementation with substantial extensions.

What We Kept from the Original

The core architecture follows Karpathy's design faithfully:

  • Three-layer architecture : Raw Sources (immutable) → Wiki (LLM-generated) → Schema (rules & config)
  • Three core operations : Ingest, Query, Lint
  • index.md as the content catalog and LLM navigation entry point
  • log.md as the chronological operation record with parseable format
  • [[wikilink]] syntax for cross-references
  • YAML frontmatter on every wiki page
  • Obsidian compatibility — the wiki directory works as an Obsidian vault
  • Human curates, LLM maintains — the fundamental role division

Obsidian Compatibility

1. From CLI to Desktop Application

The original is an abstract pattern document designed to be copy-pasted to an LLM agent. We built it into a full cross-platform desktop application with:

  • Three-column layout : Knowledge Tree / File Tree (left) + Chat (center) + Preview (right)
  • Icon sidebar for switching between Wiki, Sources, Search, Graph, Lint, Review, Deep Research, Settings
  • Custom resizable panels — drag-to-resize left and right panels with min/max constraints
  • Activity panel — real-time processing status showing file-by-file ingest progress
  • All state persisted — conversations, settings, review items, project config survive restarts
  • Scenario templates — Research, Reading, Personal Growth, Business, General — each pre-configures purpose.md and schema.md

2. Purpose.md — The Wiki's Soul

The original has Schema (how the wiki works) but no formal place for why the wiki exists. We added purpose.md:

  • Defines goals, key questions, research scope, evolving thesis
  • LLM reads it during every ingest and query for context
  • LLM can suggest updates based on usage patterns
  • Different from schema — schema is structural rules, purpose is directional intent

3. Two-Step Chain-of-Thought Ingest

The original describes a single-step ingest where the LLM reads and writes simultaneously. We split it into two sequential LLM calls for significantly better quality:

Step 1 (Analysis): LLM reads source → structured analysis
  - Key entities, concepts, arguments
  - Connections to existing wiki content
  - Contradictions & tensions with existing knowledge
  - Recommendations for wiki structure

Step 2 (Generation): LLM takes analysis → generates wiki files
  - Source summary with frontmatter (type, title, sources[])
  - Entity pages, concept pages with cross-references
  - Updated index.md, log.md, overview.md
  - Review items for human judgment
  - Search queries for Deep Research

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

Knowledge Graph

The original mentions [[wikilinks]] for cross-references but has no graph analysis. We built a full knowledge graph visualization and relevance engine :

4-Signal Relevance Model:

Signal Weight Description
Direct link ×3.0 Pages linked via [[wikilinks]]
Source overlap ×4.0 Pages sharing the same raw source (via frontmatter sources[])
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)

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)
  • Hover interaction: neighbors stay visible, non-neighbors dim, edges highlight with relevance score label
  • Zoom controls (ZoomIn, ZoomOut, Fit-to-screen)
  • Position caching prevents layout jumps when data updates
  • Legend switches between type counts and community info based on coloring mode

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

Louvain Community Detection

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

Graph Insights

7. Optimized Query Retrieval Pipeline

The original describes a simple query where the LLM reads relevant pages. We built a multi-phase retrieval pipeline with optional vector search and budget control:

Phase 1: Tokenized Search
  - English: word splitting + stop word removal
  - Chinese: CJK bigram tokenization (每个 → [每个, 个…])
  - Title match bonus (+10 score)
  - Searches both wiki/ and raw/sources/

Phase 1.5: Vector Semantic Search (optional)
  - Embedding via any OpenAI-compatible /v1/embeddings endpoint
  - Stored in LanceDB (Rust backend) for fast ANN retrieval
  - Cosine similarity finds semantically related pages even without keyword overlap
  - Results merged into search: boosts existing matches + adds new discoveries

Phase 2: Graph Expansion
  - Top search results used as seed nodes
  - 4-signal relevance model finds related pages
  - 2-hop traversal with decay for deeper connections

Phase 3: Budget Control
  - Configurable context window: 4K → 1M tokens
  - Proportional allocation: 60% wiki pages, 20% chat history, 5% index, 15% system
  - Pages prioritized by combined search + graph relevance score

Phase 4: Context Assembly
  - Numbered pages with full content (not just summaries)
  - System prompt includes: purpose.md, language rules, citation format, index.md
  - LLM instructed to cite pages by number: [1], [2], etc.

Vector Search is fully optional — disabled by default, enabled in Settings with independent endpoint, API key, and model configuration. When disabled, the pipeline falls back to tokenized search + graph expansion. Benchmark: overall recall improved from 58.2% to 71.4% with vector search enabled.

8. Multi-Conversation Chat with Persistence

The original has a single query interface. We built full multi-conversation support :

  • Independent chat sessions — create, rename, delete conversations
  • Conversation sidebar — quick switching between topics
  • Per-conversation persistence — each conversation saved to .llm-wiki/chats/{id}.json
  • Configurable history depth — limit how many messages are sent as context (default: 10)
  • Cited references panel — collapsible section on each response showing which wiki pages were used, grouped by type with icons
  • Reference persistence — cited pages stored directly in message data, stable across restarts
  • 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

9. Rust Backend Chat Agent & Skills

Not in the original. Chat now runs through a Rust backend Agent runtime rather than a browser-only TypeScript loop:

  • Tool-using Agent — can choose wiki search, source search, graph search, web search, AnyTXT, workspace file tools, approved shell commands, and skill file reads
  • Skill management — scan project and user skill folders, enable or disable skills, and pick a skill per conversation with /skill completion
  • Generated workspace outputs — files produced by Agent tools are kept under agent-workspace/, shown as generated outputs, and can be previewed or opened from the chat
  • User interaction forms — skills can ask for structured user input such as single choice, multiple choice, or free text without hardcoding skill-specific UI
  • Safer execution model — project workspace commands can continue smoothly, while external shell commands still require explicit approval

10. Thinking / Reasoning Display

Not in the original. For LLMs that emit <think> blocks (DeepSeek, QwQ, etc.):

  • Streaming thinking — rolling 5-line display with opacity fade during generation
  • Collapsed by default — thinking blocks hidden after completion, click to expand
  • Visual separation — thinking content shown in distinct style, separate from the main response

11. Markdown Rendering: KaTeX Math & Mermaid Diagrams

Not in the original. Rich Markdown rendering across chat and preview:

  • KaTeX rendering — inline $...$ and block $$...$$ formulas rendered via remark-math + rehype-katex
  • Milkdown math plugin — preview editor renders math natively via @milkdown/plugin-math
  • 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
  • Mermaid code blocks — fenced mermaid diagrams render directly as flowcharts, sequence diagrams, and other Mermaid-supported visuals
  • Compact Mermaid errors — syntax failures are captured inside a small error card instead of spilling raw parser output into the chat

12. Review System (Async Human-in-the-Loop)

The original suggests staying involved during ingest. We added an asynchronous review queue :

  • LLM flags items needing human judgment during ingest
  • Predefined action types : Create Page, Deep Research, Skip — constrained to prevent LLM hallucination of arbitrary actions
  • 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

Deep Research

Not in the original. When the LLM identifies knowledge gaps:

  • 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
  • LLM synthesizes findings into a wiki research page with cross-references to existing wiki
  • Thinking display — <think> blocks shown as collapsible sections during synthesis, auto-scroll to latest content
  • Auto-ingest — research results automatically processed to extract entities/concepts into the wiki
  • Task queue with 3 concurrent tasks
  • Research Panel — dedicated sidebar panel with dynamic height, real-time streaming progress

14. Browser Extension (Web Clipper)

Chrome Extension Web Clipper

The original mentions Obsidian Web Clipper. We built a dedicated Chrome Extension (Manifest V3):

  • Mozilla Readability.js for accurate article extraction (strips ads, nav, sidebars)
  • Turndown.js for HTML → Markdown conversion with table support
  • Project picker — choose which wiki to clip into (supports multi-project)
  • Local HTTP API (port 19827, tiny_http) — Extension ↔ App communication
  • Auto-ingest — clipped content automatically triggers the two-step ingest pipeline
  • Clip watcher — polls every 3 seconds for new clips, processes automatically
  • Offline preview — shows extracted content even when app is not running

15. Multi-format Document Support

The original focuses on text/markdown. We support structured extraction preserving document semantics:

Format Method
PDF Built-in pdf-extract (Rust) with file caching; optional MinerU Cloud, Local API, or Pipeline parsing for complex layouts
DOCX docx-rs — headings, bold/italic, lists, tables → structured Markdown
PPTX ZIP + XML — slide-by-slide extraction with heading/list structure
XLSX/XLS/ODS calamine — proper cell types, multi-sheet support, Markdown tables
EPUB/MOBI Electronic book metadata, chapters, and body text → ingest-ready content
Images Native preview (png, jpg, gif, webp, svg, etc.)
Video/Audio Built-in player
Web clips Readability.js + Turndown.js → clean Markdown

MinerU is optional. Use MinerU Cloud, an official Local API endpoint, or Local Pipeline mode for complex PDFs. Local modes keep processing on your machine, and extracted images are stored in the project-managed wiki/media directory. If MinerU fails, LLM Wiki falls back to the built-in parser.

16. File Deletion with Cascade Cleanup

The original has no deletion mechanism. We added intelligent cascade deletion :

  • Deleting a source file removes its wiki summary page
  • 3-method matching finds related wiki pages: frontmatter sources[] field, source summary page name, frontmatter section references
  • Shared entity preservation — entity/concept pages linked to multiple sources only have the deleted source removed from their sources[] array, not deleted entirely
  • Index cleanup — removed pages are purged from index.md
  • Wikilink cleanup — dead [[wikilinks]] to deleted pages are removed from remaining wiki pages

17. Configurable Context Window

Not in the original. Users can configure how much context the LLM receives:

  • Slider from 4K to 1M tokens — adapts to different LLM capabilities
  • Proportional budget allocation — larger windows get proportionally more wiki content
  • 60/20/5/15 split — wiki pages / chat history / index / system prompt

18. Cross-Platform Compatibility

The original is platform-agnostic (abstract pattern). We handle concrete cross-platform concerns:

  • Path normalization — unified normalizePath() used across 22+ files, backslash → forward slash

  • Unicode-safe string handling — char-based slicing instead of byte-based (prevents crashes on CJK filenames)

  • macOS close-to-hide — close button hides window (app stays running in background), click dock icon to restore, Cmd+Q to quit

  • Windows/Linux close confirmation — confirmation dialog before quitting to prevent accidental data loss

  • Tauri v2 — native desktop on macOS, Windows, Linux

  • GitHub Actions CI/CD — automated builds for macOS (ARM + Intel), Windows (.msi), Linux (.deb / .AppImage)

  • i18n — English + Chinese interface (react-i18next)

  • Settings persistence — LLM provider, API key, model, context size, language saved via Tauri Store

  • Obsidian config — auto-generated .obsidian/ directory with recommended settings

  • Markdown rendering — GFM tables with borders, proper code blocks, wikilink processing in chat and preview

  • Multi-provider LLM support — OpenAI, Anthropic, Google, Ollama, Custom — each with provider-specific streaming and headers

  • Configurable LLM timeout — adjust request timeouts for slow local models and long-running operations

  • Configurable Firecrawl — optional API key and custom Base URL for hosted or self-hosted services

  • Collapsible file sidebar — collapse Knowledge/Files navigation while preserving its state

  • Project maintenance — ZIP export/import for migration and deterministic wiki/index.md rebuilding

  • dataVersion signaling — graph and UI automatically refresh when wiki content changes

Layer Technology
Desktop Tauri v2 (Rust backend)
Frontend React 19 + TypeScript + Vite
UI shadcn/ui + Tailwind CSS v4
Editor Milkdown (ProseMirror-based WYSIWYG)
Graph sigma.js + graphology + ForceAtlas2
Search Tokenized search + graph relevance + optional vector (LanceDB)
Vector DB LanceDB (Rust, embedded, optional)
Documents pdf-extract + MinerU Cloud/Local + docx-rs + calamine + EPUB/MOBI extraction
i18n react-i18next
State Zustand
LLM Streaming fetch (OpenAI, Anthropic, Google, Ollama, Custom)
Web Search Tavily, SerpApi, SearXNG JSON API

Download from Releases:

  • macOS : .dmg (Apple Silicon + Intel)

  • Windows : .msi

  • Linux : .deb / .AppImage

    Prerequisites: Node.js 20+, Rust 1.88+, protoc

    macOS: brew install protobuf

    Linux: sudo apt install protobuf-compiler

    Windows: choco install protoc

    git clone https://github.com/nashsu/llm_wiki.git cd llm_wiki npm install npm --prefix mcp-server ci && npm run mcp:build # mcp-server/dist is bundled as a Tauri resource npm run tauri dev # Development npm run tauri build # Production build

  1. Open chrome://extensions

  2. Enable "Developer mode"

  3. Click "Load unpacked"

  4. Select the extension/ directory

  5. Clip the current page with Alt+Shift+L (Command+Shift+L on macOS). Customize it at chrome://extensions/shortcuts.

  6. Launch the app → Create a new project (choose a template)

  7. Go to Settings → Configure your LLM provider (API key + model)

  8. Optional: configure Web Search providers and source folder auto-watch in Settings

  9. Go to Sources → Import documents (PDF, DOCX, MD, etc.)

  10. Watch the Activity Panel — LLM automatically builds wiki pages

  11. Use Chat to query your knowledge base

  12. Browse the Knowledge Graph to see connections

  13. Check Review for items needing your attention

  14. Run Lint periodically to maintain wiki health

Local HTTP API + MCP Server + AI Agent Skill

LLM Wiki ships a built-in local HTTP API at http://127.0.0.1:19828 (token-protected, 127.0.0.1-only) so external tools — including AI agents like Claude Code , Codex , or any HTTP-capable script — can query your wiki:

  • GET /api/v1/health — server status (no auth)
  • GET /api/v1/projects — list projects
  • GET /api/v1/projects/{id}/files / files/content — read files and content
  • GET /api/v1/projects/{id}/reviews?status=unresolved — export Review tab items for wiki maintenance (status: unresolved, resolved, or all; optional type and limit)
  • PATCH /api/v1/projects/{id}/reviews/{reviewId} — update one Review item (JSON body { "resolved": true, "action": "label" }; resolved defaults to true, pass false to reopen)
  • POST /api/v1/projects/{id}/reviews/resolve — bulk-resolve Review items (JSON body { "ids": [...], "action": "label" }), returns { resolved, notFound, count }; the Review tab's Refresh button re-reads the result from disk
  • POST /api/v1/projects/{id}/search — hybrid retrieval (keyword + vector) returning mode, tokenHits, vectorHits, per-result vectorScore
  • POST /api/v1/projects/{id}/chat — backend Agent chat endpoint for wiki/source/web/AnyTXT retrieval. JSON requests remain non-streaming by default; send "stream": true or Accept: text/event-stream for SSE events (meta, incremental agent, then done, cancelled, or error). The terminal done frame contains the complete aggregate response, so clients should not render both message deltas and the final message as separate answers. mode: "deep" broadens evidence collection, while the full Deep Research workspace remains available in the desktop UI
  • GET /api/v1/projects/{id}/graph — wikilinks graph
  • POST /api/v1/projects/{id}/sources/rescan — trigger a backend rescan
  • POST /api/v1/projects/{id}/pages/embed — index one externally created or updated wiki/*.md page without rebuilding the whole vector database

Enable the API, generate a token, and choose whether local unauthenticated access is allowed in Settings → API + MCP.

For MCP-compatible clients, LLM Wiki also includes a local MCP server in mcp-server/. After building it with npm run mcp:build, Settings → API + MCP shows a copyable MCP client configuration with the correct local path for your machine. The MCP tools call the same API surface, so agent clients can list projects, read files, export unresolved Review items, run hybrid search, inspect the graph, trigger source rescans, and call the same Rust backend Agent chat endpoint without custom HTTP glue code.

Plug your AI agent in with one command

A ready-made agent skill for LLM Wiki lives in its own repo. Install it into Claude Code / Codex / any skills-compatible runtime:

npx skills add https://github.com/nashsu/llm_wiki_skill.git --skill llm-wiki

After install, the agent can answer prompts like "what does my LLM Wiki say about X", "search my 知识库 for Y", "show the neighborhood of node Z in my wiki graph", and "rescan my wiki sources" by talking to your locally-running app — read-only by default, citing wiki page paths so you can verify in-app.

  • Skill repo : https://github.com/nashsu/llm_wiki_skill

  • Trigger discipline : it intentionally does not trigger on generic "search my notes" / "check my Obsidian / Notion / Logseq" — only when you explicitly name LLM Wiki / my wiki / 知识库.

    my-wiki/ ├── purpose.md # Goals, key questions, research scope ├── schema.md # Wiki structure rules, page types ├── raw/ │ ├── sources/ # Uploaded documents (immutable) │ └── assets/ # Local images ├── wiki/ │ ├── index.md # Content catalog │ ├── log.md # Operation history │ ├── overview.md # Global summary (auto-updated) │ ├── entities/ # People, organizations, products │ ├── concepts/ # Theories, methods, techniques │ ├── sources/ # Source summaries │ ├── queries/ # Saved chat answers + research │ ├── synthesis/ # Cross-source analysis │ └── comparisons/ # Side-by-side comparisons ├── .obsidian/ # Obsidian vault config (auto-generated) └── .llm-wiki/ # App config, chat history, review items

Star History Chart

This project is licensed under the GNU General Public License v3.0 — see LICENSE for details.