dsh-knowledge-tree: Gathering leaves in conversations to build your personal knowledge tree

Introduction

When discussing technical topics with AI, valuable content often gets scattered across multiple conversation turns: a command snippet, a boundary condition, or a conclusion learned from a debugging session. Later, you either rely on memory to dig through chat history or manually copy things into notes and categorize them yourself. DeepSeek Harness (DSH) supports using plugins to integrate such capabilities into your profile. In the “Memory” category of plugins, dsh-knowledge-tree separates “recording scattered knowledge” and “organizing into a tree structure” into distinct tools and skills. It persists data to Markdown files in the workspace and optionally routes through Human-In-The-Loop (HITL) confirmation before writing.

Below is an introduction to the plugin’s positioning, the usage of its four tools and two skills, as well as installation and verification steps. Facts are based on the GitHub repository README; for the community directory, see the SkillHub entry.

What is this

dsh-knowledge-tree is maintained by YunpengDon, with the current npm package version at 1.1.0 (MIT License). In one sentence: it collects scattered knowledge (“tree leaves”) during conversations with AI, allows the AI to categorize them into a knowledge tree, and builds a personal knowledge system through long-term accumulation.

Implementation-wise, it is a DSH bundle: the package includes cordis.patch.yml, which injects four tools and a skill provider pointing to the package’s skills/ directory into your profile upon installation. Generally, manual modification of bundle configuration is not required.

The Four Tools

All four tools modify workspace files. If HITL is enabled in your profile (see below), a decision card will pop up before writing to disk. Once approved, it proceeds through existing policies like sandboxing and approvals.

Tool Function
append_leaf Append knowledge leaves to the “To Organize” section; auto-creates the file if it doesn’t exist
organize_tree Organize the knowledge tree (insert nodes / move nodes)
cleanup_organized_leaf Delete organized leaves from the “To Organize” section
update_index Update the index file

Markdown structure operations are centralized in src/markdown.ts, and path rules are in src/paths.ts. The decision card preview and the final write share the same set of pure functions to avoid inconsistencies between “what you see on the card” and “what is actually written”. If an anchor doesn’t exist or a leaf is not in the “To Organize” section, the card will provide the reason rather than failing silently.

The Two Skills

Skills are distributed with the package in the skills/ directory. After installation and restarting DSH, they can be loaded via the skill tool.

Skill Typical Trigger Phrases
append-leaf “Note this down”, “Save to knowledge tree”
organize-tree “Organize knowledge tree”, “Archive pending items”

A typical workflow could be: ask the model to record leaves during conversation \(\rightarrow\) accumulate in the “To Organize” section \(\rightarrow\) say “Organize knowledge tree” to insert or move nodes \(\rightarrow\) run update_index if necessary \(\rightarrow\) use cleanup_organized_leaf to clear archived pending items. For specific file layouts, refer to the example Markdown files under skills/append-leaf/references/ in the package.

Human-In-The-Loop (HITL)

The four tools mount decision cards at tools/pre-execute, provided by the optional dependency dsh-hitl ≥ 0.2.0. Without dsh-hitl in the combination, the tools still execute, just without manual confirmation. If you want to use computed fields like diffs or deletion previews, do not use a version of dsh-hitl lower than 0.2.0.

Content displayed on each tool’s card (excerpted from README):

  • append_leaf: The leaf content is rendered as Markdown and is editable; clicking [Modify] cancels the current call, and the model resubmits with your modified content.
  • organize_tree: Insert/move content, plus a diff of the entire file after organization.
  • update_index: A side-by-side diff of the old and new indexes; the new content is editable.
  • cleanup_organized_leaf: The original text of the leaf to be deleted (read-only); deletion is irreversible, so if you are not satisfied, you should reject it and explain in the feedback field.

You can configure the knowledge-tree plugin section in the profile’s cordis.patch.yml:

- id: knowledge-tree
  name: 'dsh-knowledge-tree'
  config:
    hitl:
      enabled: true            # false = No cards, four tools write directly
      whenUnavailable: reject  # When no browser connection: reject (default) / wait
      countdownSeconds: null   # null = No time limit; positive integer treats it as rejection upon timeout
      rejectFeedback: true     # Show feedback field on rejection

Fields such as humanTurn / confirm / confirmTools from before version 1.1.0 are deprecated and will still trigger warnings; off maps to hitl.enabled: false.

Known limitation: The preview is based on the disk content at the moment the card pops up; if other sessions modify the same file simultaneously, the diff on the card may differ from the final write. HITL intercepts before the call executes; it is not a cross-session transaction.

Installation and Activation

The plugin reads and writes to the workspace with the permissions of the current DSH process. Before installation, it is recommended to review the source code and license (MIT); only enable allowBuilds for GitHub installations for packages you trust.

  1. Go to 【Plugins】 in the left sidebar;
  2. Click 【+ Add Plugin】;
  3. Enter dsh-knowledge-tree as the package name;
  4. Click 【Install】 then 【Enable Now】, and restart DSH as prompted.

Command Line Installation

The npm package includes the built dist/, so allowBuilds is not required:

pnpm dsh plugin --profile <profile> add dsh-knowledge-tree

Installing from GitHub triggers the package’s internal prepare (tsc) build. If pnpm ≥10 refuses build scripts, you need to allow dsh-knowledge-tree in the profile’s pnpm-workspace.yaml, and ideally pin the commit:

pnpm dsh plugin --profile <profile> add github:YunpengDon/dsh-knowledge-tree

For local development and tarball methods, see the repository README. If direct connection to GitHub times out in mainland China, prioritize using npm or local directory installation.

Verification and Uninstallation

Confirm that the configuration layer is hooked up:

pnpm dsh --profile <profile> --dump-config | grep -n knowledge-tree

You should see two lines: knowledge-tree and knowledge-tree-skills. --dump-config does not evaluate !!js expressions, so full acceptance testing requires starting DSH and using the skill tool to confirm that append-leaf and organize-tree can be listed.

Uninstallation:

pnpm dsh plugin --profile <profile> remove dsh-knowledge-tree

Use Cases and Notes

Suitable for developers who want to continuously accumulate technical snippets during DSH sessions while keeping the structure in version-controllable Markdown. The Node engine requirement is ^22.19.0 || >=24.0.0 (see package.json).

Compared to the DeepAgents version of the knowledge tree by the same author, the DSH version uses TypeScript, registers tools via ctx.tools.register(), and hooks HITL onto dsh-hitl decision cards. The skill format is name + description + whenToUse, without the tools field found in DeepAgents SKILLs. For a detailed comparison, see the “Main Differences from the DeepAgents Version” section in the repository README.

Links

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye