sidleo/llm-wiki

Project Overview项目介绍

llm-wiki is an open-source, agent-first knowledge base whose storage layer strictly follows the Open Knowledge Format v0.2 (OKF v0.2) specification, while its operations layer reproduces Karpathy's llm-wiki pattern of ingest, query, lint, and index. A single core library and one shared data bundle drive four consumption forms that share semantics, namely the DSH native plugin, a Codex plugin, an MCP server, and a portable skill/CLI form, so the same Markdown concepts behave identically whether reached through a chat host or the command line. Per-directory rule files such as APPEND_SYSTEM_PROMPT.md are re-read every turn by the DSH before_agent_start hook, injected through Codex SessionStart / UserPromptSubmit lifecycle events without duplicating unchanged content, and reissued on demand by the MCP server when the bundle changes after initialize. A graphical configuration card under DSH Settings → Plugins exposes bundle management, Git remote status with one-click sync/init/clone, and a health panel that surfaces validate and lint counts plus an index-rebuild action.

Typical workflows start with wiki_list to expose the full directory tree, followed by wiki search and wiki get for targeted retrieval; reading a concept surfaces automatic backlinks that list the rules and pitfalls citing it, while writes pass through AGENTS.md write gates that require human confirmation for protected concept types. The intended audience is technical teams or individual researchers who want a vendor-neutral, version-controlled glossary, decision log, or style guide that both humans and agents can edit and audit side by side, with Obsidian or Feishu Drive available for visual browsing. Multiple bundles can be registered through ~/.agents/wiki-registry.json, the DSH plugin's dataDirs config block, or the runtime wiki_use / wiki dirs commands, and the active bundle can be scoped to one conversation or persisted globally, which makes it straightforward to keep separate workspaces for work and personal notes.

Dependencies center on Node.js, with subpackages requiring npm install (and --legacy-peer-deps for the pi extension); runtime parameters are deployment-level and live in the profile's cordis.patch.yml, deliberately hidden from the GUI card to avoid drift. The Feishu backend never deletes files on either side — deletions appear in the change list but require explicit paths and a bot-identity capable of writing — and conflicts in concepts or AGENTS.md files halt sync rather than overwrite. The test suites total more than one hundred and fifty checks across the core, DSH plugin mock, settings card host half, Git remote sync, Feishu backends, autosync scheduler, real-deletion safety, MCP SDK parity, and Codex lifecycle, but first-run users should still explore examples/demo-bundle with wiki list --dataDir examples/demo-bundle before porting their own collections. The repository ships under the MIT license.

llm-wiki 是一款以"代理优先"为设计理念的开源知识库,存储格式严格遵循 Open Knowledge Format v0.2(OKF v0.2)规范,操作流程沿用 Karpathy 所提出的 llm-wiki 模式,提供摄取、查询、校验与索引四大环节。项目以单一核心库加统一数据清单为基础,对外派生出四种使用形态:DSH 原生插件、Codex 插件、MCP 服务器,以及独立的 skill/CLI 命令行工具,各形态共享同一份 OKF 文档集合并保持行为一致。它通过 before_agent_start、MCP initialize、SessionStart 等钩子或内联注入方式,把每个目录下的 APPEND_SYSTEM_PROMPT.md 规则实时并入到代理的系统提示中,从而确保检索、创建与更新操作均携带约束策略。

典型使用场景为:开发者在任意目录建立 Markdown 概念文件构成的 OKF 知识包,启动对应形态后调用 wiki_list 浏览目录树,再用 wiki get、wiki search 钻取细节并查看反链。系统会自动维护 index.md 与 log.md,对过期与孤立节点进行标记,并支持多 bundle 注册与会话级切换,适用于需要长期沉淀团队规范、术语表与协作规则的技术团队或写作团队。同步后端提供 Git 仓库与飞书云盘两种选项,方便本地编辑、多机同步及人类可视化浏览。

