Sidebar knowledge base for DSH: indexes local Obsidian vaults and project folders into SQLite FTS5, re-indexes file changes automatically, shows source snippets while you type, and lets the agent answer with numbered citations that open the exact source file and line. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:AvenYQ/dsh-knowledge
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
DSH 左侧栏「知识库」入口:把本地 Obsidian 库、项目文件夹和收藏同步进来的帖子建成索引。可以边打字边看原文,也可以让 AI 读完相关资料再回答,回答里每句结论都标出处。
界面(0.3.0)
- 首页:每次打开换一句诗文(中外诗词、哲学;外文附译文),会按情况挑主题:刚收进新东西、刚聊得很深、夜里。输入框边打字边出原文片段;按 ↵ 让 AI 回答,⇧↵ 换行,↑↓ 选原文后 ↵ 直接打开。文件夹按钮可以把范围限定在某几个数据源。
- 问答:AI 先把问题拆成检索词去翻,判断资料够不够,不够就换个说法再翻(最多 3 轮),再流式写出回答。来自资料的结论带 [n] 角标,悬停对应右侧参考资料,点开就是原文;资料里没有的内容单独放在「一般经验」框里。话题存在
~/.dsh/knowledge/chats/,一个话题一个 JSON 文件。模型用 DSH 当前默认模型,拆词和判断这两步用同一家的快速模式。 - 浏览:玻璃文件夹,打开时纸张从文件夹口铺到桌面上;左侧目录树;S / M / L 三种大小(⌘− / ⌘+)。最上面一行是「刚收进来」。
- 数据源:系统的选择窗口添加文件夹,扫描时文件夹会翻动并计数;移除后 5 秒内可以撤销。
- 阅读:原文按 Markdown 排版,命中的那段高亮;可复制路径、在 Finder 中显示、引用到对话。
- 带到对话 / 引用到对话:内容先复制到剪贴板;对话输入框在页面上就直接放进去,不在就等你切回对话时自动放进去(两分钟内有效)。
- 日夜跟随 DSH;输入框用和 Dune 一样的彗星光标(颜色、粗细读 Dune 的设置);系统开了「减少动态效果」时动效全部收短。
- 界面跑在 Shadow DOM 里,样式和 DSH、其他插件互不影响。
索引
- 数据源管理:添加任意文件夹(自动识别 Obsidian 库)、移除、单独扫描。
- 增量扫描:SHA-256 指纹,只重算变更文件;自动删除已消失文件;启动后 1.5 秒自动扫一次。
- 文件夹监听(0.2.0):新增 / 修改 / 删除 / 改名约 1.5 秒后自动入库;每 10 分钟定时对账兜底。数据源文件夹暂时不在时只停监听、不清索引,30 秒后自动重试。
- 中文友好切块:按 CJK 占比插值(中文 560 字 / 重叠 80,英文 1500 / 200),每块带 Markdown 标题前缀与行号。
- 检索(0.3.0):多词模糊检索。问句先去掉「怎么」「什么」这类虚词,再按词和二字片段召回打分;整词命中、标题命中加分,作废版本降权;每篇最多 2 段。
- 已作废标记:路径含
90_历史版本/_旧版_/作废/trash/的文档标superseded。 - Agent 工具:
kb_search(会话里直接查,返回带锚点的 markdown)。 - 只读:对源文件零写入。
数据与配置
- 索引库:
~/.dsh/knowledge/kb.db(SQLite + FTS5,WAL) - 配置:
~/.dsh/knowledge/config.json(首次修改数据源时生成);每个数据源可以加color(如"#7B61FF")和sym(notegearmarkpeoplebookboxdowndot)自定义文件夹的颜色和符号 - 问答话题:
~/.dsh/knowledge/chats/*.json
排除规则
默认忽略:.git、node_modules、.obsidian、.trash、trash、tmp、.DS_Store、__pycache__、.idea。
单源最多 5000 个文件。二进制(pptx/xlsx/docx/pdf/图片)本版本不索引。
HTTP API(面板使用)
/knowledge/api/ 下:status · search (POST) · recent · docs?src= · raw?id= · tree · doc?rel= · scan (POST) · sources (POST) · pick-folder (POST) · reveal (POST) · chats · chat?id= · chat (POST,NDJSON 流) · chat-delete (POST)
待办
- 长文档按标题层级预切、表格按行切
- 归纳(digest / 概念页 / 演进链)
- 记忆点提炼 → dsh-mnemon
更新记录
0.3.3
- 「首页 / 浏览 / 数据源」切换改为放在标题栏里的纯文字标签:当前页下面一道墨线,切换时带拖尾滑过去,停下后轻轻呼吸(和输入框光标同一套动效)。省掉原来的一整行,也修掉了切换钮超出首页话题栏的问题。
- 首页诗句区固定高度、往上长:外文诗句多一行译文时,输入框位置不再下沉,多出的内容只往上抬。
- 修复从「数据源」切回首页时「添加文件夹」闪一下:隐藏的页面不再做任何过渡。
- 动画更顺:墨线改用 transform 移动,不再每帧触发标题栏重排;输入框光标不再逐帧读取宿主页面样式(之前会拖慢整个 DSH 的其他动画)。
0.3.2
- 输入框光标垂直居中:之前多算了一次行距留白,光标比文字低约 2 像素,现在对准文字所在行的中线。
0.3.1
- 修复输入框光标错位:光标画布没有设显示尺寸,在 2 倍屏上被放大一倍,输入框上移后光标看起来留在原地。现在画布始终和面板一样大。
0.3.0
- 界面重做:首页诗文、玻璃文件夹、纸张动效、阅读器、数据源动效,全部按定稿原型实现。
- 新增问答:拆词 → 按范围翻找 → 判断够不够(最多 3 轮)→ 流式回答,带 [n] 出处角标和「一般经验」分区;回答逐字浮现,参数和 Dune 一致;可以中途停止;话题自动保存。
- 新增多词模糊检索,问句也能搜到;
kb_search工具也改用它。 - 新收录的文件会从窗口右上角飞进对应的文件夹;扫描时文件夹翻动并显示进度。
- 新接口:
recent、docs、raw、pick-folder(系统选择窗口)、reveal(在 Finder 中显示)、chat系列;status增加每个数据源的篇数、段数、大小、颜色、符号、监听状态,以及最近一次收录、扫描进度、当前默认模型;scan可以只扫一个数据源。
0.2.0
- 新增文件夹监听:数据源里的改动约 1.5 秒内自动增量入库;
status接口新增watch字段(各源监听状态、最近一批处理结果)。 - 新加数据源后立即扫描并开始监听,不用等重启。
- 修复:重新入库 / 删除文档时没有同步清理全文索引(
chunks_fts),旧内容会残留在索引里。现在整篇替换放在一个事务里;启动时自动清理旧版留下的残留行。 - 数据源根目录暂时不存在时,扫描不再把该源的索引全部删掉。
kb_search工具描述改为通用说法,涵盖收藏同步进来的帖子。
0.1.1
- 每 10 分钟定时增量对账。
Links
More in this category
vectorize-io/hindsight#coding-agents★ 61388
Hindsight, agent memory that learns: long-term project memory with auto recall and retain, knowledge pages, deep reflection, and per-repo memory banks.
volcengine/OpenViking#examples/dsh-memory-plugin★ 42311
OpenViking memory and context bundle for DeepSeek Harness: pre-step auto-recall and profile injection, session capture, `viking://` URI guarding, and recall/write memory tools backed by an OpenViking server.
MemTensor/MemOS#memos-local-plugin★ 12417
Local-first memory plugin for DeepSeek Harness: layered L1/L2/L3 memory with automatic capture, manual memos_* retrieval tools, and a built-in memory viewer.
agentscope-ai/ReMe#dsh★ 3812
Connects DeepSeek Harness to ReMe's local-first, self-evolving personal knowledge base: automatically captures completed main-agent conversations as user-owned Markdown memory, searches conversations and source material through reme_search with BM25, optional embeddings, and wikilink expansion, and schedules daily memory consolidation.
zilliztech/memsearch#MemSearch★ 2889
Shared Markdown memory for DSH and other coding agents, with automatic capture, pre-step context injection, searchable recall, and memory-to-skill self-evolution through a review panel.
vshulcz/deja-vu#extensions/dsh★ 1578
Cross-session memory and context recovery across forty-five other coding agents (45+) on this machine, reading session files they already wrote before install (Claude Code, Codex, Cursor, Windsurf, Trae, Antigravity, VS Code Copilot Chat, opencode, OpenClaw, Hermes, Kimi, Qoder, Cline, Zed, Magpie and more): six tools (deja_recall, deja_session, deja_blame, deja_fix, deja_how, deja_remember), a /deja command, and optional automatic recall injected into runtime context. Local BM25 CLI/MCP index, no LLM, no embeddings, no network (dsh plugin --profile web add dsh-deja).
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.