dsh-knowledge-graph: Local knowledge base and Obsidian-style graph in DSH

Introduction

When chatting with Agents in DeepSeek Harness, valuable content is often scattered across the chat history: highlighted text, full responses, or messages you sent yourself. It is difficult to retrieve this by “concept—association” later, and it is also hard to get the model to stably cite your accumulated knowledge when answering questions. You can dump notes into an external note application, but that is disconnected from the DSH (DeepSeek Harness) conversation flow and Agent tool system.

Below is an introduction to the community plugin dsh-knowledge-graph (maintained by 3722593qq). It maintains a local Markdown knowledge base under the DSH data directory: on the interface, you can save raw materials with one click, and the backend uses the current model to organize them into wiki pages. The left sidebar provides Obsidian-style [[links]] and a force-directed graph; on the Agent side, there are only read-only tools, constrained by global rules to “read the index first, then read the page, and cite sources at the end.” The plugin is categorized under “Memory” in the SkillHub directory. The repository uses the MIT license, and the current Release version is 0.1.3.

What is it

In one sentence: A local knowledge base + Obsidian-style wiki + Force-directed graph for DeepSeek Harness.

Writing comes only from interface operations (highlighting text, right-clicking a message, the book icon below a response); organization and link creation are completed by a background serial queue. The Agent cannot modify the knowledge base through tools, but can only read index.md, single-page wikis, search, and local subgraphs.

Core Features

Writing from Chat to Knowledge Base

  1. After selecting text, a “Save to Knowledge Base” floating button appears; the right-click menu can also be used to save.
  2. Below each AI response, there is a book icon that can save the entire response at once.
  3. Right-click on “My messages” to save that specific message directly.

No popups: it immediately writes a read-only raw note into 资料/ (Materials) and immediately creates a wiki draft page; subsequently, the background uses the current model to organize it into pages under Concept / Person / Thing / Event. The organization queue is strictly serial; if a failure occurs, it writes to log.md and the panel’s “Recent Results”, and does not block the next item.

Knowledge Graph Page

Open “Knowledge Graph” in the left sidebar: the left side is the relationship graph (Markdown files as nodes, [[ ]] as edges), and the right side is the content. The force-directed graph supports zooming, dragging nodes, search highlighting, and displaying local subgraphs by layer (default is 2 layers around the current page, adjustable 1–5 layers). The data update uses the same simulation state, and existing node coordinates and view are preserved.

The content title bar has a delete button: after a second confirmation, the current wiki page is deleted, and other pages pointing to it are cleaned up; the original 资料/ (Materials) is preserved. Deletion is rejected while the organization queue is running to avoid the background organization writing the page back.

Agent Read-Only and Citation Habits

Tool Purpose
knowledge_index Reads index.md
knowledge_read Reads a wiki page or the index
knowledge_search Searches titles, summaries, and content
knowledge_graph Reads a local relationship graph

Global rules require: if the question might be related, check knowledge_index first, then knowledge_read the relevant page; write 知识来源:[[wiki/...]] at the end of the answer.

Knowledge Base Directory Structure

Located by default in the DSH data directory (Linux/macOS is usually ~/.dsh/knowledge/, Windows is usually C:\Users\<you>\.dsh\knowledge):

~/.dsh/knowledge/
├── 资料/                 # Raw notes, no longer modified after saving
├── wiki/
│   ├── 概念/
│   ├── 人物/
│   ├── 事物/
│   └── 事件/
├── index.md              # Rewrites fully every time save/organize happens
└── log.md                # Appends a line each time organize runs

You can open this directory directly in Obsidian; internal page links look like [[wiki/Concept/Page]]. The host application will update reverse links after writing and fully rebuild index.md.

Wiki pages have YAML headers (title, category, summary, updated, etc.) and the body contains definitions, key points, supplementary materials, and associations; a “Contradictions and Alternative Views” section only appears when materials conflict.

Installation and Enablement

Environment requirements (refer to the repository description):

  • DeepSeek Harness >= 0.2.0-rc.2
  • Node ^22.19.0 || >= 24.0.0
  • The plugin has no extra build steps; lib/*.js inside the repository can be loaded directly
dsh plugin --profile <profile> add github:3722593qq/dsh-knowledge-graph

Install from Release Package

dsh plugin --profile <profile> add https://github.com/3722593qq/dsh-knowledge-graph/releases/download/v0.1.3/dsh-knowledge-graph-0.1.3.tgz

After installation, if the “Knowledge Graph” does not appear in the left sidebar, you need to completely exit and restart DeepSeek Harness (not just closing the window to the tray or refreshing the page). For example, deleting a wiki page depends on the host’s registered POST /knowledge-graph/api/delete; if the browser is a new client but the host is an old version, deletion might return HTTP 405, and you will need to restart the host to get a normal response.

Optional configuration example (change knowledge base root directory; model defaults to following agentDefaultModel.currentSelection(), can be overridden by provider / model, maxTokens defaults to 4000):

- id: knowledge-graph
  name: dsh-knowledge-graph
  config:
    rootDir: D:/notes/knowledge   # Absolute path, or path relative to $DSH_HOME

Test scenarios can also use the environment variable DSH_KNOWLEDGE_DIR.

Typical Usage

  1. Highlight text or save a full response / your own message in a conversation.
  2. Open the left “Knowledge Graph”, click nodes in the graph, or read the organized wiki on the right.
  3. When needed, use search highlighting or adjust the “local” layer count to view the neighborhood.
  4. Ask the Agent in a new conversation: under the constraint of rules, the model will check the index and relevant pages first, and cite 知识来源:[[wiki/...]] at the end of the answer.
  5. Miscreated wiki pages can be deleted from the title bar; the original 资料/ (Materials) is still kept as audit input.

Applicable Scenarios and Notes

Who is it for? Developers who want to close the loop “Conversation → Accumulation → Structured Wiki → Agent Read-only Retrieval” within DSH; users already accustomed to Obsidian-style [[wikilink]] and graph browsing.

Runtime and Trust Boundary: The plugin reads and writes your configured knowledge base directory (default is .dsh/knowledge under the user’s home directory) with the permissions of the current DSH process and calls the model you configured for background organization. It is recommended to read the GitHub Source Code and the MIT license before installing to confirm that the path and model configuration fit your environment.

Known Limitations (from the repository readme): Page classification is inferred by the model, and occasional misjudgments occur; the host only makes conservative corrections for obvious misjudgments. The relationship graph displays wiki links as undirected edges. Duplicate links are drawn as a single line. The original 资料/ (Materials) is immutable, and the Agent has no write tools.

The DeepSeek Harness ecosystem emphasizes “Everything is a plugin”; the SkillHub Plugin Directory is a community site and has no official affiliation with DeepSeek or Huansuan.

Conclusion

dsh-knowledge-graph connects “highlighting/message to database, model organizing wiki, force-directed graph browsing, and Agent read-only retrieval” on the same local Markdown tree, making it suitable to treat DSH conversations as a long-term knowledge input source. For further understanding, see the directory page SkillHub: dsh-knowledge-graph and the repository github.com/3722593qq/dsh-knowledge-graph.

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

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

Xiaoye