@max-null/dsh-memory
Cross-session plaintext memory plugin for the DeepSeek Harness — deterministic BM25 recall, human-owned, no embeddings
AI 分析
适合需要跨会话持久化记忆、通过人工审核控制记忆注入的用户。
インストール
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Max-Null/dsh-memoryドキュメント
README 全文を読む ↗使用流程(人工确认闸门)
提示词模板库(0.6.0):prompt_search / prompt_get / prompt_list / prompt_add 四个工具管理模板库——
md 文件是唯一事实源(~/.dsh/prompt-library/*.md 为 global;/.dsh/prompt-library/ 随工作区分享),
前端(记忆面板「模板」tab / 模型工具)检索同一份索引;模板存在即生效(source: agent 角标标识模型新增),
永不注入 system prompt。
模型 memory_save → status: suggested(只是建议,未生效)
人 memory_confirm → status: approved(已审核;是否常驻注入由独立开关 injected 决定)
人(面板/开关) → injected: true(每轮注入:global + 当前会话工作区,摘要化 + 预算截断)
memory_search → 关键词/语义召回任意状态的记忆(命中标记 lastUsedAt 冷热追踪)
memory_forget → 随时删除
模型永远不能自我提升一条记忆——memory_save 只写 suggested,只有人在明确要求时(memory_confirm)才能让它生效。这保证了记忆不是黑盒:人随时能看、能改、能删。
可选配置
在 cordis.yml 的 config 里传给插件(均可省略):
- id: memory
name: '@max-null/dsh-memory'
config:
injectionBudget: 1500 # 常驻注入预算(字符;null = 不限制)
summaryChars: 80 # 单条注入摘要截断上限(字符)
semanticTopK: 5 # 语义侧参与融合的 topK(仅配置 embeddings 时生效)
# 混合语义检索(可插拔;缺省 = 纯 BM25)
# embeddings: { embed: '...' 提供 embed(texts) 的宿主函数 或 插件名 ... }
embeddings 接受 { embed(texts): Promise, similarity? } 对象——由宿主装配层提供嵌入实现(如 DeepSeek 嵌入端点);配置后 memory_search 以 BM25 + 语义 RRF 融合,向量增量生成并持久化,嵌入调用失败自动降级为纯 BM25。