DDDFXYqiming

Dsh Layered Memory — Development skill for Claude Code

Development community

Cross-session long-term memory plugin for DeepSeek Harness.

How to install Dsh Layered Memory

This entry records only its repository, not the path inside it, so there is no exact command to give. Open DDDFXYqiming/dsh-layered-memory and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Dsh Layered Memory does

Cross-session long-term memory plugin for DeepSeek Harness.

Alternatives in Development

  • IPolloWork — Enterprise-grade, local-first Agent Workbench for people and agent teams 4.9k ★
  • Petdex — A public gallery of animated pets for Codex, Claude Code, DeepSeek Harness, Hermes, OpenCode, Gemini CLI, and 4k ★
  • Harness Improvement — Update Kandev harness files from session learnings or explicit cross-platform harness requests 697 ★

README

简体中文 | [English](README.en.md)

dsh-layered-memory

**DeepSeek Harness(DSH)的跨会话长期记忆插件。** 会话结束后上下文会被清空,这个插件把值得留下的信息写成文件放在磁盘上,之后的会话再按需取回。功能覆盖命名空间隔离、L1 索引注入、L2 环境事实、L3 任务经验、BM25 全文检索、内容级近重复去重、跨命名空间提升、重试序列蒸馏、溯源、归档与回滚、自动维护,以及渐进式工具暴露。

能力

`memory:index` 注入。`ctx.systemPrompt.context` 把 L1 索引实时注入每轮模型上下文,改动即时生效。

runtime skill `memory`。这份 skill 约定了读记忆、写记忆和同步索引的时机,内容内联在 `src/skill-content.js`(runtime skill,无独立 SKILL.md 文件)。

工具共 14 个,progressive 模式下经 `memory_activate` 挂载,也就是 Agent 按需调用一次 `memory_activate`,这批工具才进入它的工具列表。

工具 用途
memory_list 列出全部记忆(L2 facts + L3 sops + pending + 索引行数)
memory_read 读取指定记忆(index / fact 主题 / sop 文件名),返回溯源 meta 与 related 关联指针
memory_search BM25 全文检索(含已归档条目;all_namespaces 跨库),L1 被裁剪的条目也能找回
memory_write 写入记忆(fact/sop,evidence 必填 = 行动验证公理;可选 related 关联链接)
memory_index 重建 L1 索引自动段(保留 [RULES] 手动段)
memory_pending 查看重试序列蒸馏候选(同工具先失败后成功)
memory_accept 接受 pending 候选入正式记忆
memory_update 更新记忆(supersede 保留历史快照;支持 related)
memory_archive 归档记忆(L1 隐藏,文件保留在 archive/,可用 memory_rollback 恢复或 memory_search 检索到)
memory_rollback 回滚到 .history/ 中最近快照
memory_expand 通过 sessionQuery 展开 sourceSession/sourceSeqs 原始事件
memory_stats 统计 L2/L3/pending/archived/大小
memory_maintain 内容级去重、压缩索引、统计、合并候选
memory_promote 跨命名空间提升(项目局部经验 → 全局 default)

安装

# 从 GitHub 安装(推荐,自带 cordis.patch.yml,贡献 id: dsh-layered-memory)
dsh plugin --profile web add github:DDDFXYqiming/dsh-layered-memory

# 本地开发时也可直接使用仓库目录
dsh plugin --profile web add <本目录>

配置

# profile cordis.patch.yml —— 裸条目覆盖 bundle 行(勿重复 insert!)
- id: dsh-layered-memory
  config:
    memoryDir: ''              # 默认 /.dsh/memory
    maxIndexLines: 30
    progressive: true
    defaultNamespace: ''       # 固定默认命名空间;留空则 autoNamespace 生效
    autoNamespace: true        # 默认取 workspace 目录名 + git 分支名
    autoPending: true          # turn/end 捕获「先失败后成功」重试序列为 pen