DDDFXYqiming/dsh-layered-memory

DeepSeek Harness 的跨会话长期记忆插件

Project Overview项目介绍

This is a native long-term memory plugin built exclusively for DeepSeek Harness (DSH). It addresses the core limitation of default DSH that all session context is cleared once a conversation ends. By persisting valuable information from completed sessions to local disk files, it allows the agent to retrieve relevant memory on demand in future conversations. To install the plugin directly from GitHub, you can run the command dsh plugin --profile web add github:DDDFXYqiming/dsh-layered-memory in your DSH command line interface. Local development can also be done by adding the local repository directory directly.

The plugin offers 14 different tools that are progressively mounted only after the agent calls the memory_activate tool. It injects the L1 index into the system prompt of every model turn in real time, so any changes to the index take effect immediately. Core functions include namespace isolation, layered memory management, BM25 full-text search, near-duplicate content deduplication, memory rollback, automatic maintenance, and cross-namespace experience promotion. Users can perform read, write, update, archive, search, and statistics operations on all stored memory entries via the provided tools.

The plugin is released under the open-source MIT license, and stores all memory data in the ~/.dsh/memory directory by default. Users can customize multiple configuration parameters including memory storage directory, maximum character count for L1 index, automatic namespace behavior, and automatic maintenance frequency. The plugin follows core design axioms: only store information that has been verified by actions, never physically delete verified content, and do not store volatile temporary state. For local development and testing, you can run pnpm install, pnpm build and pnpm test to complete the build and unit tests.

这是专为 DeepSeek Harness(DSH)打造的分层长期记忆原生插件,用于解决DSH默认会话结束后上下文被清空的问题。它会将会话中值得留存的信息写入本地磁盘文件,供后续会话按需调用读取。核心功能涵盖命名空间隔离、分层记忆存储、BM25全文检索、内容级近重复去重、溯源归档回滚、自动维护以及渐进式工具暴露。

插件一共提供14个工具,在渐进式模式下需要由Agent调用memory_activate后才会挂载进工具列表。它支持将L1索引实时注入每轮模型上下文,修改能够即时生效。用户可通过工具完成记忆的列出、读取、检索、写入、更新、归档、回滚、统计与维护,还支持经验跨命名空间提升。

安装可直接通过DSH命令行执行dsh plugin --profile web add github:DDDFXYqiming/dsh-layered-memory完成。插件以MIT协议开源,默认将记忆存储在用户目录下的.dsh/memory路径,支持自定义配置记忆目录、L1字符预算、自动命名空间等多项参数。它遵循只存已验证信息、不物理删除已验证内容等核心设计公理。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:DDDFXYqiming/dsh-layered-memory

把 DDDFXYqiming/dsh-layered-memory 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

简体中文 | English

dsh-layered-memory

Cross-session memory for DeepSeek Harness (DSH).

A DSH session loses its context the moment it ends. Come back to the same project tomorrow and you explain the environment again, and rediscover how you worked around that error last time. This plugin writes that kind of information to files on disk and pulls it back when a later session needs it.

Memory has three layers: an index, environment facts, and task experience. The L1 / L2 / L3 labels in the tool list below refer to those three.

What it looks like in use

Once installed, you just tell the agent.

The build command for this project is ```pnpm build && pnpm test~~, and the tests take about forty seconds. Remember that.

It writes the line into the memory store. Open a fresh session the next day and say "run the tests for me", and the command is already known.

It works the other way too. If you forget the flags a service needs, ask the agent to look them up in memory instead of scrolling back through old chats.

Install

dsh plugin --profile web add github:DDDFXYqiming/dsh-layered-memory

The plugin creates its directories and template files under <home>/.dsh/memory.

Usage

The agent decides when to read and write memory. The plugin registers one memory skill and 14 tools. Under progressive mode those tools stay hidden until the agent calls memory_activate once.

Tool Purpose
memory_list List all memory (L2 facts + L3 sops + pending + L1 chars/budget)
memory_read Read one entry (index / fact topic / sop filename) with provenance meta and related links; oversized entries return an outline plus head/tail excerpts, with full and from_line/to_line for the rest
memory_search BM25 full-text search over facts, sops and archived entries
memory_write Write a memory (fact/sop, evidence required, name collision snapshots the old version; evidence is quoted line by line and suspected secrets in it are redacted; plain-text secrets in the body are refused)
memory_index Rebuild the L1 index auto-segment, keeping the [RULES] manual segment
memory_pending List distilled candidates (fail-then-retry sequences)
memory_accept Promote a pending candidate into a real entry
memory_update Update an entry, keeping a history snapshot (body and provenance meta snapshotted together); new measurements can pass sourceSession/sourceSeqs, wording-only edits inherit the original source
memory_archive Archive an entry (hidden from L1 and memory_read, file stays in place, still searchable, current version snapshotted first); unarchive: true restores visibility
memory_rollback Roll back to the most recent .history/ snapshot (body and provenance meta restored together)
memory_expand Expand the original events behind sourceSession / sourceSeqs
memory_stats Counts for L2 / L3 / pending / archived and total size
memory_maintain Merge same-name duplicate sections, exact/near-duplicate candidates, index audit, stats, merge candidates, cold-entry review
memory_promote Promote project-local experience to the global namespace

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-plugin-install 下一个 Next EmotionPet →