Scoped persistent memory for DSH: memory_save/search/replace/remove/list across global, user, project and failure scopes, DSH storage-domain persistence with secret and prompt-injection scanning, session-scope search, retention cleanup, and optional session-start injection; standing context via memory_pin/memory_pins/memory_unpin.
Install
# from npm (prebuilt)
dsh plugin --profile web add @lcthe/dsh-hermes-memory
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:lcthe/dsh-hermes-memory
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
DSH-native persistent memory, session-aware retrieval, and safe learning for DeepSeek Harness.
Status
V5 background review, V6 standing context, and the V7 consolidation foundation are implemented locally. Standing profiles and instructions are explicitly saved, bounded, persisted in the DSH storage domain, and injected once at the start of each new session. V7 now has crash-safe plan state, replacement-before-retirement execution, structured model scheduling, and native settings. V8 now has storage-backed skills and a DSH-native provider; explicit skill tools and automatic learning remain in progress.
Product boundary
This is a new DSH plugin. It does not copy Pi runtime code, Pi commands, Pi TUI, Pi branding, Pi logos, Pi screenshots, or other Pi visual assets. It reuses only general engineering ideas such as scoped memories, provenance, full-text retrieval, correction tracking, and secret scanning.
V1 scope
- Explicit
memory_save,memory_search,memory_replace, andmemory_removetools. - Global, user, project, and failure memory scopes.
- DSH
storage-domainpersistence with schema validation. - Pre-write secret and prompt-injection scanning.
- Settings namespace and a small settings card for enablement, retrieval limits, capture policy, and retention.
- Source provenance containing session ID and event sequence when a memory comes from a DSH session.
session_memory_searchpowered by DSH's nativesessionQueryservice.- Optional V3 session-start injection of bounded reference context, off by default.
V3 scope
- Opt-in
agent/session-startinjection of one boundedform: 'recall'context message per agent lifecycle. - Authorized global, user, and current project memories only; failure memories are not injected automatically.
- Deterministic scope/date/ID ordering, entry limits, total character limits, resume de-duplication, and fail-soft startup behavior.
V3.1 scope
memory_listlists bounded records by scope/category and the current workspace.memory_statsreports counts and character usage per scope.lastReferencedAtadvances on search hits and successful startup injection, off-path and fail-soft.- List/stats and reference tracking never bypass the existing exact-match workspace authorization.
V4 scope (first slice)
- Rule-based captures from real
user/messageevents: corrections, project conventions, and preferences. - Captured records carry
source: 'session'provenance with session ID and event sequence. - Idempotency via existing provenance fields and content deduplication; no new storage tables or domain version bump.
- Per-session capture cap, category switches, and safety scanning before every write; default off.
V4.1 scope
- Per-session tracking of
lastToolCall/lastFailureand the previous user-message sequence. - Corrections paired with a failed tool call in the same exchange also save a
failure/tool-quirkrecord naming the tool. - A failure context is consumed at most once;
captureToolContextlets users disable pairing.
V4.2 scope
- Expired memory cleanup using
lastReferencedAt ?? updatedAtas the aging anchor. - Failure-scope records expire after
failureRetentionDays; all others afterretentionDays. - Hard delete with count-only logging; invalid timestamps are kept;
retentionEnabledcan disable cleanup. - Sweeps run at startup and are throttled to once per hour per process on session starts.
Deferred scope
- Automatic prompt injection on every step.
- Vector or embedding retrieval.
- Custom session database access.
- Replacement of DSH chat UI or session shell.
- A separate memory management UI is not planned: ordinary memories use the existing memory tools, while standing context is managed with
memory_pin,memory_pins, andmemory_unpin.
Development
The V5 background review implementation and its safety constraints are documented here:
docs/superpowers/specs/2026-08-27-dsh-hermes-memory-v5-background-review-design.mddocs/superpowers/plans/2026-08-27-dsh-hermes-memory-v5-background-review.md
The implementation plan for earlier versions lives at:
docs/superpowers/specs/2026-08-27-dsh-hermes-memory-v3-session-start-injection-design.mddocs/superpowers/plans/2026-08-27-dsh-hermes-memory-v3-session-start-injection.md
The approved design is documented at:
docs/superpowers/specs/2026-08-26-dsh-hermes-memory-design.md
License
MIT. The implementation will contain original DSH-specific code and will not vendor Pi project assets.
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.