dsh-shenjia-search: Unified Retrieval Across Document and Conversation Indexes

Introduction

When doing long-term storytelling or knowledge base maintenance in DSH (DeepSeek Harness), information is often scattered in two places: one is Markdown documents with identities and versions (benchmarks, memory banks, data banks, specs, etc.), and the other is historical sessions in the Black Whale sidebar. Opening the file tree and session list separately to search for keywords is inefficient and easy to miss fragments that only appear in summaries.

dsh-shenjia-search was released by maintainer sarsgy-wenjian and is categorized as “Memory” on SkillHub. It connects the two aforementioned index paths to the same tool, shenjia_query: a single call can simultaneously query the local document FTS library and the session index; it reads locally, does not go online, and does not modify source files. Supporting capabilities rely on the local document building script 记忆/tools/build_docs_index.py and dsh-session-query-cjk (ctx.sessionQuery).

What is it

The full name of the plugin is dsh-shenjia-search, version 0.1.0, MIT license, requires Node.js >= 22.13.0. One-sentence positioning: Shenjia Story Unified Retrieval (P1) — simultaneously querying document index and Black Whale session index.

The document index side is generated by build_docs_index.py into a SQLite FTS5 library (character-level gram, with identity and version); the session side reuses dsh-session-query-cjk. In the DSH ecosystem, it is a community plugin; the directory page is on SkillHub, and source code is on GitHub.

Core Features

Tool shenjia_query

Via the query entry exposed by the plugin, parameters are as follows.

Parameter Description
query Keyword or sentence; spaces mean AND; raw string match, no typo correction
scope all (default) / docs / sessions
top Number of documents, default 10, max 30
identity Limit document identity, comma-separated, e.g., 基准,草案·台账,规范

The return is divided into two parts: document hit list (containing identity, path, word frequency, and summary snippets) and session hit list (containing session identifier and workspace path). Example output format can be seen in README:

【文档】3 条(库内 1036 个,词见 11 个)
1. 草案·台账|D:\…\拍板台账-豆包抽取-待核对-20261114.md:130|-|词频 5
   § T-09 核对结论(2026-11-14,回基准原文)
   …摘要…

【会话】3 个
- session-…(E:\Download\智能体团队调试)|摘要…

Sessions not mounted in any workspace will not be returned (cannot be opened in the sidebar), and the number skipped will be noted in the output.

Document Sorting Rules

The document side does not use FTS5’s bm25, but uses a custom score:

分数 = 词频饱和(tf) × 文档级 IDF × 身份权重 × 现行权重 × 标题加权(×2)

Identity weight examples: Benchmark 1.0; Draft·Ledger 0.9; Tools & Rules/Memory Bank/Specs 0.6; Data Bank 0.5; Outsourced Draft 0.4; Old Version Card 0.25. Current items with is_current=1 have a weight of 1.0, historical items have 0.6.

Session Side Behavior

Only returns sessions registered in workspaces (reading workspace.json). Session index is a snapshot; new sessions need to be rebuilt or incrementally updated according to the dsh-session-query-cjk process (README mentions the first time takes about 1 minute).

Configuration Items

Can be overridden in the profile’s cordis.patch.yml or the configuration after bundle installation:

Config Default Description
docsDb E:\Download\智能体团队调试\记忆\cache\shenjia-docs.db Document index database path
workspaceFile C:\Users\newuser\.dsh\storages\workspace.json Workspace registration table
sessionTop 10 Number of sessions

When deploying to Linux or other machines, you should change docsDb and workspaceFile to your actual local paths.

Installation and Enablement

This package is declared via DSH bundle (dsh.bundle.patch points to cordis.patch.yml). The installation method given by the official README is:

plugin_manager install_bundle → dsh-shenjia-search

For manual installation: place the package into ~/.dsh/profiles/<profile>/node_modules/, and insert a node into the profile’s cordis.patch.yml, for example:

- insert:
    - id: shenjia-search
      name: dsh-shenjia-search
      config:
        docsDb: 'E:\Download\智能体团队调试\记忆\cache\shenjia-docs.db'

It is recommended to read the repository source code and MIT license before installation; the plugin reads local databases and workspace.json with the current DSH process permissions. If the path is configured incorrectly, it will only fail to find results and will not modify your documents.

Typical Usage

  1. Use 记忆/tools/build_docs_index.py to build or update docsDb, ensuring .md/.txt files are indexed.
  2. Confirm dsh-session-query-cjk is available, and the sessions to be searched are mounted in workspaces (recorded in workspace.json).
  3. Call shenjia_query in the harness, setting scope and identity as needed. For example, pass identity: 规范 when only querying specification documents; set scope: sessions when only searching sessions.
  4. Return to the original text for verification based on the returned path and line number; if the source file is modified, you need to rerun the building script (README mentions incremental time is about 0.2–3 seconds).

Known Limitations and Use Cases

Suitable for: developers who maintain document indexes in a “Shenjia Story”-style directory system and have accumulated a large number of workspace sessions in Black Whale, needing to cross two index sets with a single keyword.

Notes:

  • Document index only contains .md/.txt, does not include PDF/DOCX.
  • Query only supports phrases and AND, no OR, field search, or synonyms.
  • Session summaries may include tool output (this plugin does not filter by message type; sidebar search filters).
  • Indexes are all build-time snapshots; after modifying documents, the building script must be rerun.

Links

  • Directory page: https://www.skillhub.cn/plugins/sarsgy-wenjian/dsh-shenjia-search
  • Source code and documentation: https://github.com/sarsgy-wenjian/dsh-shenjia-search

The community directory SkillHub has no official affiliation with DeepSeek/Huafan; when choosing plugins, refer to the repository README and local configuration.

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

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

Xiaoye