依赖方面,核心为 Node.js,所有形态共用 OKF 解析与同源测试库;运行需安装各子包依赖(推荐 --legacy-peer-deps)。已通过的核心测试覆盖 smoke、DSS 插件 Mock、DSH 配置卡、Git 同步、飞书后端、自动同步及三形态一致性;飞书与真实删除需配置 lark-cli 并受限于变更列表对比策略,不会双端删文件。许可证为 MIT,首次运行建议先体验 examples/demo-bundle 再逐步迁移自有知识库。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • Only 6 stars - very few users, little community feedback星标只有 6,几乎没人在用,遇到问题缺少社区反馈
  • No DSH plugin manifest detected - it may only carry the dsh-plugin topic, so the install method must be confirmed on the spot未检测到 DSH 插件清单:可能只是打了 dsh-plugin 话题,安装方式要现场确认
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:sidleo/llm-wiki

把 sidleo/llm-wiki 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

llm-wiki — Agent Knowledge Base in Pure OKF v0.2 Markdown

English · 简体中文

An open-source, generic, agent-first knowledge base: the format layer strictly follows the Open Knowledge Format v0.2, and the operations layer follows Karpathy's llm-wiki pattern (ingest / query / lint + index / log). It ships in four consumption forms that share one core library and one data bundle.

Design Principles

  1. Strictly OKF v0.2 — the official spec is the single source of truth for the format; no custom frontmatter fields, no magic features at the consumption layer.
  2. Generic and vendor-neutral — not tied to any business or domain; the same bundle is readable and writable by any agent.

Features

  • Progressive disclosure — every session carries injected tool guidance plus the active bundle/category list; wiki_list shows the whole tree first, then you search and drill in.
  • Real cross-links + automatic backlinks — concepts reference each other with Markdown links; reading a concept automatically surfaces the pitfalls and rules that cite it.
  • Directory-level rules (AGENTS.md) — per-directory write gates (which concept types need human confirmation) and behavioral conventions, resolved bottom-up with child directories overriding parents.
  • Per-directory prompt injection (APPEND_SYSTEM_PROMPT.md) — each category defines its own behavior rules; identical content across all five forms and effective immediately after an edit. DSH rides a constant section plus a runtime-context snapshot; the pi extension hooks before_agent_start to re-read them every turn and append them to that turn's system prompt; the Codex plugin injects them through SessionStart / UserPromptSubmit hooks (no duplicate injection when unchanged, refresh next turn, rebuild after compaction); the MCP server sends the same text through the initialize instructions field (the protocol only delivers it once per connection — reconnect or call wiki rules after an edit); the skill/CLI form has no injection hook, so it uses wiki rules (no args = load every rule verbatim) plus rules automatically appended to wiki get/create/update responses — the rules travel with the data, so nothing depends on the agent remembering to load them. See SPEC-EXTENSIONS.md.
  • Lifecycle — stale_after expiry, status: deprecated (concept-level) and directory-level deprecation, auto-maintained index.md / log.md.
  • Validation & health — wiki_validate (OKF compliance) and wiki_lint (broken links, orphans, stale entries, missing index).
  • Multiple bundles — register several wiki directories as named bundles and switch between them (session-level or persisted globally).
  • Online knowledge base (two backends) — one wiki_sync / wiki sync entry point, dispatched by the bundle's backend:
    • Local directory + Git remote: commit → fetch/merge → push for multi-machine collaboration; force-push is never used.
    • Feishu cloud drive: the bundle lives in a Feishu Drive folder as a tree of native .md files (zero OKF format loss), read and written file-by-file through lark-cli; humans browse/download in Feishu, agents do the reading and writing. Both backends share one conflict policy: index.md is regenerated locally, log.md is merged as a union (never blocks), and a concept / AGENTS.md changed on both sides stops the sync with a conflict list — nothing is auto-overwritten. The Feishu backend never deletes files on either side (deletions are only reported).
  • Graphical configuration (DSH Web GUI) — an llm-wiki card under Settings → Plugins → Plugin configuration: named directories (add/rename/remove/set default), Git remote status with one-click sync/init/clone, and a health panel (validate/lint counts + rebuild index). Runtime parameters are deployment-level (the profile's cordis.patch.yml) and are deliberately not editable from the card.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-model-pro 下一个 Next dsh-image-gen →