liangxiaobing520/dsh-local-vector-memory

Plugin插件 Native原生 ⭐ 3 MIT Memory & Knowledge记忆与知识库

Fully local vector memory plugin for DeepSeek Harness: local embeddings, SQLite storage, automatic recall injection, dedup with conflict detection, soft-delete recycle bin, online backup.

Project Overview项目介绍

This is a local-first vector memory plugin built natively for DeepSeek Harness (DSH). It stores all vector memory data in a local single-file SQLite database and runs all embedding processes on local infrastructure to keep user memory data fully private. Before every DSH agent inference step, it automatically retrieves the top-K most relevant memories and injects them into the conversation context wrapped in a <local-memory> tag. It supports three methods of adding new memories: manual addition via the memory_add tool, automatic capture when user messages have trigger keywords, and automatic extraction at the end of a full conversation.

It comes with built-in memory conflict detection to prevent duplicate and contradictory entries. When new memory has a similarity score of 0.86 or higher with an existing entry but is not an exact duplicate, the plugin prompts the user to update the existing entry via memory_update instead of adding a new duplicate. It also implements a soft delete system for forgotten memories: deleted entries go to a recycle bin that can be restored via memory_restore, and only the purge=true flag triggers permanent deletion. It also creates automatic online backups of the SQLite database, retaining the 5 most recent snapshots by default.

Installation is straightforward via the DSH CLI: run the command dsh plugin --profile web add dsh-local-vector-memory and restart DSH Web to activate the plugin. To run the plugin, you need Node.js 22.5 or newer, because it relies on the built-in native node:sqlite module added in that version. You also need to run a local OpenAI-compatible embedding service, which the project recommends to be Qwen3-Embedding-0.6B hosted via llama-server. DeepSeek cloud API with deepseek-v4-pro is optional for automatic extraction, v0.3.4+ adds low-value filtering, and the project is open under the MIT license.

这是一款专为DeepSeek Harness(DSH)打造的原生本地向量记忆插件,采用本地Embedding向量化加SQLite单文件存储方案,会在Agent每次推理前自动检索并注入相关Top-K记忆,还可在会话结束后调用DeepSeek云端的deepseek-v4-pro自动从整段对话提取记忆。它支持三种记忆写入途径:手动添加、命中记忆关键词时自动捕获、会话结束自动提取。

该插件具备防矛盾记忆检测能力:当新记忆与已有记忆相似度≥0.86但未达到完全重复时,会提示用户调用memory_update更新旧记忆,而非新增重复条目。它默认对memory_forget操作做软删除,被删除的记忆会进入回收站,可通过memory_restore恢复,仅当指定purge=true参数时才会永久删除。插件还支持在线备份,默认保留最近5份备份,若嵌入服务不可用则自动退化为关键词匹配。

你可以通过DSH命令行工具一键安装:执行dsh plugin --profile web add dsh-local-vector-memory,重启DSH Web即可生效。运行依赖Node.js≥22.5,需要搭配一个兼容OpenAPI格式的本地嵌入服务,推荐使用Qwen3-Embedding-0.6B加llama-server,DeepSeek云端API用于提取记忆,属于可选配置。从v0.3.4版本起新增低价值内容过滤功能,项目采用MIT许可证开源。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-local-vector-memory

把 liangxiaobing520/dsh-local-vector-memory 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-local-vector-memory

本地向量记忆插件 for DeepSeek Harness(DSH)。本地 embedding 向量化 + SQLite 单文件存储,对话自动召回注入;会话结束由 DeepSeek 云端 deepseek-v4-pro 自动提取。

A local-first vector memory plugin for DeepSeek Harness: local embeddings, SQLite storage, automatic recall injection, and DeepSeek cloud v4-pro extraction at session flush.

特性

  • 写入三条路:手动 memory_add;用户消息命中记忆线索(记住/以后/偏好/约定/不要…)时毫秒级自动捕获;DeepSeek 云端 deepseek-v4-pro 在会话结束时从整段对话提取记忆(autoExtract,默认开)
  • 防矛盾记忆:写入时检测与已有记忆的冲突/过时(相似度 ≥0.86 但未达完全重复),提示改用 memory_update 更新旧记忆而不是新增重复条目
  • 回收站:memory_forget 默认软删除,memory_restore 可恢复;purge=true 才永久删除
  • 在线备份:memory_backup 用 SQLite VACUUM INTO 生成一致性快照(安全于手工复制 WAL 库),默认保留 5 份
  • 自动召回:每次 agent 推理前检索 top-K 相关记忆注入上下文(<local-memory> 标签),会话内 LRU 去重
  • 批量向量化:提取/重建索引一次 HTTP 批量请求,失败自动逐条回退
  • 关键词兜底:embedding 服务不可用时退化为中英文关键词匹配,写入照常
  • 本地存储:向量库是单个 SQLite 文件(node:sqlite,Node ≥22.5);embedding 全本地,提取走 DeepSeek 云端

需求

  • DSH(DeepSeek Harness),web profile
  • Node.js ≥ 22.5(内置 node:sqlite)
  • OpenAI 兼容的本地 embedding 服务(见下文,推荐 Qwen3-Embedding-0.6B + llama-server)
  • DeepSeek 官方云端 API(deepseek-v4-pro)用于提取(可选;默认走线索自动捕获)
  • ⚠️ 不要把 API key 写进任何会被提交的文件。key 只放在本机,支持三种写法:
    extractionApiKey: "${DEEPSEEK_API_KEY}"        # 1. 环境变量
    extractionApiKey: "dsh:DEEPSEEK_API_KEY"       # 2. DSH 凭据库(~/.dsh/.credentials.yaml)
    extractionApiKey: "local-no-auth"              # 3. 明文占位(仅限免认证的本地服务)
    
    仓库内的 cordis.patch.yml 只是 bundle 挂载声明,不含任何凭据;profiles/<profile>/cordis.patch.yml 用于覆盖配置,请勿在其中写明文 key(会留在磁盘上,也可能被 UI 回显)。

安装

dsh plugin --profile web add dsh-local-vector-memory

插件声明 dsh.bundle.patch,安装后 dsh.profile.bundles 自动追加,无需手改 package.json。重启 DSH Web 生效。

工具(12 个)

工具 作用
memory_add 写入一条长期记忆(用户说"记住…"时;自动去重 + 冲突检测)
memory_search 向量检索(embedding 挂了自动关键词兜底;支持 tag 过滤)
memory_list 浏览记忆,支持 tag/source 过滤;includeDeleted=true 看回收站
memory_update 按 id 更新文本/标签(自动重向量化),纠正过时/冲突记忆
memory_forget 按 id 删除,默认软删除(可恢复);purge=true 永久删除
memory_restore 恢复被软删除的记忆(回收站)
memory_backup SQLite 在线备份到 ~/.dsh/backups/memory,自动保留最近 5 份
memory_stats 库状态 + 软删除数 + 服务地址
memory_reindex 给未向量化条目补向量(批量)
memory_extract 调用提取模型从一段文本提炼记忆入库(仅短文本,建议 ≤2000 字)
memory_merge 合并重复/同主题记忆:保留一条,其余软删除并标记"已被取代"
memory_health 健康报告:条数/软删/未向量化/置顶分布 + 重复对检测与合并建议

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-boot-guard 下一个 Next dsh-whale-pet →