dsh-memory-rules
Local memory and standing rules for DeepSeek Harness — SQLite-backed four-layer memory (world facts, experiences, beliefs, standing answers) with structured fact extraction per turn, four-path retrieval (semantic/keyword/graph/timeline), 7-day belief consolidation, Markdown export, a pre-step recall hook, an editable set of system-prompt blocks carrying the user's hard collaboration rules (formerly the separate dsh-user-rules bundle), and a 记忆与规则 Web UI with 信念库 and 提示词 tabs.
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:147-sys/dsh-memory-rulesREADME
Read the full README ↗Configuration
Precedence: plugin config (cordis.patch.yml) → environment variable → default.
| Config key | Env var | Default | Meaning |
|---|---|---|---|
enabled | DSH_MEMORY_ENABLED | true | master switch |
memoryDir | DSH_MEMORY_DIR | $DSH_HOME/memory | memory root |
dbFile | DSH_MEMORY_DB | /memory.db | database file (a relative value stays inside the root) |
dbEngine | DSH_MEMORY_DB_ENGINE | auto | auto / node:sqlite / sql.js |
captureEnabled | DSH_MEMORY_CAPTURE | true | write path on/off |
ingestEnabled | DSH_MEMORY_INGEST | true | per-turn fact extraction |
ingestMaxFactsPerTurn | — | 8 | ceiling per turn |
ingestMinConfidence | — | 0.35 | drop weak candidates |
markdownMirror | DSH_MEMORY_MIRROR | true | append facts to the day file |
recallEnabled | DSH_MEMORY_RECALL | true | injection on/off |
maxTokens | DSH_MEMORY_MAX_TOKENS | 1200 | hard token bound for the injected block (floored at 120) |
recallEntries | — | 6 | entries offered per turn |
pathSemantic … pathTimeline | — | true | enable/disable each retrieval path |
answerShortcut | — | true | consult standing answers before retrieval |
reflectEnabled | DSH_MEMORY_REFLECT | true | background consolidation |
reflectDays | — | [1, 8, 15, 22, 29] | days of the month (0 3 */7 * *) |
reflectAt | — | '03:00' | local time of the run |
reflectMinEvidence | — | 3 | facts needed before merging |
reflectQualityGate | DSH_MEMORY_REFLECT_QUALITY | true | block boilerplate / questions / instructions from becoming evidence |
reflectMinChars | — | 12 | shortest fact eligible as evidence |
reflectSkipPatterns | — | [] | extra regular expressions (strings) that disqualify a fact |
answerStaleDays | — | 60 | when a standing answer is considered stale |