Introduction¶
In DeepSeek Harness (DSH), long conversations get truncated in their context, and the model often fails to recall previous conclusions or hard-won lessons in subsequent turns. The traditional approach is to manually maintain documentation or rely on external knowledge bases, but these solutions are typically disconnected from the current session and carry a high retrieval cost.
The dsh-context-kb plugin maintains a searchable memory in project-level storage, persisting the raw conversation text, conclusion indexes, and pitfall records. It exposes these through kb_* tools to the model, enabling it to retrieve earlier conclusions and code snippets via indexes even after context truncation.
Plugin Positioning¶
dsh-context-kb is a context knowledge base plugin designed for DeepSeek Harness, maintained by why774. It has no dependency on external services; the backend uses the why774/context-kb CLI tool bundled with the plugin, executed via a local Python 3 interpreter. All data stays on the machine.
The plugin stores raw conversation text, sealed topic segments, conclusion indexes, and tool-usage notes in the project directory and global directory, and exposes its capabilities by tool name for the model to call.
Core Features¶
The plugin provides the following tools (invoked with the kb_* prefix):
kb_log: Appends the raw text of the current conversation to the project’s short-term store (initializes the store on first call).kb_seal: Seals the current topic segment, moving its raw text fromsession/toarchive/.kb_index: Writes a conclusion index for a sealed segment, optionally specifying a line range as an anchor.kb_search: Searches the conclusion index first, then traces back to the raw text; with thelongparameter, it can search the cross-conversation global store.kb_read: Reads raw text by coordinate, e.g.archive/T-20261120-001-p1.md:5.kb_context: Hierarchical context assembly — nearby raw text, earlier summaries, and remote pointers — to obtain context at different granularities on demand.kb_hot: Returns the hottest entries in the project (or the global store).kb_stats: Counts the number of entries and checks the integrity of the project directory.kb_close: Closes the current conversation, merging the short-term store into the global store at~/.context-kb.
Storage structure:
<project>/.context-kb/talks/<talk id>/: Short-term store, one per conversation, committed with the project.~/.context-kb/: Global store, one per machine.
Installation & Enablement¶
Run the following in the DSH directory:
dsh plugin add github:why774/dsh-context-kb
Once installed, the plugin deploys the bundled why774/context-kb CLI to vendor/kb/ and is automatically loaded when DSH starts.
Typical Usage¶
- Initialize the knowledge base store in the project root (done automatically on the first
kb_logcall). - Continuously use
kb_logduring the conversation to record raw text. - Call
kb_sealto seal a segment after completing a topic. - Use
kb_indexto write a conclusion index for the sealed segment, e.g. recording key conclusions and line number ranges. - In subsequent turns, use
kb_searchto look up conclusions, or usekb_contextto obtain hierarchical context.
The plugin does not provide code symbol resolution; it only supports text-based memory and indexing.
Use Cases & Notes¶
- Suitable for DSH projects that need to accumulate knowledge across conversations and have retrieval requirements for conclusions and pitfall records.
- The plugin runs with the permissions of the current DSH process. Review the source code and license (MIT) before installing.
- The short-term store tracks the current conversation via
.context-kb/currentin the project directory; parallel DSH sessions within the same project share the same segment until it is sealed. - Requires DSH 0.2.x and a Python 3 interpreter available on the system (the path can be specified via
DSH_CONTEXT_KB_PYTHON; by default it prioritizes$DSH_HOME/dsh-runtimes/*/dependencies/pythonorpython3/pythononPATH).
Closing¶
dsh-context-kb uses conversation-text indexing and tiered context to ensure that key conclusions and code snippets remain retrievable by the model even after long conversations are compressed. It is well suited to project-based workflows that require persistent memory.
- Plugin directory page: https://www.skillhub.cn/plugins/why774/dsh-context-kb
- GitHub: https://github.com/why774/dsh-context-kb