DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-session-query-vector

m

dsh-session-query-vector

Manifest valid

Semantic session search backend for DSH, backed by Ollama or any OpenAI-compatible embedding endpoint.

hasBundlePatch

dsh-session-query-vector

A semantic session-search backend for DSH, backed by Ollama or any OpenAI-compatible /v1/embeddings endpoint.

DSH ships a SQLite full-text backend (@deepseek-ai/dsh-session-query-sqlite) that answers "which session contained this word". This package replaces it with a vector backend that answers "which session was about this" — you ask in your own words, the query is embedded, and the closest chunks come back with their session and snippet.

It is a drop-in replacement for the official backend: both extend the same sessionQuery service, so exactly one of them may be mounted at a time.

Requirements

DSH0.2.1-rc.2 (developed and tested against it)
@deepseek-ai/cordis~4.0.5
@deepseek-ai/schemastery3.18.5 (ships with DSH)
Node.js22+ — the indexer uses the built-in node:sqlite (DatabaseSync)
An embedding endpointOllama locally, or any OpenAI-compatible API

Earlier DSH releases are untested.

Two pieces

PieceWhat it is
lib/index.jsThe query side — a SessionQueryEngine subclass mounted as a plugin. Answers searches by reading the index. Never embeds.
indexer.mjsThe index side — a standalone script. Walks ~/.dsh/sessions, embeds the message text, writes the vectors.

They are deliberately separate: search must stay fast, and embedding is slow. The query side never triggers an embedding on the search path; if the index is empty it returns nothing.

The two sides must use the same embedding model. Otherwise the stored vectors and the query vector live in different spaces and every score is noise. Configure embedModel identically in both.

Install

dsh plugin --profile <your-profile> add github:minhaoli/dsh-session-query-vector

The package declares dsh.bundle.patch, so dsh plugin add appends it to dsh.profile.bundles and the loader mounts it on the next start.

The bundle patch also disables the official backend, because both register sessionQuery:

# cordis.patch.yml shipped with this package
- id: session-query-sqlite
  disabled: true

- insert:
    - id: session-query-vector
      name: 'dsh-session-query-vector'
      config:
        provider: ollama
        baseUrl: 'http://127.0.0.1:11434'
        embedModel: bge-m3
        openAt: first-search

If you would rather keep the official backend, remove that first row and do not mount this package — they cannot coexist.

Configuration

Set these in your profile's cordis.patch.yml. A patch replaces the targeted row's whole config rather than merging into it, so restate every key you want to keep.

# ~/.dsh/profiles/<profile>/cordis.patch.yml
- insert:
    - id: session-query-vector
      name: 'dsh-session-query-vector'
      config:
        path: 'C:/Users/<you>/.dsh/storages/session-query-vector.sqlite'
        provider: openai
        baseUrl: 'https://api.siliconflow.cn/v1'
        apiKey: 'sk-...'
        embedModel: 'BAAI/bge-m3'
        openAt: first-search
        topK: 20
        minScore: 0.45
KeyDefaultMeaning
path~/.dsh/storages/session-query-vector.sqliteIndex database. Created on first use.
openAtfirst-searchstartup opens the DB at mount; first-search on the first query; never disables search entirely.
providerollamaollama or openai. openai means any OpenAI-compatible /v1/embeddings.
baseUrlhttp://127.0.0.1:11434Embedding endpoint. A trailing /v1 is stripped and re-added, so https://host/v1 and https://host both work.
apiKey""Sent as Authorization: Bearer when non-empty. Not needed for Ollama.
embedModelbge-m3Must match the indexer.
embedTimeoutMs120000Per-request timeout.
topK20Candidates pulled from the index before ranking.
minScore0.45Cosine floor.
relMargin0.10Relative cutoff: a hit is kept only if its score is within relMargin of the best hit.
snippetChars240Snippet length in the result.
readWindowMax50Read window for the engine's live-preferred reads.

Endpoint contracts

Ollama (provider: ollama)

POST {baseUrl}/api/embeddings
content-type: application/json

{ "model": "bge-m3", "prompt": "the text to embed" }

Response: { "embedding": [0.013, -0.021, ...] }.

Pull the model first:

ollama pull bge-m3

OpenAI-compatible (provider: openai)

POST {baseUrl}/v1/embeddings
authorization: Bearer <apiKey>
content-type: application/json

{ "model": "BAAI/bge-m3", "input": ["chunk one", "chunk two"] }

Response: { "data": [{ "index": 0, "embedding": [...] }, ...] }. Results are sorted by data[].index before use — some providers return them out of order.

A trailing /v1 on baseUrl is stripped before /v1/embeddings is appended, so https://api.siliconflow.cn/v1 does not become /v1/v1/embeddings.

Any endpoint that satisfies this contract works: SiliconFlow, OpenAI, Azure OpenAI, Together, a local vLLM or LM Studio server, and so on. Set baseUrl, apiKey and embedModel to whatever that provider names the model.

Building the index

