Introduction¶
Conversations in DeepSeek Harness (DSH) typically exist as static logs, making it difficult to quickly retrieve specific information in later sessions. dsh-plugin-rag is a plugin that uses semantic retrieval (RAG) to transform all your DSH chat sessions into searchable, persistent memory.
Plugin Overview¶
- Name: dsh-plugin-rag
- Core Value: Provides semantic memory (RAG) for all DeepSeek Harness chat sessions, enabling automatic, self-contained, and non-destructive conversation indexing.
- Maintainer: mervyn-teo
- License: MIT
Core Features¶
The plugin implements the following capabilities by listening to DSH’s event system:
- Automatic indexing: Automatically converts conversations into searchable memory without manual export or rebuilding.
- Incremental indexing: New messages are indexed incrementally, while older content is decremented when compressed or replaced, keeping the index aligned with the current session state.
- Non-destructive: It only listens to emitted events and does not modify DSH’s execution loop.
- Self-contained: Vector data is stored in a local JSON file, with no dependency on external databases.
- Model-agnostic: Supports built-in presets or custom endpoints.
- Tool integration: Provides the
rag_searchtool for model invocation. - Indexing rules: Indexing tool results is enabled by default, while indexing reasoning blocks is disabled by default. Only human-issued
user/messageevents are indexed.
Installation and Enablement¶
Installing this plugin requires modifying package.json and cordis.patch.yml.
- Add the following to
dependenciesinpackage.json:
"dsh-plugin-rag": "github:mervyn-teo/dsh-plugin-rag"
- Add the following insertion lines to
cordis.patch.yml:
- insert:
- id: rag
name: dsh-plugin-rag
config:
enabled: true
provider: soclaas-bge-m3
model: bge-m3
endpoint: https://soclaas-api.comp.nus.edu.sg/v1
topK: 5
dataDir: ""
includeToolResults: true
includeReasoning: false
maxChunkChars: 4000
- Reinstall and restart Harness.
Usage¶
After installation, the model will have access to the rag_search tool. You can retrieve historical conversations using the following command:
rag_search("how did we set up the terminal plugin's WebSocket handshake?")
Notes¶
- Storage location: The index is stored by default in
~/.dsh/rag/index.json. - Rebuild mechanism: Changing the model or endpoint triggers a full rebuild.
- API keys: Managed through environment variables or settings, and not stored in the index file.
- Restart behavior: Restart is idempotent and only processes new content.
References¶
- GitHub repository: https://github.com/mervyn-teo/dsh-plugin-rag
- Ecosystem directory: https://www.skillhub.cn/plugins/mervyn-teo/dsh-plugin-rag