Markdown 笔记的双知识图谱 RAG,带半衰期记忆衰减:前置依赖 + 相似关联双图(P/S-Agent 遍历)、段落级匹配、ngram/embedding 混合检索、显式权重反馈闭环——原生 Cordis 插件,npm 包 @eqman00003/knowlp-rag。
安装
# npm 包(预构建)
dsh plugin --profile web add @eqman00003/knowlp-rag
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:wly8691-jpg/knowlp-rag
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
type: KnowLP文档 文档状态: 引擎 日期: "2026-08-29" 说明: 引擎 README(v3.0.8 仓库版,dsh 优先)
KnowLP-RAG
Agent-first knowledge retrieval — turn your Markdown notes into a self-maintaining knowledge graph that is "use it or lose it". Agents (DSH / Claude Code) install, build the graph, and self-check it; only the vault path must be provided by the human. Retrieval returns reading paths: which notes to read, in what order, and which are similar substitutes.
Quick start (3 steps)
All three steps are agent-runnable; only KNOWLP_VAULT (your notes directory) must be provided by the human.
# 1. Install (official npm registry)
dsh plugin add "@eqman00003/knowlp-rag"
# 2. Set the two required env vars (without them the dual-graph engine idles and only full-text search works)
export KNOWLP_VAULT="$HOME/Notes" # your Markdown notes directory
export KNOWLP_GRAPH_DIR="$HOME/.knowlp-dsh" # writable index directory
# 3. Restart dsh web — the first search triggers Python env bootstrap (~30s, don't interrupt)
Six tools
| Tool | Purpose |
|---|---|
knowlp_search |
Four-engine fan-out retrieval (dual-graph P/S-Agent + vector + full-text) |
knowlp_get_note |
Read note content (read-only, path-traversal safe) |
knowlp_stats |
Engine/graph health self-check (first stop for troubleshooting) |
knowlp_record_feedback |
Explicit feedback (the only entry point of the weight loop) |
knowlp_record_correction |
Explicit preference pairs (chosen ≻ rejected) — the input to preference learning |
skill_search |
Skill index retrieval |
PixelRAG (optional cross-machine visual retrieval)
PixelRAG is an optional visual-retrieval engine — it embeds visual content for retrieval instead of relying on text tokens alone. It runs on a separate GPU machine on your network: the agent offloads the visual-embedding work to that box over Tailscale rather than computing it on the laptop. Retrieval falls back through three tiers:
- desktop GPU — the primary dedicated box (an RTX-class machine reachable over Tailscale)
- local — a same-machine fallback
- cloud API — a hosted PixelRAG endpoint
Configure it via KNOWLP_PIXELRAG_DESKTOP / pixelrag_local. Unconfigured, it stays off — retrieval still works in n-gram / embedding mode.
Reproducing this: it is deployment-specific — you need your own GPU machine running a PixelRAG service, a network path to it (e.g. Tailscale), and its endpoint address. No bundled service ships with KnowLP.
Documentation
- Install & usage guide: docs/usage.md
- Troubleshooting: docs/troubleshooting.md
- dsh integration details (env vars / Cordis plugin): dsh/README.md
Why KnowLP?
Grep for "RAG architecture" gives you 105 files. KnowLP gives you 3 ranked hits with dependency context.
grep |
Naive vector store | KnowLP | |
|---|---|---|---|
| Result ranking | ❌ | ✅ | ✅ |
| Dependency chain (P-Agent) | ❌ | ❌ | ✅ |
| Similar substitutes (S-Agent) | ❌ | ❌ | ✅ |
| Works without GPU | ✅ | ❌ | ✅ (n-gram mode) |
| Improves with use (feedback) | ❌ | ❌ | ✅ (weight loop) |
| Paragraph-level matching | ❌ | ❌ | ✅ |
| Decay & forgetting (use it or lose it) | ❌ | ❌ | ✅ (three half-life tiers) |
The difference: vector search finds documents that "contain keywords"; KnowLP finds documents you should read given your query, with reading paths. Edge weights between notes evolve with usage — consumed edges strengthen, unused edges decay by half-life (ephemeral 1 day / default 30 days / declarative never).
Works with Chinese note vaults out of the box (Chinese time-anchor queries and Chinese full-text search are supported).
Demo
$ knowlp_search "RAG architecture"
1. [HIT] RAG Architecture.md (score 0.77)
2. [LINK] Vector Database Selection.md (score 0.61) ← prerequisite chain
3. [LINK] Retrieval Eval Pitfalls.md (score 0.42)
4. [LINK] _Index-Reading Order (depth 1) ← tells you where to start reading
5. [LINK] _Index-Related Concepts.md (depth 2)
Local development
git clone https://github.com/wly8691-jpg/knowlp-rag.git
cd knowlp-rag
pip install -e . # provides knowlp-mcp / knowlp-build / knowlp-search
# configure vault in config.yaml → build graph → search
python build_graph.py
python knowlp_search.py "RAG architecture"
链接
同类插件
Tencent/WeKnora#dsh-weknora★ 30675
把 WeKnora 知识库接入 dsh 的四个只读工具:列出知识库、混合检索原文片段、按顺序还原单篇文档,以及直接取用 WeKnora 自己带引用的 RAG 或 ReAct agent 回答(含可续聊的 session id)。
superdesigndev/treg★ 3596
给 Agent 的工具目录:按「要做的事」检索约 2,600 个外部接口(SEO 与 SERP、外链、社交、人物与公司信息补全、广告库、抓取),查看参数与单次调用价格后直接调用,凭据由服务端注入。附带技能,MCP 行在未设置 TREG_TOKEN 前保持禁用。
TencentCloudBase/CloudBase-AI-Toolkit#dsh-plugin★ 1126
把腾讯云 CloudBase 后端接入 DeepSeek Harness——在对话里搭好并部署全栈应用,查询结果渲染为表格卡片(分页、排序、导出 CSV),部署后可预览真实域名,并提供 CloudBase MCP 工具集(`mcp__cloudbase__*`),登录走 device-code 流程。
gitroomhq/postiz-agent#dsh-postiz★ 496
通过 MCP 将 DeepSeek Harness 连接到 Postiz:列出已连接的社交媒体渠道、获取各平台发帖规则,并向 X、LinkedIn、Instagram、Facebook、Threads、TikTok、YouTube、Reddit、Bluesky、Mastodon、Discord、Slack、Telegram 等平台排期、存草稿或发布帖子;附带 postiz 工作流技能。
EthanYoQ/Invoice-Downloader#dsh-invoice-downloader★ 446
面向 DeepSeek Harness 的本地 IMAP 发票下载、OCR 识别、归档与 Excel 报销汇总。
anysearch-team/anysearch-dsh★ 430
基于 AnySearch 的实时网页与垂直搜索插件,为 DeepSeek Harness 提供搜索工具。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。