Tiered persistent memory (user/env/project) with per-tier char budgets and semantic query routing; full layers refuse writes instead of silently evicting.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:leetom314/dsh-tiered-memory
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.
分层记忆 + 预算管理(Tiered memory with per-tier budgets)。 移植 Hermes Agent 的记忆纪律:dsh 生态约 65 个记忆插件全是单层存储,本插件是 分层 + 预算概念的首个实现。
What it does
三个 tier(user / env / project)+ 每层 char 预算:
- mem_set — 写稳定事实到层(tier + key + content)。同 key upsert。层满拒绝写。
- mem_get — 按 key 精确读。
- mem_query — 语义查询:自动路由到对应层(用户特征词→user,环境词→env,项目词→project),只在档案真有时返回。
- tier_summary — 各层用量 + 驱逐候选(冷/旧条目)。
- mem_delete — 显式删除(淘汰权交模型,不自动删)。
Hermes 纪律的移植点
| Hermes | 本插件 |
|---|---|
| 四层记忆(user/memory/wiki/skills) | 三层 tier(user/env/project),每层预算 |
| 满层拒绝 → 替换/合并 | add 返回 tier full — delete or merge first |
| 只写稳定事实(不写过程) | content 声明式事实,单条 cap(默认 400) |
| 查询时机:只在真有用时查 | mem_query 无命中返回 [],不编造 |
| 淘汰:满了替换/合并 | tier_summary 列候选,mem_delete 显式删 |
验证
单测 node --test(tiers.js 行覆盖 98.5%);真实 headless e2e:
- 三层写入 + 跨层查询路由正确(user→user / env→env,未跨层)
- 预算拒绝闭环:第二写被拒 → tier_summary 看候选 → mem_delete 冷条目 → 重写成功
安装/开发
# from GitHub (requires dsh CLI)
dsh plugin --profile web add "github:leetom314/dsh-tiered-memory#main"
# or clone and verify locally first
git clone https://github.com/leetom314/dsh-tiered-memory.git
cd dsh-tiered-memory && ./setup.sh && npm test && ./verify.sh # e2e 隔离 DSH_HOME,不碰真实记忆
verify.sh 动态生成临时 overlay($HERE/index.js 路径),不需要仓库内 overlay 文件——overlay*.yml 已 gitignore(含本机绝对路径,不随版本库分发)。
Links
More in this category
vectorize-io/hindsight#coding-agents★ 54464
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★ 40976
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★ 12136
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★ 3702
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★ 2802
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★ 1321
Reads the session files forty-two other coding agents on this machine already wrote (Claude Code, Codex, Cursor, VS Code Copilot Chat, opencode, OpenClaw, Hermes, Kimi, Cline, Zed and more), including sessions from before it was installed: six tools (deja_recall, deja_session, deja_blame, deja_fix, deja_how, deja_remember), a /deja command, and optional automatic recall added to the runtime context. Local BM25 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.