Memory
memory-system
yunyu422/memory-system · ★ 0
Three-layer persistent memory skill for DeepSeek Harness.
安装
dsh plugin --profile web add github:yunyu422/memory-systemGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
For install and environment setup, plus plugin development tutorials, see DSH community docs ↗
README
Table of contents
Author: yunyu422 · Built for DeepSeek Harness (DSH) and any host that supports
SKILL.mdskills
中文 | English
Bring WorkBuddy-style three-layer memory to DeepSeek Harness: user profile (permanent) → workspace memory (per-project) → auto-learned profile. Agents forget everything between sessions; this skill lets context truly accumulate across sessions and projects.
📡 Cloud sync (M1 shipped): the dsh-memory-sync plugin is available — Git backend + conflict-aware merge + optional E2E encryption, with memory_sync_pull/push folded into the session routines. See the Cloud Sync Backend Design (M2 WebDAV/S3 + encryption → M3 team sharing).
The three layers
| Layer | File | Lifetime | Purpose |
|---|---|---|---|
| L1 User profile | ${DSH_HOME}/memory/USER.md |
Permanent | Work / school / major / goals / active projects / key decisions / communication preferences |
| L2 Workspace memory | <projectRoot>/.memory/logs/YYYY-MM-DD.md + <projectRoot>/.memory/MEMORY.md |
Project lifetime | Daily logs (what was done / conclusions) + long-term project conventions |
| L3 Learned profile | ${DSH_HOME}/memory/PREFERENCES.md |
Auto-accumulating, decays | Long-term preferences auto-learned from interactions, with evidence and confidence |
Install (DSH)
# Copy the skill into the user skill root (applies to all projects)
Copy-Item -Recurse .\skill\memory-system "$env:USERPROFILE\.dsh\skills\memory-system"
You can also copy it into a single project's <projectRoot>/.dsh/skills/ to scope it to that project. DSH hot-refreshes the skill catalog on every request step — no restart needed; the memory-system entry appears in the skill catalog on the next session.
Usage
- Automatic: at session start the agent reads all three layers and applies preferences and conventions; at task end it writes the daily log and settles durable conventions automatically.
- Manual: just say —
- "remember <fact>" / "what did we do today" / "project conventions" / "what are my preferences" / "forget <entry>" / "memory status"
Directory structure
memory-system/
├── SKILL.md # Main instructions: session start/end routines, write triggers, invariants
├── references/ # Per-layer detailed rules (loaded on demand)
│ ├── user-profile.md # L1 structure and maintenance rules
│ ├── workspace-memory.md # L2 formats, rotation, pruning
│ └── learned-preferences.md # L3 evidence/confidence/promotion/decay and optional cloud sync
└── templates/ # Templates for creating new files
├── USER.md
├── MEMORY.md
├── PREFERENCES.md
└── daily-log.md
Design highlights
- Write triggers, not write-every-turn: L1 is written only when the user explicitly states a durable personal fact; L2 is written in the task-end routine; L3 uses the "explicitly stated or ≥2 observations" evidence rule so one-off choices are never misrecorded as long-term preferences.
- Privacy & security built in: no credentials/keys in any memory file; L1 is never rewritten wholesale without confirmation; "forget X" removes specific entries precisely.
- Optional cloud sync: a pure local skill cannot run a real cloud backend, but pointing
${DSH_HOME}/memory/at a private Git repo or a synced folder gives cross-machine "cloud profile" behavior (seereferences/learned-preferences.md). - Path rules match DSH:
DSH_HOMEdefaults to~/.dsh; project root is the nearest.gitancestor, falling back to cwd.
Compatibility
- The skill is a standard
SKILL.md+ frontmatter (name/description/user-invocable: true), matching DSHdsh-skill-filesystemdiscovery (<root>/<name>/SKILL.md, kebab-case names). - Memory files are plain Markdown, directly readable by any toolchain (Claude Code / Codex / Cursor) for easy migration.
License
MIT