Skip to main content

dsh-mneme

31Stars3Forks5Issues2Watchers

Provides cross-session persistent memory for DeepSeek Harness using SQLite + editable Markdown dual mirroring, with automatic background deduplication, merging, and session summarization.

Categories◆ Memory
Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
JavaScript
License
MIT
Branch
main
agent-memoryagent-memory-systemautodreamdeepseek-harnessdsh-pluginknowledge-managementmemory-consolidationpersistent-memory

Install

cmdweb profile
$ dsh plugin --profile web add @modusensus/dsh-mneme

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin modusensus/dsh-mneme for me: review the repository at https://github.com/modusensus/dsh-mneme first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Sentence Pitch

Give DeepSeek Harness cross-session persistent memory — let the AI keep what it learned about your preferences, projects, decisions in this conversation, and automatically bring them back into the system prompt for new sessions.

Core Capabilities

  • Auto-write and deduplication merge: The model stores memories via memory_save tool; entries with the same title merge automatically with version history preserved (content_history)
  • Auto-inject: At session start, high-importance memories are injected into the system prompt so the AI sees what you said before
  • Background autoDream auto-organization: After memory count or word count thresholds are met, async LLM arbitration triggers (keep / merge / archive / conflict / update); the memory bank gets more refined over time
  • Editable Markdown mirror: Preferences, projects, decisions, history, and overview each land in separate .md files, with human edits taking priority for write-back
  • Fully optional semantic search: Beyond keywords, add BM25 + vector retrieval + cross-encoder reranking; three-way retrieval fusion with adaptive thresholds
  • Session summary + short-term hot memory: Session end automatically extracts key points; the last 5 conversation turns in current session are injected as rolling hot memory blocks
  • Entity memory + Wiki-Link + Tag system: Extract named entities and timeline attributes from memories; supports [[bidirectional links]] and #tags (disabled by default, enable as needed)

Technical Implementation

  • Language: JavaScript (Node.js ESM, type: module)
  • Key Dependencies: @deepseek-ai/cordis (DI container), @deepseek-ai/dsh-tools (model tool registration), @deepseek-ai/schemastery (config Schema), @deepseek-ai/transformers (optional, local vector/reranking)
  • Architecture Pattern: Cordis apply(ctx, config) injection into several host hooks: tools / systemPrompt / webServer / llm / commands; default config written to DSH profile via cordis.patch.yml bundle for zero-config startup; background maintenance via two pipelines: createDreamScheduler threshold-based scheduling + createSleepScheduler idle-based scheduling
  • Entry Point: dsh-mneme/lib/index.js (published artifact), development source at dsh-mneme/src/index.js

Use Cases

This plugin solves the problem when you want DSH to remember your project background, coding habits, and past decisions like a long-term coworker — instead of re-explaining everything every new session. It's suited for medium-to-long-term users: those who work with AI for several hours daily and need a retrievable knowledge base accumulating over time. It's not suitable for one-off Q&A or chat-and-go scenarios. With semantic search enabled, the AI can also recall things with natural language like "that thing we talked about last time," allowing you to continue projects across days without restating context.

Prerequisites & Compatibility

DependencyMinimum VersionDescription
DeepSeek Harness (DSH)>= 0.1.0-rc.6Same-version peer dependency with @deepseek-ai/dsh-host-webserver
Node.js>= 24.0.0Relies on node:sqlite built-in module (badge shown in README)
PlatformCross-platformRuns via DSH web profile; OS-agnostic
Native Modulenode:sqliteBuilt into Node, no third-party native compilation needed

Installation

dsh plugin --profile web add github:modusensus/dsh-mneme

Configuration Options

Default behavior works out of the box, all listed in schema with no hard requirements. Below are the most commonly adjusted items; modify in DSH Settings → Memory Settings as needed, or override in ~/.dsh/profiles/web/cordis.patch.yml with id: dsh-mneme section.

