dsh-cherry-kb: Switching Knowledge Bases and Memory Modes in DSH Web

Preface

When doing contextual conversations in DeepSeek Harness (DSH), the common practice is to maintain a local knowledge base directory, use scripts for indexing and retrieval, and separately control whether “memory” is injected into the current session. If these capabilities are scattered across terminals and config files, the dsh web chat interface can hardly stay aligned with the real state: which knowledge base the current session is bound to, or which of the three memory-switch tiers is active, often requires switching windows or running commands to confirm.

The community plugin dsh-cherry-kb (maintainer wanghuiym123, category: Memory) brings the above orchestration into DSH Web: operations happen in the Composer toolbar and settings pages, while the Host side invokes your existing “My Knowledge Base” toolchain via /dsh/kb/* routes. It does not handle chunking, FTS, vectors, or the memory logic itself—it only serves as a bridge.

What Is This

dsh-cherry-kb is a local knowledge base and memory-switch plugin for dsh web. The npm package name is @wanghuiym123/dsh-cherry-kb (README corresponds to version 0.2.0, MIT license).

The plugin registers two controls in the Composer tail tool row (left of the model selector) and provides two section pages under Settings; the Host half registers 22 /dsh/kb/* routes and uses spawn to call three executables already present on the machine:

Executable Purpose
我的知识库/记忆开关 Read and set the three-tier memory mode
我的知识库/idx Status, sources, index, search, embedding models, index library, etc.
我的知识库/cherry Read-only access to Cherry Studio’s own knowledge base

Knowledge base root directory resolution order: environment variable DSH_KB_ROOT (or explicit override) takes priority; otherwise it searches upward from the built-in lib for a 我的知识库 directory containing the idx file. If the toolchain is not installed, the plugin can still be installed and render the UI, but each route will report “CLI not found”; the toolchain is not bundled with the package and is not publicly distributed.

Core Features

Composer Tool Row

Mounted at the conversation.input.right seat, clustered on the left side of the model selector, representing “what is visible to this session”:

Seat id Order Role
kb-chat-kb 90 Choose the knowledge base used by this session
kb-memory 100 Three-tier memory switch (always shows the current tier)

The two controls share the same store, so the button and the settings page state stay consistent.

Settings Pages

Slot settings.section:

Section id Order Role
my-knowledge-base 50 Source list, native folder selection, one-click rebuild index (staged progress), index library, memory per source, embedding model selection, local model service
cherry-studio-kb 55 Read-only view of the Cherry Studio knowledge base

Host Routes

The Host provides 22 routes under /dsh/kb/*, including but not limited to:

status  toggle  update  progress  stop  token
sources  search  select  source-memory
indexes  index-delete  rebuild-vectors  models
model/service  model/list  model/loaded  model/load  model/unload
cherry/list  cherry/search  cherry/select

Write operations require a token; KbToken.ts only issues tokens to loopback same-origin requests.

Boundaries (stated explicitly in the README)

  • The Cherry Studio knowledge base is read-only, implemented separately by KbCherry.ts on the host side and KbSources.ts in the workspace.
  • Adding a source only writes to 我的知识库/03_证据层/来源清单.json; it does not auto-index.
  • The memory switch is toggled only by the user in the UI; the plugin never changes it by itself.
  • The plugin does not persist its own state; all displayed content is read live from the CLI.

Installation and Enablement

First install the plugin (command from the repository README):

dsh plugin --profile web add @wanghuiym123/dsh-cherry-kb

If the knowledge base is not in the default location (four levels up from the installed package), specify the root directory when starting dsh web:

DSH_KB_ROOT=/path/to/我的知识库 dsh web

Before installing, please inspect the GitHub repository source code and the MIT license yourself. DSH plugins run with the current dsh process permissions; Host routes call local executables, so make sure the paths and permissions match your environment.

Typical Usage

After the installation and DSH_KB_ROOT configuration above, the daily workflow is roughly as follows:

  1. In the Composer left tool cluster, choose the knowledge base to use for this session (kb-chat-kb).
  2. Use the three-tier memory button (kb-memory) to set the memory mode for the current session; the tiers match the 记忆开关 CLI.
  3. Open Settings → “我的知识库” to manage sources, trigger index rebuilds, view progress, and configure embedding models and local model services.
  4. In the “Cherry Studio 知识库” section, browse or search libraries already present on the Cherry side (read-only; not built or modified inside this plugin).

For development and regression, the repository provides offline checks (not dependent on the dsh process, browser, or network):

node scripts/verify-bundle.mjs   # client build + host route table
node scripts/verify-host.mjs     # route handlers against stub CLI

The README notes: verify-host.mjs uses a bash stub and does not cover the real CLI or the HTTP adapter layer; all green does not mean end-to-end is passed.

Use Cases and Notes

Who it’s for: Developers who already have the “我的知识库” toolchain deployed locally (记忆开关 / idx / cherry), primarily chat via dsh web, and want to put library selection and memory tier switching into the same interface.

Not meant to be: An out-of-the-box RAG or memory implementation; indexing, retrieval, and embeddings are all done by external CLIs. Without the toolchain, there is only an empty shell UI.

Ecosystem note: DSH adopts the “everything is a plugin” extension approach; the SkillHub directory page is a community-collected site and has no official affiliation with DeepSeek / 幻方.

Security and trust: Installing the plugin allows its Host to spawn the above three executables on your behalf and to read/write toolchain-conventional paths (such as the source list JSON). Please install only if you trust the maintainer and the source code.

Conclusion

The value of dsh-cherry-kb lies in orchestrating your local “我的知识库” and the read-only Cherry Studio view within DSH Web via two Composer controls and two settings pages, without reimplementing the indexing and memory internals. For more information, visit the directory page at skillhub.cn/plugins/wanghuiym123/dsh-cherry-kb and the source code at github.com/wanghuiym123/dsh-cherry-kb.

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

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

Xiaoye