# dsh-library

A plugin for DeepSeek Harness that turns local Markdown and text files into a queryable knowledge base, with hybrid semantic and keyword search, diversity re-ranking, and citation checking the agent can verify.

dsh-library is a local document knowledge base plugin for DeepSeek Harness, an AI coding agent tool. `library_add`, `library_remove`, and `library_list` import, purge-verify, and list local Markdown or text documents by path, chunking and embedding each one with a deterministic, zero-download local embedder.

`library_search` combines semantic and keyword ranking with maximal-marginal-relevance diversity re-ranking, relevance filtering, and a lost-in-the-middle avoidance step that pins the strongest chunks to the head and tail of the result; each hit carries a source marker, and results can be injected directly into the calling agent's context. `library_cite_check` verifies a citation in a generated answer against the search results with both a fuzzy token match and a semantic similarity check, and `library_diagnose` reports a chunk-size histogram, near-duplicate chunks, and a self-retrieval probe.

The index is stored through the host's own storage domain (JSON or SQLite), and the plugin is one of a family of over 40 Apache-2.0 plugins for DeepSeek Harness.

Website: https://github.com/PerryLink/dsh-library
