A self-contained second brain for DeepSeek Harness — auto-captures durable dialogue knowledge into a local Markdown vault (custom dedup, CJK search, git-friendly), with a graphical knowledge base and an interactive knowledge graph (legend filter, time-dimension coloring, box-select, merge, delete, PNG export/import).
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-memory-eternal
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:EternalNight996/dsh-memory-eternal
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
🚨 Important: moved to memory-eternal
This plugin has been upgraded into an agent-agnostic standalone project — no longer tied to a single DSH service. New features and ongoing development live there:
- 📦 npm:
npm i memory-eternal(ordsh plugin --profile web add memory-eternal)- 🐙 GitHub / Gitee:
EternalNight996/memory-eternal
Auto-captures knowledge after every conversation and survives across sessions; recall fetches only the relevant chunks — saves tokens, less noise. Fully self-built, zero third-party memory framework, no DSH source changes, one vault shared by every Agent, plain Markdown & git-manageable.
🚀 Get Started in 5 Minutes
🟦 DeepSeek Harness (DSH) — focus
Install (dsh-desktop via DSH CLI, one command):
# dsh-desktop (recommended): install via DSH CLI into the profile
dsh plugin --profile web add dsh-memory-eternal
# or update directly in the profile (pnpm workspace). Use pnpm — `npm install` throws EUNSUPPORTEDPROTOCOL
cd ~/.dsh/profiles/web && pnpm add dsh-memory-eternal@latest
After restarting dsh web, three things are live immediately:
| Effect | Where |
|---|---|
| Auto-capture of knowledge cards | Happens every turn, no action needed |
memory_recall tool |
Agent calls it automatically when it needs history |
| Visual UI | Sidebar bottom Memory button / Settings → Memory |
Entry: The sidebar-footer Memory button opens the vault (its left rail includes Cards / Graph / Usage / Audit Center / Recycle Bin / Memory Config); "DSH Settings → Memory" is the pure config page.
Edit config: Vault left rail "Memory Config" (or DSH Settings → Memory) → DSH memory config / cost control / auto-audit config / self-hosting — just hit "Save Config". autoWebMode / watchdogAutoSpawn changes require a DSH restart.
🟨 Claude Code
npm i -g dsh-memory-eternal # installs CLI + MCP (auto-writes ~/.claude.json + SessionEnd hook)
Ready after install: say "recall 数据库选型" in a session → auto-retrieves memory; on session end / before context compaction → auto-captures.
🟧 Codex CLI / Cursor
npm i -g dsh-memory-eternal # auto-writes Codex config.toml / Cursor mcp.json
Restart the tool → MCP is in the list; just use: 用 memory_recall 查一下项目历史决策.
🟩 Browser (no Agent needed)
dsh-memory open # starts web + opens browser (default http://127.0.0.1:7999)
Stats / search / card grid (add-edit-merge-import-export) / knowledge graph — all here. Same UI as the DSH embed; data stays in sync.
zcode (Zhipu): no native MCP; bridge via zcode-open-bridge or use the CLI directly.
📖 Command Reference
dsh-memory recall "database selection" # retrieve
dsh-memory capture "important note..." # manual capture (- reads stdin)
dsh-memory sweep ~/.claude/projects # mine existing sessions
dsh-memory setup [--dry-run] # re-run / preview auto-mount (idempotent)
dsh-memory mcp # MCP stdio (mount to any MCP client)
dsh-memory serve [--port 7999] # run web in foreground
dsh-memory open # ensure web alive + open browser
dsh-memory watchdog [--port 7799] # watchdog keep-alive (standalone process)
When not running on DSH, the dsh-memory command comes from npm i -g.
⚙️ Self-hosting (plain words)
Three concepts, don't mix them:
- How the web server stays alive (
autoWebMode) →init=pull once at DSH start (default);interval=DSH in-process timer probes & auto-restarts (0 extra memory);manual=fully manual, only fromdsh-memory open. - Watchdog process (
watchdogAutoSpawn, default on) → a standalone node process that can pull web up even after DSH exits (~+47 MB RAM). Only turn on for 7×24 keep-alive. - Auto-mount MCP (
autoMcpSetup, default off) → whether to auto-write MCP into Claude Code/Codex/Cursor config. Off = don't touch your machine config; rundsh-memory setupmanually when needed.
Change these: Vault left rail "Memory Config" (or DSH Settings → Memory) → edit the table and save; autoWebMode / watchdogAutoSpawn need a DSH restart.
MCP is a protocol, not a resident service: the agent spawns it per session and exits when done — no "auto-start on boot" concept.
Three deployment intensities
| Scenario | Config | Memory |
|---|---|---|
| Personal dev (default) | autoWebMode=init + watchdogAutoSpawn=off |
web 47 MB |
| Resident 7×24 | watchdogAutoSpawn=on |
web + watchdog 47+47 MB |
| True boot auto-start (no DSH) | Windows Task Scheduler runs dsh-memory watchdog --port 7799 --interval 5000 --max-restart 10 |
same |
⚙️ Memory Config (plain words)
All settings live in the vault left rail "Memory Config" (or DSH Settings → Memory) — edit and hit "Save". Here's the full page (plugin info / Agent MCP mount status / auto-audit config):
1. Most used
| Setting | Default | In plain words |
|---|---|---|
| Auto capture | on | auto-store useful content as cards after each turn |
| Auto recall | on | AI auto-queries memory when it needs history |
| Vault dir | ~/.dsh/memory-vault |
where memory lives, plain Markdown & git-able |
2. Save money (important)
| Setting | Default | In plain words |
|---|---|---|
| Distill cards | on | compress a conversation into a sharp card (calls AI, costs money). Off = store raw text, zero cost |
| Dedup feeds AI | on | judge if new content is a duplicate (calls AI). Off = simple dedup, saves one AI call |
| Distill output cap | 900 | max chars per compress, bigger = sharper but pricier |
| Recall min score | 2 | how "close" a match must be to return; bigger = sharper but leaks more (cheaper) |
| Min capture chars | 200 | too-short chats aren't stored (avoids small-talk waste) |
| Daily quota | 60 | max cards per day, prevents AI burning money |
3. How the service runs
| Setting | Default | In plain words |
|---|---|---|
Keep-alive autoWebMode |
init | init=open web once at DSH start; interval=periodically check & restart if dead; manual=fully manual |
Watchdog watchdogAutoSpawn |
on | a standalone process keeps web alive (+47 MB). Personal use can turn off |
Auto-mount MCP autoMcpSetup |
off | lets Claude Code / Codex / Cursor use your memory. On = auto-configures them; Off = never touches your config, run dsh-memory setup manually |
💰 To save money: turn
Distill cardsoff, lowerDistill output cap, raiseRecall min score.
🎯 One-click presets
Top of the config page: 🟢 A Light / 💰 B Budget / ⭐ C Premium — click to fill, then Save:
| Plan | Scenario | Keep-alive | Watchdog | Distill | Distill cap | Recall min | Memory | LLM cost |
|---|---|---|---|---|---|---|---|---|
| 🟢 A Light | Personal dev (default) | init | off | on | 900 | 2 | ~47 MB | normal |
| 💰 B Budget | Tight budget / many Agents | init | off | off | 500 | 3 | ~47 MB | ~0 |
| ⭐ C Premium | Long projects / teams | interval | on | on | 1200 | 1 | ~94 MB | high |
🛡️ Audit Center & Recycle Bin
New cards go to the Audit Center (pending) by default and enter the main vault only after you approve them; rejected ones move to "Rejected", where you can restore or delete to the recycle bin. Cards matching an exemption (audit mode = skip all / exempt agents / exempt kinds) go straight in; recycle-bin cards are recoverable within 30 days, then auto-purged.
- Pending / Rejected tabs, filtered by type / date / agent; select all and approve / reject / delete-to-recycle in one click.
- Rules in "Memory Config → Auto-audit config":
audit mode(audit all / skip all) +exempt agents+exempt kinds+recycle retention days.
🥇 Why the audit system is more reliable (vs other memory products)
Most memory products (mem0 / Zep / agentmemory…) auto-ingest everything the moment a conversation ends, good or bad — noise, wrong facts, and sensitive content all go in and get recalled later, polluting context and amplifying hallucinations.
dsh-memory-eternal uses human-in-the-loop auditing — only trusted content enters the main vault:
| Dimension | Other memory products | dsh-memory-eternal audit system |
|---|---|---|
| Ingest | Auto-ingest all, no gate | New cards first enter the Audit Center (pending), approved before entering the vault |
| Quality | No filtering of noise/errors | Only cards you've confirmed → more accurate recall, less noise |
| Traceability | No source/audit trail | Every card carries submittedBy author + pending/approved/rejected state |
| No-friction | — | Exempt agents / exempt kinds hit → trusted cards go straight in, zero wait |
| Safety | Delete = gone forever | Recycle-bin soft delete, recoverable within 30 days |
🧬 Why Fully Self-built
Most memory solutions lean on third-party frameworks / spin up an MCP service / lock memory in a private store. This plugin builds the skeleton itself — zero third-party runtime deps, logic readable line by line:
| Module | Self-built | Replaces |
|---|---|---|
| Dedup | lexical Jaccard bigram (0.62) + semantic dedup | duplicate-card prevention |
| Retrieval | CJK-aware: Chinese whole-word + char bigram | no full-text search engine needed |
| Graph | force-directed + [[wikilink]]/shared-tag edges |
see knowledge links at a glance |
| Storage | plain .md with frontmatter |
not locked in, readable, git-able, any tool can read |
Same direction as popular projects (summarize→store→recall), but positioned differently: local, self-built, zero-dep, readable & controllable. If you already use mem0/Zep etc., just layer this as a "local persistent memory base".
🛠 Development / Test
npm i
npm test # unit tests: vault dedup/retrieval/graph + capture pipeline + API shapes
npm run build # builds lib/client.js (DSH embed) + web/app.js (standalone web bundle)
📄 License
MIT
Make your AI truly remember: dialogue auto-captured, knowledge at your fingertips. ⭐ Star it if you like, Let's make AI not forget.
中文 README: README.md
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.