DeepSeek Harness 插件

dsh-knowledge-graph-fango199

Durable knowledge graph for DeepSeek Harness agents: remember lessons/patterns/decisions, FTS5 search across sessions. Zero dependencies (node:sqlite).(英文原文)

跳到安装方式

来源信息

GitHub 仓库
fango19961106-dotcom/dsh-knowledge-graph
最近更新
2026年8月18日
分类
文档与渲染
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/fango19961106-dotcom/dsh-knowledge-graph
插件名:dsh-knowledge-graph-fango199
作者:fango19961106-dotcom

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器2 个文件
README.md来源说明 · 只读预览

dsh-knowledge-graph

Durable knowledge graph plugin for DeepSeek Harness (DSH).

Gives every agent session three model-facing tools backed by one embedded FTS5 database — so lessons, patterns and decisions survive session ends, preset switches and process restarts:

ToolPurpose
kg_rememberPersist a lesson / pattern / decision / field note / false positive
kg_searchBM25 full-text recall across everything ever remembered
kg_recentNewest entries — cheap context refresh at session start

Extracted from the agent-knowledge-graph architecture (L1 entries → L3 BM25 recall → L4 memory), compressed into a single zero-dependency plugin.

Features

  • Zero npm dependencies — storage is Node's built-in node:sqlite (FTS5, WAL mode, porter tokenizer)
  • One file, one store~/.local/share/dsh-knowledge-graph/knowledge.db (respects $XDG_DATA_HOME), shared by every session and preset in the profile
  • Triggers keep FTS in sync — insert/delete triggers, no manual reindex
  • Sanitized MATCH input — model-supplied queries are stripped of FTS operators; malformed input falls back to recent-listing instead of erroring
  • Clean unload — the DB handle closes when the plugin unloads (Cordis effect unwinding)

Install

Requires Node >= 22.5 (for node:sqlite).

# from a checkout
git clone https://github.com/fango19961106-dotcom/dsh-knowledge-graph
cd dsh-knowledge-graph

Then add to a DSH profile (a running dsh is a plugin tree composed of bundles — add this as an out-of-tree plugin):

mkdir -p ~/.dsh/plugins
cp -r . ~/.dsh/plugins/dsh-knowledge-graph

and list it in your profile's cordis.patch.yml:

- insert:
    - id: knowledge-graph
      name: '~/.dsh/plugins/dsh-knowledge-graph/src/index.ts'

(or install from npm once published: npm i dsh-knowledge-graph, then reference dsh-knowledge-graph by name in the patch file).

Tool contract

kg_remember:

{
  "kind": "lesson | pattern | decision | field_note | false_positive",
  "title": "One-line imperative summary",
  "body": "Self-contained note: what happened, the rule, the evidence",
  "tags": ["optional", "keywords"],
  "project": "optional-scope"
}

kg_search / kg_recent return ranked hits with «highlighted» snippets (FTS5 snippet()).

Verify without a model

node --experimental-strip-types -e "
import('./src/store.ts').then(async m => {
  const s = new m.KnowledgeStore('/tmp/kg-test.db');
  s.remember('lesson', 'Pin third-party action SHAs', 'Tag-pinned actions can be mutated; @vX tags are moveable refs.', ['supply-chain'], 'dsh-plugin');
  console.log(JSON.stringify(s.search('supply chain'), null, 1));
  s.close();
})"

License

MIT