
zhujunpeng12/dsh-memory-system
70Last commit Aug 15, 2026
dsh-memory-system DSH plugin
dsh-memory-system provides DSH agents with session-persistent memory through six layers: hot bootstrap, cold recall, authorized writes, governance scans, trajectory review, and working path rules. It uses only Python standard library and Markdown files, no database or vector service required. Memory data stays in the user's own Obsidian Vault, configured via environment variables.
How to install the dsh-memory-system DSH plugin
dsh plugin add @zhujunpeng12/dsh-memory-systemCopying does not run this command. Review the repository and version before installing the dsh-memory-system DSH plugin.
dsh-memory-system DSH plugin data source
dsh-memory-system DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-memory-system DSH plugin can do
- Hot memory injection at session start, compressing key context into ≤14KB bootstrap package
- Cold recall with Chinese bigram BM25, exact match, and metadata re-ranking, output ≤4.2KB with trace
- Authorized transactional writes with lease lock (30s lease/5s heartbeat), before-image, SHA-256, manifest, and receipt
- Read-only governance scans for duplicate, conflict, expiry, and size issues, never auto-modify
- Trajectory review using user corrections as hard signals to generate improvement candidates
- Zero external dependencies: Python standard library + Markdown, runs on Windows/macOS/Linux
Where the dsh-memory-system DSH plugin fits
- Maintaining agent context across sessions for long-running projects
- Persisting user preferences, project summaries, and decision history without external databases
- Reviewing agent session trajectories to identify recurring errors and evolve rule sets
- Providing a safe, auditable memory write path with dry-run preview and user confirmation
Who the dsh-memory-system DSH plugin is for
- DSH users who need their agent to remember context across sessions
- Developers building custom DSH-powered workflows that require persistent knowledge
dsh-memory-system DSH plugin limitations
- Only works within the DSH (DeepSeek Harness) platform; not a standalone memory system
- Requires a pre-configured Obsidian Vault directory and environment variables (MEMORY_VAULT, DSH_HOME)
- Vector search is disabled by default; only exact and BM25-based recall available out of the box
- Writing new memory always requires user confirmation (dry-run first, then apply=true)
- Trajectory review depends on optional evidence-ledger plugin for tool telemetry data
dsh-memory-system DSH plugin: from the repository README
Quoted from the zhujunpeng12/dsh-memory-system README, the upstream source of the dsh-memory-system DSH plugin. Copyright remains with the original authors.
> 一套给 DeepSeek Harness (DSH) Agent 用的本地优先记忆系统:启动热记忆注入、可解释冷召回、租约锁保护的事务写入、只读治理与轨迹复盘。纯 Python + Markdown 文件,无数据库、无向量服务、无外部服务依赖。 **重要边界:本仓库只包含「机制」,不包含任何个人数据。** 记忆内容(画像、规则、事件、项目笔记)始终留在使用者自己的 Obsidian Vault 里,通过环境变量指向。 ## 为什么需要它 Agent 会话之间默认是失忆的。本系统用 **六层机制** 把「记忆」变成可工程化的闭环: 1. **启动热记忆** — 每个新会话注入一次 ≤14KB 的热包(门禁 + 指令预算 + 用户画像 + 活跃规则 + 项目摘要 + 近期事件标题) 2. **工作路径** — 按全局/项目 `AGENTS.md` 规则完成任务 3. **冷层召回** — 双门槛触发(历史引用 + 具体主题),exact + 中文 BM25 + 元数据重排,输出 ≤4.2KB 冷包,向量检索默认关闭(依赖零) 4. **授权写入** — 租约锁(30s 租约 / 5s 心跳 / 陈旧锁恢复)+ 多文件事务(before-image / SHA-256 前置 / manifest / receipt),raw 机械只追加,纠错必须 supersedes 5. **慢治理** — `govern.py` 只读扫描重复、冲突、过期、体量、规则生命周期候选,默认不写 6. **轨迹复盘** — 只读扫描会话轨迹,用「用户纠正」作为硬信号产出复盘候选 ## 特性亮点 | 能力 | 说明 | |---|---| | 写入安全 | 单写者租约锁 + 可恢复事务,多文件变更原子化,raw 只追加不覆写 | | 中文召回 | 中文 bigram BM25 + exact/标题/路径匹配 + 元数据重排,全程可解释 trace | | 字节预算 | 热包 14KB / 冷包 4.2KB 硬预算,UTF-8 安全截断 | | 治理只读 | L0-L3 边界,自动收集证据、永不自动删改 | | 零依赖 | Python 标准库 + Markdown 文件,Windows/macOS/Linux 可跑(仅 backfill.py 历史回放需可选的 zstandard) | ## 系统架构(六层闭环)  <details> <summary>展开查看可编辑的 Mermaid 源码图</summary> ```mermaid flowchart TD Start([新会话 / 新任务]) --> Hook[SessionStart Hook<br/>
Read the full READMERepository license: MIT
dsh-memory-system DSH plugin questions
How do I install dsh-memory-system?
Run `dsh plugin add @zhujunpeng12/dsh-memory-system` in your terminal. Alternatively, you can download the tarball and run `dsh plugin add ./zhujunpeng12-dsh-memory-system-0.1.0.tgz`. After installation, restart DSH for the six memory tools to appear in your agent.
Does this plugin require a database or vector service?
No. It uses only Python standard library and Markdown files. Vector search is disabled by default; the recall mechanism relies on exact match and Chinese bigram BM25. All data is stored in your local Obsidian Vault as plain Markdown files.
How do I set up the memory vault?
Create a directory (e.g., `~/Documents/Obsidian Vault`) with the required subfolders: `memory/`, `memory/events/`, `memory/index/`, `memory/projects/`, and `projects/`. Set the `MEMORY_VAULT` environment variable to point to this directory. Copy `.env.example` to adjust defaults. Then run `bootstrap.py` or use the `memory_bootstrap` tool to generate a hot memory package.
Is writing memory automatic?
No. All writes are gated by user confirmation. The `memory_write` tool defaults to dry-run mode; you must set `apply=true` and confirm via the `pre-execute` hook. Raw logs are append-only, and corrections must use `supersedes` to avoid overwriting. This ensures you maintain full control over what gets persisted.
What does the trajectory review feature do?
The `memory_trajectory_review` tool scans session logs for user corrections (hard signals) and tool telemetry (if evidence-ledger plugin is installed). It generates review candidates structured as scenario → error → root cause → prerequisite action. Manual review determines whether to graduate patterns into core rules or discard them.