dsh-memsearch

August 14, 2026 · View on GitHub

npm version GitHub

English | 简体中文

Make DeepSeek Harness (DSH) auto-write and recall mmsearch memories by default, just like the official Codex / Claude Code memsearch plugins. Fully local — no LLM calls required by default (offline-ready).

Behavior (mirrors the official plugins)

WhenWhat happens
Session start (first step)Runs a background memsearch index; injects a plugin-sourced status message: memsearch version, embedding provider, journal dir, past-memory file count + a hint to use the memory-recall skill when history may help
Turn end (turn/end)Auto-captures the user question + the agent's final reply, appends a compact entry to <memoryDir>/<YYYY-MM-DD>.md, then runs an incremental memsearch index in the background (deduped: the same turn is never written twice)
RecallFollows the official design: no automatic context stuffing — the agent searches on demand via the memsearch memory-recall skill

Memory journal format

### HH:MM
=== Final exchange, authoritative for outcome ===
[User]: <user question>
[DSH]: <agent final reply>

DSH is an always-on web app without a Codex-style session-end hook, so capture happens per turn. If a memsearch [llm] provider is configured, summarizePlugin can replace the raw text with an LLM summary.

Configuration (under config: in cordis.patch.yml)

KeyDefaultDescription
enabledtrueMaster switch
memoryDir""Journal dir; empty = $MEMSEARCH_DIR/memory or ~/.memsearch/memory
collection""Milvus collection passed to the CLI; empty = configured default
injectSessionStatustrueInject session-start status + recall hint
capturetrueAuto-append a journal entry after each turn
captureMinPromptLength10Skip turns whose user prompt is shorter than this (greetings etc.)
maxCaptureChars8000Cap on the raw exchange text written per turn
summarizePlugin""e.g. "codex" to summarize via memsearch summarize (needs [llm] config); empty = raw text
indexAfterCapturetrueRe-index after appending

Installation

# 1. Install the plugin (npm registry or GitHub — pick one)
dsh plugin --profile web add dsh-memsearch
# or install from GitHub source:
# dsh plugin --profile web add "git+https://github.com/clouwer/dsh-memsearch.git"

# 2. Append to ~/.dsh/profiles/web/cordis.patch.yml
#    (NOTE: new plugin instances must be added via an `insert` list —
#    plain `id:`-targeted patches only override existing entries)
# - insert:
#     - id: memsearch-automemory
#       name: 'dsh-memsearch'
#       config:
#         enabled: true

# 3. Restart dsh web (config is composed at startup)

Dependencies: the plugin consumes the host DSH's own @deepseek-ai/cordis / @deepseek-ai/dsh-agent via peerDependencies — nothing extra to install.

Verification

# Unit tests (mocked session, no DSH needed)
npm test

# After restarting DSH: chat a turn, then check today's journal
tail -20 ~/.memsearch/memory/$(date +%Y-%m-%d).md
memsearch stats          # chunk count should grow with conversations

The memory journal lives in ~/.memsearch/memory/ by default; with MEMSEARCH_DIR set it is $MEMSEARCH_DIR/memory/.