ConfigTypeDescriptionDefault
memoryDirstringMemory storage directory (SQLite database + Markdown mirror)~/.dsh/memory
autoInjectbooleanAuto-inject high-importance memories into system prompt on new sessiontrue
autoSummarizebooleanAuto-extract summary and store on session endtrue
maxInjectedItemsinteger 1-20Max memories to inject per session5
importanceThresholdinteger 1-5Minimum importance required for injection3
autoDreambooleanBackground auto-organization switch (dedupe / merge / archive / arbitrate)true
dreamThresholdCountinteger 1-1000Memory count threshold to trigger organization10
dreamDelayMsinteger 0-60000Debounce delay for organization run (milliseconds)2000
dreamReasoningEffortenumReasoning models need off to disable reasoning, otherwise output will have empty bodynone
embedProviderenumopenai / local (ONNX offline) / ollamaopenai
sessionLifecycleEnabledbooleanWhen enabled, deleting a session soft-hides its memories (recoverable); default off to preserve legacy behaviorfalse
entityExtractionEnabledbooleanWhen enabled, auto-extract entities / properties / relations from new memoriesfalse
apiTokenstringWhen set, write API and vector key API require Bearer auth; empty means openempty

FAQ

Q: I installed the plugin but have no memory available. Do I need to feed it conversation content first?

A: No need. When you open a new session, the AI will see existing memories; new facts are written by the AI itself via the memory_save tool — no manual calls required.

Q: Where is data stored? Will it sync to the cloud?

A: Only on the machine running DSH, at path ~/.dsh/memory/. SQLite main database and Markdown mirror are together; no remote upload. Just copy the directory to back up.

Q: If I delete the conversation window, does the memory go away too?

A: By default no — memories and conversation windows are separate; deleting a session doesn't affect saved memories. With sessionLifecycleEnabled enabled, deleting a session becomes soft-hide (you can still see and recover via memory_list with include_archived).

Q: How do I let the AI search with natural language like "that thing we talked about last time"?

A: Go to Settings → Memory → Toolbar and switch to "Semantic"; this enables vector retrieval. Background is keyword + BM25 + vector three-way fusion with query-length-adaptive thresholds.

Q: My embedding service is unreachable — will vectors cause errors?

A: No. Embedding failures automatically fall back to keyword search; local ONNX model download failures just log warnings and degrade to keyword search — main flow works normally.

Q: Why does a deleted memory still show up in search?

A: You might be using memory_forget or memory_archive — these suppress injection and archive respectively, both recoverable. To physically delete, explicitly use memory_delete, either by id or by query description.

Q: How do I completely disable this plugin?

A: Remove the bundle from DSH profile: dsh plugin --profile web remove @modusensus/dsh-mneme. Data stays on disk; reinstall to restore.

Learning Curve

Beginner — default config works out of the box; most users don't need to change any settings. Only when preparing to enable optional features like vector search / Sleep Mode / entity extraction do you need to check the config options.

Known Issues & Limitations

  • Reasoning models (e.g., deepseek-v4-flash / DeepSeek-R1) will burn the entire token budget on reasoning with autoDream default parameters, resulting in empty body (common log: no json array in llm output). Fix: explicitly set both dreamReasoningEffort and sleepReasoningEffort to off; these default to none to preserve existing behavior.
  • Rerank reranking is disabled by default (rerankEnabled=false) because initialization loads onnxruntime-node; to use it, you must explicitly enable it and accept model download + first-inference latency.
  • Database is single-file SQLite (node:sqlite synchronous API), doesn't support concurrent multi-process writes; DSH runs single-process hosting, multi-instance sharing will conflict.
  • LLM routing goes through agentDefaultModel, no independent key: by default consumes main conversation token budget; when budget is tight, manually set dreamProvider / dreamModel / summarizeProvider to point to lightweight models.
  • Advanced features (entity extraction, Wiki-Link, Tag weighting, Sleep, Session lifecycle) are disabled by default — conservative enabling to avoid breaking existing behavior; consult config docs before first use.

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/modusensus/dsh-mneme)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory