Read-only semantic retrieval for meow-memory: a local bge-m3 vector index over memory entries and conversation turns, a knowledge graph, and verbatim turn recall. Never writes back to the memory store; requires meow-memory.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Jackbessaliuz/dsh-memory-semantic
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
A semantic retrieval layer for the meow-memory memory system — so what has been recorded can actually be recalled.
A DeepSeek Harness (DSH) plugin. It reads your memory database read-only, builds a local vector index, and adds three things to your AI: semantic search, a memory graph, and verbatim conversation recall.
⚠️ The Chinese README.md is the source of truth and is updated first; this English version may lag behind it.
How memory runs
┌─ Store ───────────────────────────────────────────────────────┐
│ │
│ Shelf A: knowledge (meow-memory) Shelf B: raw turns (this)│
│ ─────────────────────────────── ──────────────────────── │
│ book = notes the AI wrote book = the dialogue │
│ (soul/user/rules/fact/ itself, verbatim │
│ lesson/topic/project) + one-line label │
│ who = the AI, deliberately who = written for you, │
│ keeps = dream (dedupe/archive) keeps = nothing (append)│
│ means = "what I know" means = "what was │
│ actually said" │
└───────────────────────────────────────────────────────────────┘
│
┌─ Find ────────────────────────┴───────────────────────────────┐
│ Shelf A: memory_search (keywords) │
│ memory_semantic (vector + keywords fused) │
│ memory_graph (importance, topics, neighbours) │
│ Shelf B: recall_turns (the verbatim exchange) │
└───────────────────────────────────────────────────────────────┘
│
┌─ Deliver (pushed to the model) ┴─────────────────────────────┐
│ ① first-turn long-term memory injection │
│ ② action-triggered injection (rules & lessons) │
│ ③ cross-session handoff ("continue" in a new session) │
│ ④ recall injection (relevant raw turns, every turn) │
└───────────────────────────────────────────────────────────────┘
In one line: meow-memory stores; this plugin finds and delivers.
The problem
Keyword search hits three walls:
- Different words, same meaning. Your memory says
thresholdRatio lowered; you search "context is too full" — zero hits. - No sense of importance. Once there are hundreds of entries, which ones are hubs and which are trivia is not something you can eyeball.
- Summaries eat the details. Long conversations get compacted into summaries; when you actually need the original wording, it is gone.
This plugin adds all three on top of the same memory database, without changing the original system.
Boundary with meow-memory (important)
| meow-memory | dsh-memory-semantic | |
|---|---|---|
| Role | Base: writing, layering, curating memories | Enhancement: read-only retrieval |
| Database | <workspace>/.dsh-meow/memory.db |
its own <workspace>/.dsh-semantic/* |
| Effect on the other | — | never writes, never modifies |
Two hard rules:
- The plugin always opens the memory database read-only: no tables created, no rows written, no schema changes.
- Uninstall it and meow-memory keeps working exactly as before, with all its data intact.
Either works alone; together they are "remember" plus "recall".
Features
Three tools
| Tool | What it does |
|---|---|
memory_semantic |
Semantic memory search: local embeddings + BM25, fused with RRF |
memory_graph |
Memory graph: global importance (weighted PageRank), knowledge domains (communities), similar neighbours |
recall_turns |
Verbatim recall: find the actual question-and-answer text from earlier conversations |
Automatic wiring
- Cross-session relay — say "continue" in a new session and the tail of the previous one is carried over automatically.
- Action-triggered injection — when a risky action is detected (editing config, touching data), relevant rules and lessons are retrieved and attached to the next request.
- Injection ledger — each memory is injected at most once per session.
- Context assembly — retrieved passages are inserted before the current question, with a size cap.
Settings page
After installation a Semantic Memory page appears in DSH settings: vector engine availability, index size, turn-store size, graph size, the effective retrieval/graph parameters, and suggested host compaction presets.
The Ollama auto-start toggle can be switched right there — it takes effect immediately (stored in the plugin's own ~/.dsh/dsh-memory-semantic.runtime.json, never touching host configuration).
Install
Option 1 — command line (CLI / web profile)
dsh plugin --profile <profile-name> add github:Jackbessaliuz/dsh-memory-semantic
dsh pluginpasses its arguments straight through to pnpm inside the profile, soadd/remove/updateall work. ⚠️ On the desktop app (Electron) thedesktopprofile is owned exclusively by the application and cannot be driven from the CLI — install through the app's own plugin manager instead.
The package declares a dsh.bundle.patch, so the installer/reconciler adds it to the current profile's bundles automatically. Restart DSH to take effect (host-side plugins are not hot-reloaded).
Option 2 — local development (link)
npm i link:<path-to-this-repo>
then insert a dsh-memory-semantic entry into the profile's cordis.patch.yml by hand.
Do not do both — bundles and a manual insert for the same entry will fail with a duplicate entry id.
Troubleshooting
allowBuilds/ blocked build script — pnpm 10+ blocks install-time scripts. This package has none (plain JS), but a sibling in the same install may trigger it — most oftenmeow-memory, which ships aprepare. Follow pnpm's printed instruction, add the key to the profile'spnpm-workspace.yaml, then re-run.- Official desktop app — its
desktopprofile is owned by the app; install through the in-app plugin manager, not the CLI. - Installed but nothing happens — restart DSH: host-side plugins are not hot-reloaded.
- Search feels dumber than expected — Ollama is not running, so it fell back to keyword-only search. That is by design, not a failure.
For an AI assistant installing this
- Make sure
meow-memoryis present first — this plugin only reads its database and does nothing on its own. dsh plugin --profile <profile> add github:Jackbessaliuz/dsh-memory-semantic- Restart DSH afterwards.
- Verify:
dsh-memory-semanticmust appear exactly once indsh --profile <profile> --dump-config(not available on the official desktop app — use its plugin manager instead).
Configuration
Every knob lives in the profile patch config: section; no code changes needed:
- id: dsh-memory-semantic
name: 'dsh-memory-semantic'
config:
ollama:
url: http://127.0.0.1:11434
model: bge-m3
autoStart: false # true = try to start Ollama in the background
executablePath: '' # for portable / custom installs
probeTimeoutMs: 800
warmupWaitMs: 0 # 0 = fire and forget; this turn falls back to BM25
embedBatch: 32
retrieval:
rrfK: 60
rrfPool: 10
outputChars: 220
queryInstruction: '为这个句子生成表示以用于检索相关文章:'
graph:
topK: 8
edgeThreshold: 0.62 # cosine threshold; higher = more fragmented communities
damping: 0.85
prIterations: 50
lpMaxIter: 50
Any invalid value silently falls back to its default — a bad config never breaks plugin loading.
Ollama is optional
- Installed — vector + BM25 fused retrieval, better recall.
- Missing / not running — degrades to plain BM25; everything keeps working, only semantic generalisation is weaker.
The plugin never errors or blocks because Ollama is absent. With autoStart: true it tries to start Ollama in the background without blocking the current turn.
Token cost (measured)
The plugin adds two small costs. meow-memory's own overhead does not change — this plugin only reads its database:
| Cost | Where it happens | Measured (median-length turn, 150 real turns) |
|---|---|---|
| One extraction per turn | background call, not in your chat context | ≈ 2,600 input + 240 output tokens |
| Recall injection | inserted before your question, counts as context | ≤ ≈ 1,100 tokens (k=3, 1200-char cap) |
Roughly 260k input + 24k output tokens per day at 100 turns/day; longer answers cost more than the median.
Both halves can be turned off independently: turns.live.enabled: false stops auto-extraction (you keep the three tools), turns.recallShadow.inject: false stops auto-injection (already-recorded turns stay searchable). Extraction is pinned to a low reasoning effort by default, so a cheap model is fine.
Data & privacy
- Everything stays local. The vector index, graph and turn store live under
.dsh-semantic/in your own workspace. - Embedding requests only go to your local Ollama (
127.0.0.1:11434by default). - The memory database is opened read-only; nothing in meow-memory is ever modified.
- A built-in redaction gate strips GitHub tokens, API keys, private keys and similar secrets before they can reach the turn store.
Credits
The turn-memory data model, the recall algorithms and the surface-takeover range semantics are ported from graph-memory (MIT License, © 2026 adoresever). The skeleton follows its design; the implementation was rewritten against DSH's plugin interfaces. Many thanks.
License
Links
More in this category
vectorize-io/hindsight#coding-agents★ 64488
Hindsight, agent memory that learns: long-term project memory with auto recall and retain, knowledge pages, deep reflection, and per-repo memory banks.
volcengine/OpenViking#examples/dsh-memory-plugin★ 43111
OpenViking memory and context bundle for DeepSeek Harness: pre-step auto-recall and profile injection, session capture, `viking://` URI guarding, and recall/write memory tools backed by an OpenViking server.
MemTensor/MemOS#memos-local-plugin★ 12554
Local-first memory plugin for DeepSeek Harness: layered L1/L2/L3 memory with automatic capture, manual memos_* retrieval tools, and a built-in memory viewer.
agentscope-ai/ReMe#dsh★ 3880
Connects DeepSeek Harness to ReMe's local-first, self-evolving personal knowledge base: automatically captures completed main-agent conversations as user-owned Markdown memory, searches conversations and source material through reme_search with BM25, optional embeddings, and wikilink expansion, and schedules daily memory consolidation.
zilliztech/memsearch#MemSearch★ 2977
Shared Markdown memory for DSH and other coding agents, with automatic capture, pre-step context injection, searchable recall, and memory-to-skill self-evolution through a review panel.
vshulcz/deja-vu#extensions/dsh★ 1717
Cross-session memory and context recovery across forty-five other coding agents (45+) on this machine, reading session files they already wrote before install (Claude Code, Codex, Cursor, Windsurf, Trae, Antigravity, VS Code Copilot Chat, opencode, OpenClaw, Hermes, Kimi, Qoder, Cline, Zed, Magpie and more): six tools (deja_recall, deja_session, deja_blame, deja_fix, deja_how, deja_remember), a /deja command, and optional automatic recall injected into runtime context. Local BM25 CLI/MCP index, no LLM, no embeddings, no network (dsh plugin --profile web add dsh-deja).
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.