Skip to main content

How to use dsh-layered-memory

DSH Cross-Session Long-Term Memory Plugin: hierarchical storage (L0 rules/L1 index/L2 facts/L3 SOP) + action-verified writes + automatic distillation candidates + provenance/archiving/rollback, isolated by namespace.

This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.

This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.

Quick start

dsh-layered-memory

— source: plugin_wiki.wiki_content

Install & verify

dsh plugin --profile web add dsh-layered-memory

Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.

— source: plugins.install

Key points

  • 每个子目录是独立的自包含单元,欢迎以 PR 提交新技能/插件,或提 Issue 反馈问题。
  • 贡献要求:自包含(自带脚本/模板/文档)、许可证清晰(建议 MIT)、不写死密钥与本机绝对路径。
  • 新增技能的入口文档统一为 SKILL.md,DSH 插件另附 cordis.patch.yml 与 package.json。

— source: plugin_wiki.readme_en (fallback readme_raw)

FAQ

Where is memory stored after installation?

By default stored in ~/.dsh/memory/ under the user's home directory (macOS/Linux: ~/.dsh/memory, Windows: %USERPROFILE%.dsh\memory). When autoNamespace is enabled, it automatically creates subdirectories for isolation using the workspace directory name + git branch; to customize, set memoryDir in the profile configuration.

Is evidence required when writing to memory?

Yes. Both memory_write and memory_accept require evidence (action verification axiom), and will be rejected by the tool if not provided. Evidence describes the tool call or actual test result that successfully verified this information; unverified information is not allowed to be written to formal memory.

What if memory_read and other tools don't appear in the tool list after installation?

By default, it uses progressive exposure mechanism (progressive=true). All 12 tools are only attached to the current Agent after calling memory_activate or after the memory skill loads successfully. Skill loading usually activates automatically; if tools still don't appear, just call memory_activate once.

How to roll back modified or archived memories?

Use the memory_rollback tool, passing in topic and entry_type (fact/sop). It will automatically restore from the most recent snapshot in .history/. memory_archive only hides entries from L1 index and memory_read; files are still kept in archive/, and can also be restored via memory_rollback.

Will the written memory be deleted after uninstallation?

No. Memory files are all stored in plain Markdown/JSON format in ~/.dsh/memory/ (or its sub-namespace directory). Uninstalling the plugin only removes the plugin itself; memory files can still be browsed or reused in other DSH instances; to completely clear, manually delete the directory.

What happens when L1 index exceeds 30 rows?

After writing, it will show over_limit=true. Running memory_index only rebuilds the index; running memory_maintain will compress L1 segments by access heat, keeping only active entries. Compressed facts/sops still exist in the file but no longer appear in the L1 index.

What is automatic distillation candidate (pending)?

When autoPending=true (default), each turn/end writes successful tool calls from this round to the pending/ candidate area, and does not automatically enter formal memory. You need to use memory_pending to view candidates, and only after memory_accept with topic/entry_type/evidence will they be written to L2/L3.

— source: plugin_wiki.faq_json

Compatibility

  • DSH: 未声明
  • Node: >=22.19

— source: plugin_wiki.compatibility_json

Pitfalls

Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.

— source: general rule