PerryLink/dsh-library
dsh-library
Local document knowledge base for DeepSeek Harness: library_add/remove/list, hybrid semantic+keyword library_search with diversity re-ranking, relevance filtering and lost-in-the-middle avoidance, citation-aware injection, library_cite_check and library_diagnose — SQLite-backed index via the storage domain, local embedding, zero model downloads.
Install
npx @deepseek-ai/dsh plugin --profile web add "github:PerryLink/dsh-library#main"Restart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/dsh-library)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from PerryLink/dsh-library, cleaned of badges and images.
📚 dsh-library
Local document knowledge base for DeepSeek Harness.
Import, retrieve, verify — hybrid search with citations your agent can check.
English · 简体中文 · Español · Português · हिन्दी
Compatibility
| Surface | Status |
|---|---|
| Harness | DeepSeek Harness 0.1.1-rc.2 (compat declared for 0.1.1-rc.2) |
| Node | ^22.19.0 || >=24.0.0 |
| Storage | Any storage-domain backend (JSON or SQLite); the index lives in the host's storage domain |
| Models | None required — the built-in embedder is deterministic hashing (zero downloads) |
What you get
dsh-library turns local md/txt documents into a queryable knowledge base with a quality pipeline your agent can trust:
library_add/library_remove/library_list— import a document by path (chunked and embedded), remove one with purge verification (signatures of the removed content are probed against the remaining index and any residue is reported), and list document metadata.library_search— hybrid semantic + keyword ranking, maximal-marginal-relevance diversity re-rank, relevance filtering, and lost-in-the-middle avoidance (strongest chunks pinned to head and tail). Withinject: truethe result page is injected into the calling agent; every hit carries a[n]source marker and the injection is reconstructable from thelibrary/injectsession event.library_cite_check— verify the[n]citations in an answer against the search result page with a fuzzy token match AND a semantic similarity check.library_diagnose— chunk-size histogram, near-duplicate chunk pairs, a self-retrieval probe, and the middle-penalty signal./library— one-line index summaries per library.
document ── library_add ─▶ chunk (sliding window) ─▶ embed (hash / external cmd)
│
storage domain (documents / chunks / purges)
│
query ── library_search ─▶ hybrid score ─▶ MMR re-rank ─▶ relevance filter
│ ─▶ lost-in-middle order
▼
result page with [n] markers ── inject: true ─▶ agent + library/inject event
Quick start
# 1. install the bundle into your profile
dsh plugin --profile web add "github:PerryLink/dsh-library#main"
# or from npm (published releases)
dsh plugin --profile web add dsh-library
# 2. restart and verify the row
dsh --profile web --dump-config | grep -A2 'id: dsh-library'
Then ask the agent to import and use a document:
> Add ./docs/spec.md to library docs, then answer: what does the spec say about retries? Cite [n] markers.
Install & uninstall
- git channel (latest
main):dsh plugin --profile web add "github:PerryLink/dsh-library#main"— thepreparescript builds with production dependencies only. - npm channel (published releases):
dsh plugin --profile web add dsh-library. - tarball channel:
pnpm packin this repo, thendsh plugin --profile web add ./dsh-library-<version>.tgz. - uninstall:
dsh plugin --profile web remove dsh-library(or remove the row from the profile patch).
…
