Human-readable Markdown memory for DeepSeek Harness: user-level (~/.deepseek-harness/MEMORY.md) + workspace-level memory injected every turn, auto daily-log writing with distillation, bridges existing WorkBuddy/CodeBuddy memory dirs, memory_note / memory_note_user / memory_read tools with built-in dedup, and a bilingual settings page. Plain-text storage, no database.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-memory-palace
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:lovezi0/dsh-memory-palace
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
This plugin publishes its README in Chinese only.
把 WorkBuddy 的文件式记忆系统移植进 DeepSeek Harness —— 为 Harness 提供跨会话持久化、人类可直接编辑的 Markdown 记忆。
特性
- 人类可读的真源:记忆以纯 Markdown 存储,任何编辑器都能直接修改,数据始终属于你。
- 双层记忆:用户级(跨项目个人偏好)+ 工作区级(项目约定),互不干扰。
- WorkBuddy / CodeBuddy 桥接:项目已有对应记忆目录时直接读写,无需重复维护。
- 记忆工具:AI 可主动写入、聚合读取、按内容删除(删除需人工确认),写入自带去重。
- 会话命令重整记忆:手打
/memory_reorganize(中文可打/记忆重整)触发项目记忆全量重整(沿用「超出注入预算 且 过冷却期」双门禁 + 原生确认,原文件自动整档备份); - 设置页集成:全部配置均可在 DSH 设置面板中图形化调整(按板块折叠),无需改配置文件。
- 自定义指令:不适合写进记忆的特殊指令写在 profile 的
.memory-palace/user-commands.md(设置页也能编辑),插件经系统提示词注入。 - 记忆注入:长期记忆与今日日志以「会话起始快照」常驻上下文、按文件身份各只注入一次 —— 既保证每个步骤都可见,又不破坏前缀缓存、不堆积冗余快照。
- 记忆写入:记忆子代理每轮自动整理今日日志并去重(章节化、标删),长期记忆
MEMORY.md由主 AI 主动维护,兼顾自动化与可控性。 - 标准插件包:经官方插件机制一键安装,无需改动 harness。
记忆文件布局
~/.deepseek-harness/
└── MEMORY.md # 用户级记忆(跨项目个人偏好)
<项目根>/
├── .workbuddy/memory/ # 桥接 WorkBuddy 记忆(存在时优先写入)
│ ├── MEMORY.md # 项目级约定(buddy 目录保持嵌套,兼容 WB/CB 原生格式)
│ └── 2026-08-16.md # 每日工作日志
├── .codebuddy/memory/ # 桥接 CodeBuddy 记忆(存在时,结构同 .workbuddy)
└── .deepseek-harness/ # dsh 原生目录(读取恒在首位;无 buddy 时作为写入目标创建)
├── MEMORY.md # 项目级约定(长期记忆,与 memory/ 同级)
└── memory/
└── 2026-08-16.md # 每日工作日志
自定义指令不放在记忆目录里,而是 profile 私有文件:
$DSH_HOME/profiles/<profile>/.memory-palace/user-commands.md(与排障日志同根)。它是个人偏好而非项目事实,跟着 profile 走、可被编辑器直接修改。
工作原理
读取(每轮对话)——两条通道并行:
① 系统提示词(恒定):记忆分工指令 / 自定义指令等固定内容,前缀缓存友好
② 对话历史投影(易变):用户级 + 项目级长期记忆、今日日志——按文件身份各注入一次,压缩后自动重注最新版
写入(每轮结束)——交给记忆子代理异步处理:
本轮结束 ──► 前置闸门:enabled / 计划模式 / 静默预设 / 有可用记忆目录 → 否则跳过
│
├─► 记忆子代理把本轮实质内容写成章节化条目 → 今日日志(重复/过时条目标删)
└─► 长期记忆由主 AI 按分工指令主动维护(memory_write / memory_update_section)
日志文件头统一为日期标题,写入时自动补齐(历史文件不回填)。日志由子代理维护、永不过期不删(作为可追溯的证据层)。
工具——AI 在对话中按需调用:
| 工具 | 层级 | 作用 |
|---|---|---|
memory_note |
项目级 | 章节化写入当前项目全部目标 MEMORY.md(同 memory_write 格式;section 可选,默认「项目约定」;同章节去重) |
memory_note_user |
用户级 | 章节化写入 ~/.deepseek-harness/MEMORY.md(与项目级同构;section 可选,默认「用户偏好」;同章节去重) |
memory_read |
按需 | 读取记忆。scope 默认 memory(用户级 + 项目级);可选 project(仅项目级,与 memory_write 的写侧 scope 同名)/ today / yesterday / daily(近三天日志)/ all(长期记忆 + 日志) |
memory_delete |
用户级/项目级/每日级 | 按内容删除记忆条目(两阶段确认:先预览匹配位置与内容,用户确认后再删;删除动作经 harness 原生确认弹窗硬闸门,真人点允许才真正执行) |
memory_write |
项目级/用户级 | 章节化写入:章节存在则末尾追加,不存在则新建章节(章节化格式规范) |
memory_update_section |
项目级/用户级 | 整章节精确替换/单条标记删除:oldText 归一化精确匹配防 stale,失败拒绝并回显实际内容 |
memory_reorganize |
仅项目级 | 全量重整 MEMORY.md:双门禁(超出注入预算 且 距上次重整 ≥ 冷却天数)机器校验,原子替换 + 时间戳注释,用户确认弹窗 |
安装
CLI 版(web profile)
方式一:直接通过 GitHub 安装(推荐,lib/ 构建产物已随仓库分发,装即用)
dsh plugin --profile web add github:lovezi0/dsh-memory-palace
# 锁定版本:dsh plugin --profile web add github:lovezi0/dsh-memory-palace#v1.8.5
方式二:clone 后本地安装(开发 / 修改源码场景)
git clone https://github.com/lovezi0/dsh-memory-palace.git
cd dsh-memory-palace
npm install
npm run build # src/ → lib/(服务端递归复制 + 客户端零依赖拼接,无外部构建依赖)
dsh plugin --profile web add . # 装入 web profile(profile 名按你的实际配置调整)
方式三:通过 npm 安装(已发布到 npm registry,可走镜像加速)
# 直接由 dsh 从 npm 拉取并装入(本机若已配镜像会自动走镜像)
dsh plugin --profile web add dsh-memory-palace
# 或先手动用 npm 安装(显式指定镜像),再装入:
npm install dsh-memory-palace --registry=https://registry.npmmirror.com/
dsh plugin --profile web add dsh-memory-palace
CLI 版卸载
dsh plugin --profile web remove dsh-memory-palace
Desktop 版
- npm:
dsh-memory-palace
配置
面板路径为 DSH 设置 →「记忆」 所有配置项(核心 / 自定义指令 / 记忆写入 / 存储路径与预算 / 开发 五张卡片的字段、默认值与说明)已整理至 CONFIG.md
开发
架构 / 构建 / 技术要点 / 蒸馏失败重试 见 DEVELOPMENT.md。
提示词与重整命令(分工指令 / 子代理 prompt / REORG_COMMAND_PROMPT) 见 PROMPTS.md。
版本历史
- 1.8.5
- 🐛修复深色主题下插件设置保存按钮不可见的问题 @dw1161
- 1.8.4
- npm publish v1.8.4
- 1.8.4-alpha.2
- 🐛用户自定义指令前缀多行指令粘连修复
- 💥移除插件用户记忆过时工具
- 1.8.4-alpha.1
- 💥用户自定义指令落盘位置迁移
- 💪memory_reorganize 指令支持中文
- 🐛memory_reorganize 指令无效问题修复
- 1.8.3
- 1.8.3-alpha.2
- 💪超预算回显附重整门禁指引,避免 agent 多轮精简替换凑数
- 1.8.3-alpha.1
- 💪调整内置system prompt
- 1.8.3-alpha.2
- 1.8.2
- 💪内置prompt剪枝优化
- 1.8.1
- 更改插件兼容性定义为 engines.dsh
- npm publish v1.8.1
- 1.8.1-alpha.4
- 💪跟随官方移除 webRuntime 更改为 webStartup
- 💪适配deepseek harness 0.2.1-alpha.1
- 1.8.1-alpha.3
- 💥移除「蒸馏项目记忆」手动功能
- 💥移除 session header 记忆按钮
- 🔥增加会话命令 memory_reorganize 全量重整项目记忆
- 💪优化 memory_write 工具 prompt
- 🐛修复 memory_reorganize 工具读取历史工作日志的问题
- 1.8.1-alpha.1
- 💥移除「蒸馏会话」手动功能
- 💥配置项 summaryMaxTokens / feedbackEnabled 删除,旧值静默失效
- 💪优化 session header 记忆按钮样式
- 1.8.0
- dsh peer [0.1.7 ... 0.2.0]
- npm publish
- 1.8.0-alpha.4
- 💥移除 stderr log 输出
- 💪新增不同 profiles 场景下 log文件 详情见 DEVELOPMENT.md
- 1.8.0-alpha.2
- 🐛修复多会话并发导致写侧串台 @sunligh91
- 🐛删除会话分桶后遗留的三个全局状态死字段
- 🐛修复plan 模式禁写记忆串台导致其他会话也禁写记忆
- 1.8.0-alpha.1
- 💥移除插件模式与智能模式,记忆写入统一为混合模式
- 💥配置项 memoryMode / autoCaptureErrors / dailyLogRetentionDays 删除(旧值静默失效)
- 💥移除记忆写入总开关
- 🐛memory文件格式错误时读取漂移的问题
- 💪适配deepseek harness 0.1.7-rc.2
- 💪适配deepseek harness desktop
- v1.7.2-legacy — dsh-memory-palace 从 v1.0.0 的基础记忆读写(防闲聊闸门、公民指令、删除工具)起步,逐步演进到 v1.7.2 的「混合模式 + 独立通道注入 + 自定义指令 + 记忆子 agent 蒸馏」,全程主线是不断增强记忆生成/注入方式,同时持续修复模式互串、工具串台、缓存堆积等稳定性缺陷。历史,见 CHANGELOG.md
- outdated(0.x) — 双层 Markdown 记忆读写 / 设置页集成等 0.x 历史,见 CHANGELOG.md
参考与致谢
本插件开发深度参考了以下两个开源项目(本包实现为各自机制的简化落地,不含其完整功能):
License
Links
More in this category
vectorize-io/hindsight#coding-agents★ 60916
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★ 42209
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★ 12392
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★ 3799
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★ 2873
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★ 1544
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.