propzhang/dsh-memory-unlocked ↗★ 0

dsh-memory-unlocked

通过触发词或工具检索并注入历史对话记忆 适合需要让AI自动召回和参考历史会话上下文的长期对话任务。

套件
dsh-memory-unlocked
相容性
待驗證
版本
0.1.1
授權
NOASSERTION
最近更新
2026年10月24日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:propzhang/dsh-memory-unlocked

配置

配置写在 profile 里插入插件的那一行:

键默认说明
enabledtrue设成 false 只关自动触发,工具和 /recall 照常可用
triggers三个内置触发词最多 8 个;也接受单数 trigger: "…"
maxInjectChars3000单次注入的字符预算(400–20000)
limit5每次返回几条命中(1–20)
before / after3 / 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.

ParameterTypeRequiredDefaultNotes
querystringno—What to search for, up to 500 characters; omit it to get what compaction removed from the current session
limitintegerno5Maximum 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 limit is 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
ParameterTypeRequiredDefaultNotes
seqintegerno—The position reported by recall_history; omit it to get the compaction-removed part
sessionIdstringnocurrent sessionUsually unnecessary; if given it must fall inside the current workspace
before / afterintegerno3 / 3Events 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:

PhraseMatching
Memory unlockedcase-insensitive
大记忆恢复术literal
DJYHFSliteral

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:

KeyDefaultNotes
enabledtrueSet to false to turn off automatic recall only; the tools and /recall keep working
triggersthe three built-insUp to 8; a single string trigger: "…" is also accepted
maxInjectChars3000Character budget per injection (400–20000)
limit5Hits returned per recall (1–20)
before / after3 / 3Events 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.