indexer.mjs is not run by DSH — start it yourself, after the query side is configured. It must be able to import the @deepseek-ai/* packages, so run it with the DSH runtime (see below).

# layered: layer 1 (user messages) first, then layer 2 (assistant messages)
node indexer.mjs

node indexer.mjs --layer=1        # only user messages — fastest path to a usable search
node indexer.mjs --layer=2        # only assistant messages
node indexer.mjs --limit=200      # cap sessions this run
node indexer.mjs --status         # print progress, index nothing
node indexer.mjs --force          # re-index unchanged sessions
node indexer.mjs --quiet          # no progress lines, only key events
node indexer.mjs --skip-active=5  # skip sessions written in the last 5 minutes
Environment variableDefaultMeaning
DSH_HOME~/.dshDSH home. Everything else derives from it.
DSH_MODULES$DSH_HOME/node_modules/@deepseek-aiWhere to resolve @deepseek-ai/*. Override for the packaged desktop app.
VEC_DB$DSH_HOME/storages/session-query-vector.sqliteIndex path — must equal the plugin's path.
VEC_SESSIONS$DSH_HOME/sessionsSession log root.
VEC_PROVIDERollamaollama or openai — must equal the plugin's provider.
VEC_BASE_URLhttp://127.0.0.1:11434Must equal the plugin's baseUrl.
VEC_API_KEY""Must equal the plugin's apiKey.
VEC_MODELbge-m3Must equal the plugin's embedModel.
VEC_CHUNK1200Characters per chunk.
VEC_BATCH16Chunks per embedding request.
VEC_SUBAGENTS—Set to 1 to include subagent sessions.

Running the indexer against the packaged desktop app

The Electron app's @deepseek-ai/* modules live inside app.asar, which plain node cannot read. Point DSH_MODULES at the asar and run the indexer under the app's own binary in Node mode:

$env:ELECTRON_RUN_AS_NODE = '1'
$env:DSH_MODULES = 'D:/APP/deepseek harness/resources/app.asar/dsh/node_modules/@deepseek-ai/'
& 'D:\APP\deepseek harness\DeepSeek Harness.exe' indexer.mjs --status

From a source checkout, plain node indexer.mjs works — DSH_MODULES already points at real files.

Index schema

One SQLite file, application_id = 1146308690 (distinct from the official backend's), user_version = 1. A file whose application_id belongs to something else is refused rather than clobbered.

TablePurpose
vec_chunks(session_id, seq, type, time, chunk_idx, text, dim, vector BLOB)One row per embedded chunk. Primary key (session_id, seq, chunk_idx).
vec_sessions(id, revision, indexed_at, chunks, cwd, layer)Per-session bookkeeping; revision drives the incremental skip.
vec_queries(text, vector, dim, at)Query-vector cache, so repeating a search skips the embedding round trip.

All tables are STRICT. Each session is one transaction, so an interrupted run never leaves a half-written session.

Failure modes worth knowing

  • Empty results, no error. The index has not been built, or was built with a different model. Check --status.
  • database ... belongs to another application. path points at a file this package did not create.
  • database ... is not an empty or recognized index. The file exists with tables but no application_id — point path somewhere else or delete it.
  • /v1/v1/embeddings 404. You set baseUrl with a trailing /v1 and the code already handles it; a 404 here means the provider's path differs from the OpenAI contract.
  • Both backends mounted. sessionQuery is registered twice and the second mount fails. Disable session-query-sqlite.

Companion plugins

License

MIT — see LICENSE.

Comments

Loading…

Similar plugins

dsh-plugin-semantic-memory

by chenkezhen480

Semantic long-term memory for DeepSeek Harness: embedding-based retrieval over a persistent cross-session memory store, with model-facing tools, proactive per-question recall, automatic conversation summarization, and auto-selected embedding provider (apiKey present → API, otherwise local).

Tools & CapabilitiesManifest valid

★ 0

Apache-2.0

TypeScript

Aug 17, 2026

dsh plugin --profile web add dsh-plugin-semantic-memory

by 173787247

DeepSeek Harness WSL plugin (dsh-wsl-vecmem)

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 1

MIT

JavaScript

Sep 30, 2026

dsh plugin --profile web add dsh-wsl-vecmem

Local semantic code search for DeepSeek Harness: fragment-level symbol-aware indexing, offline lexical embeddings or an OpenAI-compatible endpoint, and hybrid vector + BM25 retrieval fused with RRF -

Tools & CapabilitiesManifest valid

★ 2

MIT

TypeScript

dsh plugin --profile web add dsh-semantic-search

by sryimnoob123

Routes the DSH web_search tool through Ollama's web search API, reusing OLLAMA_API_KEY. No DeepSeek official key needed.

Tools & CapabilitiesManifest valid

★ 3

↓ 130/wk

JavaScript

Aug 25, 2026

dsh plugin --profile web add dsh-web-search-ollama

by Witchwarren2344

Provide long-term memory, vector semantic search, and LLM reflection for DeepSeek Harness (DSH) with this free, MIT-licensed plugin.

Manifest valid

★ 1

MIT

JavaScript

Sep 12, 2026

dsh plugin --profile web add dsh-mnemosyne-memory

by 2275803244-cpu

In-session full-text search for the DeepSeek Harness web GUI: kind filters, multi-term AND matching, keyboard navigation, copy-to-clipboard, and jump-to-message.

Terminal & ClientsManifest valid

★ 0

MIT

JavaScript

Oct 1, 2026

dsh plugin --profile web add dsh-client-ui-session-search