DeepSeek Harness 插件

dsh-plugin-rag-mervynte

DeepSeek Harness (DSH) plugin: a self-contained semantic memory (RAG) over all your chat sessions. Indexes messages live via session/event, stores embeddings in one local JSON file, and exposes a(英文原文)

跳到安装方式

来源信息

GitHub 仓库
mervyn-teo/dsh-plugin-rag
最近更新
2026年8月20日
分类
文档与渲染
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/mervyn-teo/dsh-plugin-rag
插件名:dsh-plugin-rag-mervynte
作者:mervyn-teo

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-plugin-rag

<p align="center"> <img src="assets/banner.png" alt="dsh-plugin-rag — semantic memory for your DSH sessions" width="720" /> </p>

<p align="center"> <strong>Semantic memory (RAG) over all your DeepSeek Harness chat sessions — automatic, self-contained, and non-destructive.</strong> </p>

<p align="center"> <a href="#install"><strong>Install</strong></a> · <a href="#how-it-works"><strong>How it works</strong></a> · <a href="#settings"><strong>Settings</strong></a> · <a href="#the-rag_search-tool"><strong>The <code>rag_search</code> tool</strong></a> · <a href="#uninstall"><strong>Uninstall</strong></a> </p>

---

What it does

dsh-plugin-rag turns every conversation you have with the harness into a searchable memory. As you chat, the plugin increments the index with each new message and decrements it when compaction/pruning shadows old content, so retrieval always reflects the current surface of your sessions — never a stale dump.

  • Automatic — no rebuild schedule, no manual export. It listens to the

session store and stays in sync as you work.

  • Self-contained — embeddings come from any OpenAI-compatible

/embeddings endpoint; vectors live in one local JSON file. No native modules, no database, no extra service.

  • Non-destructive — it listens to published session events. It never

patches the agent loop, and uninstalling restores the harness to its exact original state.

  • Model-agnostic — choose a built-in preset or plug in your own

endpoint, model, and API key.

<p align="center"> <img src="assets/demo.gif" alt="dsh-plugin-rag demo" width="720" /> </p>

Install

A DSH plugin is a plain npm/Cordis package. Install it exactly like the terminal or qr-connect plugins: add it to your profile's dependencies, bundle list, and one cordis.patch.yml insert row.

1. Add the package to your profile's package.json (e.g. ~/.dsh/profiles/web/package.json):

``jsonc { "dependencies": { "dsh-plugin-rag": "github:mervyn-teo/dsh-plugin-rag" }, "dsh": { "profile": { "bundles": [ "@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-plugin-rag" ] } } } ``

> Or install from a local clone: "dsh-plugin-rag": "file:/path/to/dsh-plugin-rag".

2. Add the insert row to your profile's cordis.patch.yml (create it if it doesn't exist):

``yaml - 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 apiKey: "" apiKeyEnv: SOCLAAS_API_KEY topK: 5 dataDir: "" includeToolResults: true includeReasoning: false maxChunkChars: 4000 ``

3. Reinstall and restart the harness so the profile re-resolves its dependencies and mounts the new bundle.

Settings

Open Settings → Plugins → RAG Memory. The card exposes exactly the fields you need to point the indexer at any embeddings provider:

FieldPurpose
Enable indexingToggle the indexer and the rag_search tool.
Embedding modelPick an existing presetBGE-M3 (SoCLaaS), OpenAI text-embedding-3-small/large, or Ollama nomic-embed-text — or Custom… to supply your own.
Endpoint URLBase URL of any OpenAI-compatible embeddings endpoint.
Model nameThe model string sent to the endpoint.
API keyPaste a key directly, or leave empty to read it from an environment variable.
Key env varThe environment variable read when the API key field is empty.
ResultsDefault number of hits returned by rag_search.
Index tool resultsAlso index tool output (on by default).
Index reasoningAlso index model reasoning blocks (off: noise + privacy).
Max chars per chunkChunk size for long messages.

The card also shows a live index status (chunk count, session count, vector dimension, model, data dir) and a Reindex button.

> ⚠️ Changing the model or endpoint triggers a full rebuild, because > embedding vectors are not comparable across models or providers.

The rag_search tool

Once installed, the model gains a first-class rag_search tool. It embeds the query with your configured endpoint and returns the most relevant past messages — each with role, session title, and snippet — so the agent can recall prior work, decisions, code, and context across sessions.

rag_search("how did we set up the terminal plugin's WebSocket handshake?")

How it works

The plugin plugs into the harness the non-destructive way — by subscribing to events the session store already publishes:

EventEffect
session/createdReplays the (new or resumed) session's log from the stored cursor forward.
session/eventIncrement/decrement — indexes new user/message, assistant/message, and tool/result surface events; un-indexes entries shadowed by a replace (compaction / tool-result pruning).
session/flushAwaited durability checkpoint; drains the pending embed batch.

Message extraction is deliberate about noise:

  • only human user/message events (real prompts, not system-prompt or

runtime-context injections) are indexed;

  • assistant/message contributes its final text blocks (not reasoning or

tool-call blocks — those are skipped unless you enable Index reasoning);

  • tool/result contributes tool output (optional, and truncated by the

chunker).

Embeddings are written to ~/.dsh/rag/index.json (configurable via dataDir) using an atomic tmp+rename write. A per-session cursor tracks the last processed seq, so restarts are idempotent and only new content is embedded.

Uninstall

Uninstall is just as clean as install — nothing in the harness was modified:

1. Remove the dsh-plugin-rag entry from cordis.patch.yml and from dsh.profile.bundles. 2. Remove it from package.json dependencies. 3. Reinstall and restart.

Cordis disposes the plugin's scope (listeners, the rag_search tool, and the config route) automatically, leaving the harness byte-identical to before. The only residue is the index file itself; delete ~/.dsh/rag/ (or your dataDir) to purge the stored vectors.

Configuration reference

KeyDefaultContract
enabledtrueWhether indexing and the rag_search tool are active.
providersoclaas-bge-m3soclaas-bge-m3 · openai-3-small · openai-3-large · ollama-nomic · custom
modelbge-m3Model string sent to the endpoint (overrides the preset's model).
endpointhttps://soclaas-api.comp.nus.edu.sg/v1OpenAI-compatible embeddings base URL.
apiKey""API key; empty reads apiKeyEnv.
apiKeyEnvSOCLAAS_API_KEYEnvironment variable for the key.
topK5Default result count (1–50).
dataDir""Index directory; empty means ~/.dsh/rag.
includeToolResultstrueIndex tool results.
includeReasoningfalseIndex reasoning blocks.
maxChunkChars4000Max characters per chunk (256–16000).

Privacy

Everything stays on your machine by default: the index is a local file, and the only outbound traffic is the embedding request to the endpoint you configure. API keys are never written into the index; they are read from the environment or kept in the plugin's runtime config.

License

[MIT](LICENSE)