Dual-ledger cross-session memory: auto-extracts lasting facts from conversations into MEMORY.md and maintains a PROGRESS.md project ledger, recalling both into every new session.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-memories
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:jisi71/dsh-memories
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
Dual-ledger cross-session memory for DeepSeek Harness.
Inspired by the memory pipeline of OpenAI's open-source Codex agent, dsh-memories gives every new session in a project two living ledgers:
| Ledger | File | Answers |
|---|---|---|
| Long-term facts | .dsh/memories/MEMORY.md |
"What are this project's conventions, the user's preferences, past pitfalls?" |
| Project progress | .dsh/memories/PROGRESS.md |
"Where are we? What's done? What's in progress? What's next?" |
Both are maintained automatically and recalled into the system context of every new conversation — no re-briefing required.
Features
- Automatic extraction — on each new session (throttled to once per 30 minutes), recent sessions from the same workspace (last 14 days, up to 2 per run) are summarized by an LLM into:
- stable facts in four fixed categories: preference / project / environment / lesson
- progress movements: completed / doing / next
- Strict no-op gate — one-off task details, code dumps, and secrets are never recorded; sessions with nothing worth keeping produce nothing.
- LLM consolidation — drafts are merged and rewritten into clean, deduplicated, sectioned ledgers (with automatic
.bakbackups). - Recall injection — ledger contents ride along in the system prompt of every new session (inline when small, with a file pointer when large).
- Decay — consolidation drops stale entries (30 days unconfirmed) unless marked
pinned. - Model tools & slash commands —
remember/update_progresstools let the agent write proactively;/remember,/progress,/memoriesgive humans direct control. - Failure-safe — LLM failures leave no trace in state; affected sessions are retried automatically next round.
Requirements
A DeepSeek Harness deployment that provides the standard host-plane services:
fs · llm · sessionQuery · systemPrompt · tools · commands · sandboxPolicy
(all ship with the default dsh-base bundle; tested on dsh 0.1.0-rc.9)
Install
Option 0 — one line via dsh plugin add (recommended)
dsh plugin --profile web add dsh-memories
The plugin manager reads this repo's bundled `cordis.patch.yml) and wires everything for you. Needs a release that ships the bundle manifest -- the current npm 0.1.2 predates it, so until the next publish, use Option A.
Option A — npm package into your profile
cd ~/.dsh/profiles/web # or whichever profile you run
npm install <git-url-or-tarball> # places dsh-memories into ./node_modules
Then append a row to ~/.dsh/profiles/web/cordis.patch.yml. Reference the entry file by relative path — the proven pattern in pnpm-managed profiles (bare package names in patch rows are not reliably resolved):
- insert:
- id: dsh-memories
name: './node_modules/dsh-memories/lib/index.js'
Alternatively, register it npm-natively: add "dsh-memories": "*" to the profile package.json dependencies, add "dsh-memories" to dsh.profile.bundles, run pnpm install, and skip the patch row entirely.
Option B — copy the folder
Copy this repository folder into ~/.dsh/profiles/web/node_modules/dsh-memories, then add the same patch row as above.
Restart DSH once. Done — the plugin loads at boot and works silently afterwards.
If you previously ran this capability as a dynamic plugin (
cordis_define/mem-*), remove it before restart to avoid duplicate tool registrations.
Usage
You normally do nothing. For direct control:
| Command / Tool | Effect |
|---|---|
/remember <fact> |
Append a fact to the current project's ledger and trigger consolidation |
/memories |
Status: processed count, draft files, ledger previews, last error |
/memories rescan |
Force a fresh extraction pass now |
/memories reset |
Clear the "processed" registry so recent sessions get re-read |
/progress |
Show PROGRESS.md |
/progress <note> |
Append a progress note manually |
model tool remember(fact, category?, pinned?) |
The agent saves a durable fact mid-conversation |
model tool update_progress(completed?, doing?, next?) |
The agent updates the progress ledger at milestones |
Where the data lives
<your-project>/.dsh/memories/
├── MEMORY.md # consolidated long-term facts (4 sections)
├── MEMORY.md.bak # previous version, kept on every rewrite
├── PROGRESS.md # project progress (# 已完成 / ## 进行中 / ## 下一步)
├── PROGRESS.md.bak
└── raw/ # unconsolidated drafts (_manual.md, _progress.md, per-session notes)
Everything is plain Markdown — open it, edit it, diff it.
How it works
new session ──▶ scan (same-workspace sessions, ≤14 days, ≤2/run)
│
▼
extract (one LLM call per session)
├─ facts[] → raw/<session>.md
└─ progress{} → raw/_progress.md
│
▼
consolidate (one LLM call per ledger)
├─ MEMORY.md ← merge + dedupe + decay(30d) + sections
└─ PROGRESS.md ← 已完成 / 进行中 / 下一步 + dates
│
▼
next session ◀── recall section injected into system prompt
The extraction prompt enforces a strict schema (JSON array / NONE), caps entry length, forbids secrets, and skips trivial transcripts (<400 chars). Consolidation prompts enforce section formats and size budgets (≤100 lines for facts, ≤60 for progress).
Limitations & roadmap
- Project-scoped — each workspace keeps its own ledgers. A global user-level ledger (like Codex's
~/.codex/memories) is planned via aglobalDirsetting. - Extraction reads only message text (no tool payloads).
- Progress consolidation is instructed — not guaranteed — to respect the 60-line budget.
- Chinese-oriented prompts today; English variants welcome via PR.
License
MIT
Links
More in this category
vectorize-io/hindsight#coding-agents★ 62704
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★ 42626
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★ 12483
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★ 3829
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★ 2924
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★ 1656
Cross-session memory and context recovery across forty-five other coding agents (45+) on this machine, reading session files they already wrote before install (Claude Code, Codex, Cursor, Windsurf, Trae, Antigravity, VS Code Copilot Chat, opencode, OpenClaw, Hermes, Kimi, Qoder, Cline, Zed, Magpie and more): six tools (deja_recall, deja_session, deja_blame, deja_fix, deja_how, deja_remember), a /deja command, and optional automatic recall injected into runtime context. Local BM25 CLI/MCP 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.