propzhang/dsh-memory-unlocked ↗★ 0
dsh-memory-unlocked
Memory-unlocked(大记忆恢复术)— DeepSeek Harness plugin: recall earlier conversations. Two drill-down tools (recall_history + recall_expand, both carrying seq) plus an automatic `agent/pre-step` hook that fires on any of THREE trigger phrases (Memory unlocked, case-insensitive; 大记忆恢复术; DJYHFS). Every returned historical text is redacted and wrapped in a random-token data boundary, because history is untrusted input. 适合需要让AI自动召回和参考历史会话上下文的长期对话任务。
Install
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:propzhang/dsh-memory-unlockedREADME
Read the full README ↗配置
配置写在 profile 里插入插件的那一行:
| 键 | 默认 | 说明 |
|---|---|---|
enabled | true | 设成 false 只关自动触发,工具和 /recall 照常可用 |
triggers | 三个内置触发词 | 最多 8 个;也接受单数 trigger: "…" |
maxInjectChars | 3000 | 单次注入的字符预算(400–20000) |
limit | 5 | 每次返回几条命中(1–20) |
before / after | 3 / 3 | 展开时前后各取几条(0–50) |
没有范围类配置。 scope、includeSubagents 写进来也不生效——范围是安全边界,不是开关。
Usage
recall_history — search first
Finds matches in the current workspace. Every hit carries a seq you can hand to recall_expand.
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
query | string | no | — | What to search for, up to 500 characters; omit it to get what compaction removed from the current session |
limit | integer | no | 5 | Maximum number of hits, up to 20 |
Ordering depends on the retrieval path, which is reported in the output:
- Index path: follows the host's full-text relevance order (currently more matched query terms, then shorter documents, then newer time), not a global newest-first order. Each session contributes its best match.
- Scan fallback: checks the current session first, then other sessions from newest to oldest by creation time, taking the latest matching event in each. Hits from inspected sessions are returned newest-first, and scanning stops when
limitis met. Uninspected candidates never enter the ranking, so this is neither a workspace-wide relevance ranking nor an exhaustive time ranking.
Snippets are drawn around the query only after the complete event text has been redacted, with a maximum of 240 UTF-16 code units and without splitting surrogate pairs. If the query cannot be located in the sanitized text, the snippet starts at the beginning. An index snippet may have already lost the surrounding context needed to recognize a secret, so the plugin retrieves the complete semantic text by the hit's seq and accepts only an exact sessionId and seq match. If that read fails or cannot start within budget, it keeps the location and explicitly omits the snippet instead of publishing the raw index fragment. You can still try recall_expand; expansion remains subject to redaction and output limits.
recall_expand — get the original text
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
seq | integer | no | — | The position reported by recall_history; omit it to get the compaction-removed part |
sessionId | string | no | current session | Usually unnecessary; if given it must fall inside the current workspace |
before / after | integer | no | 3 / 3 | Events to take before / after, up to 50 each |
/recall — for humans
/recall deploy script
Same as recall_history. With no keyword it returns a usage error instead of pretending to succeed.
Automatic recall
If a message contains any of the following, the plugin recalls automatically for that turn:
| Phrase | Matching |
|---|---|
Memory unlocked | case-insensitive |
大记忆恢复术 | literal |
DJYHFS | literal |
Text after the phrase becomes the keyword, and only the first line / first sentence is used — so pasting a long document by accident won't turn all of it into a query. With no keyword you get the compaction-removed content.
At most one injection per turn. Automatic recall combines the host's cancellation signal with an 8-second wait timer: cancellation or timeout skips injection and stops subsequent reads, with timer and listener cleanup on exit. The timer cannot preempt synchronous computation or forcibly cancel an in-flight filterEvents read. It is therefore not a strict 8-second total-runtime bound or a universal timeout for tool calls.
Configuration
Configure the row that inserts the plugin in the profile:
| Key | Default | Notes |
|---|---|---|
enabled | true | Set to false to turn off automatic recall only; the tools and /recall keep working |
triggers | the three built-ins | Up to 8; a single string trigger: "…" is also accepted |
maxInjectChars | 3000 | Character budget per injection (400–20000) |
limit | 5 | Hits returned per recall (1–20) |
before / after | 3 / 3 | Events taken on each side when expanding (0–50) |
There are no scope options. scope and includeSubagents do nothing here — scope is a safety boundary, not a switch.