NattoCB/dsh-plugin-memory
dsh-plugin-memory
dsh-plugin-memory: a persistent 5-layer memory system plugin for DeepSeek Harness (DSH) — index+topics split, truncation budget, relevance injection, idle LLM auto-extraction, and 6 agent tools.
Install
npx @deepseek-ai/dsh plugin --profile web add github:NattoCB/dsh-plugin-memoryRestart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/nattocb-dsh-plugin-memory)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from NattoCB/dsh-plugin-memory, cleaned of badges and images.
@deepseek-ai/dsh-plugin-memory
English | 中文
<b style="font-size: 1.15em;">Persistent five-layer memory for DeepSeek Harness: profile, project context, daily log, and recallable topics — so the agent remembers you across sessions, not just within one.</b><br /><br /> <b>Two cordis seams</b> — <code>agent/pre-step</code> injection + <code>ctx.tools.register</code> (six tools)
A persistent five-layer memory system for DeepSeek Harness (DSH): a user profile (L1), a per-project semantic index with topic files (L2), and append-only per-day logs (L3) under
~/.dsh/memory/and<cwd>/.dsh/memory/. It injects relevant memories into every request and auto-extracts durable facts from finished sessions via the LLM. Integrates as a DSH plugin on two cordis seams —agent/pre-stepfor injection,ctx.tools.registerfor sixmemory_*agent tools. Without anllmroute it still works: entry injection, keyword relevance, and profile rotation remain; only LLM ranking and auto-extraction are disabled.
✨ Features
- 🧠 Five-layer model: L0 user-owned identity (
~/.dsh/AGENTS.md, not managed by the plugin) → L1 profile → L2 project index + topics → L3 per-day append-only log → L4 skills (existing). Each layer has its own write path, truncation budget, and injection rule. - 📇 Index + topic split (L2):
MEMORY.mdis always an index of one-line pointers (≤150 chars each); details live in<topic>.md. Keeps single files small, searchable, and truncatable. - ✂️ Truncation budget: the booted index is hard-clamped to 200 lines / 40,000 chars, so cold-start context stays cheap.
- 🎯 Relevance injection: on each step, the latest user query selects relevant topic files (LLM ranking when
llmis configured, keyword scoring otherwise) and appends them as a<system-reminder data-role="memory">block; files already surfaced in this session are de-duplicated. The two channels are labeledmemory-entry(once per session) andmemory-relevance(per step) in the GUI context rows. - 🤖 LLM auto-extraction: when a session goes idle, a debounced (60 s) best-effort pass scans the recent 40 events, asks the LLM for new topic files and index lines, and writes them. Never overwrites existing memories; degrades silently if the model is unavailable.
- 🔄 Profile rotation (L1):
memory_profilemerges new facts into four fixed sections (工作背景 / 个人背景 / 当前关注 / 近期动态) and rotates the version, keeping the previous copy inprofile.md.bak. - 🔒 Read-back data, not instructions: memory is written with
fs/promisesdirectly to the memory roots — intended persistence, not self-modification — and paths are confined to the store root. Memory files are context the agent reads back, never permission grants. - 🧩 Pure harness plugin: no HTTP API or GUI panel — injection and tools only. DSH serves a single user, so paths carry no
<uid>layer. - 🛠️ Six agent tools registered via
ctx.tools.register(defineToolfrom@deepseek-ai/dsh-tools):
…

