DSH Hub

NattoCB/dsh-plugin-memory

dsh-plugin-memory

BundleMemory0 GitHub stars· updated 2026-08-21

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-memory

Restart `dsh web` after install. Bundle APIs can change during the developer preview.

README badge

dsh-plugin-memory DSH Hub badge
[![DSH Hub](https://dshhub.dev/badge/nattocb-dsh-plugin-memory.svg)](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-step for injection, ctx.tools.register for six memory_* agent tools. Without an llm route 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.md is 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 llm is 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 labeled memory-entry (once per session) and memory-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_profile merges new facts into four fixed sections (工作背景 / 个人背景 / 当前关注 / 近期动态) and rotates the version, keeping the previous copy in profile.md.bak.
  • 🔒 Read-back data, not instructions: memory is written with fs/promises directly 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 (defineTool from @deepseek-ai/dsh-tools):

Related plugins