IAMLieutenant/dsh-tool-user-memory

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

DeepSeek Harness 用户记忆插件

Project Overview项目介绍

This is a natively built plugin for DeepSeek Harness that adds persistent cross-session user memory capability to DSH agents. By default, every new DSH session starts with a blank slate, and the agent has no prior knowledge of your existing preferences, project background, or communication style, forcing you to repeat all your setup information every time you start a new conversation. This plugin solves that common annoyance by storing a persistent user profile that is automatically loaded for every new session, so you never have to repeat your preferences or background information again.

It exposes two tool functions for agents to work with the memory: memory_update that creates, appends, or removes user preference entries, and memory_get that retrieves stored preferences when a personalized response is needed. Every new session automatically injects the stored user profile into the system prompt, and it consumes zero extra tokens when the profile is empty, so you don’t have to worry about unnecessary overhead when you first start using it. All preferences are stored in a plain, human-readable markdown file at $DSH_HOME/user-memory/user.md, which you can read, edit, or delete manually at any time if you need to adjust your preferences.

Installation is straightforward, and you can install it with a single command that handles all dependencies automatically, no manual setup or extra configuration required out of the box. To install it on your preferred DSH profile, just run dsh plugin --profile <profile-name> add dsh-tool-user-memory then restart your DSH session to activate the plugin. You can also install it from source by cloning the GitHub repo, building it with npm, and adding the packed tarball to your profile. The plugin is released under the permissive open-source MIT license, and all core functionality is already fully tested and stable for daily use.

这是一个专为 DeepSeek Harness 开发的原生插件,核心功能是为 DSH 代理提供跨会话的持久化用户偏好记忆。默认情况下,DSH 每次新建会话都是独立的,代理不了解用户的语言习惯、沟通风格、项目背景等信息,需要用户重新交代。该插件为代理添加了持久化用户画像存储,让每个新会话启动时就能自动读取用户偏好,无需用户重复说明。

插件提供两个核心工具和一个自动注入能力:memory_update 用于自动记录、追加或删除用户偏好,memory_get 用于需要个性化回答时主动读取用户画像,每个会话还会自动把用户画像注入系统提示词,空画像不消耗额外 token。偏好存储在 $DSH_HOME/user-memory/user.md 文件中,是人类可读的 Markdown 格式,支持手动编辑、删除,操作非常直观可控。

安装十分简便,推荐使用一条命令 dsh plugin --profile <名称> add dsh-tool-user-memory 完成安装,重启 DSH 会话即可生效。也支持从 GitHub 源码手动安装,默认零配置即可使用,支持自定义存储路径、文件大小上限等参数。本插件采用 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-tool-user-memory

把 IAMLieutenant/dsh-tool-user-memory 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-tool-user-memory

DeepSeek Harness 用户偏好记忆插件:让 agent 跨会话记住你的偏好——语言习惯、沟通风格、项目背景、目标……每个新会话都不必重新自我介绍。

独立开源插件 —— 作为 DeepSeek Harness 社区生态的一部分独立开发与维护 (GitHub 话题:dsh-plugin)。 与官方仓库无关;直接通过 npm 安装,30 秒启用。

English | 更新日志


1. 项目介绍

它解决什么问题

默认情况下,DeepSeek Harness 的 agent 每次新会话都是"陌生人":不知道你偏好简洁还是详细、不知道你做什么项目、不知道你用什么语言交流——每个新会话都得重新交代一遍。

这个插件给 agent 加了一块持久化的用户画像:

  • 你说一句"我喜欢简洁的中文回答",agent 把它写进记忆文件;
  • 之后每一个新会话,这段记忆会自动注入系统提示词,agent 天生就知道——不用你提醒,也不用调工具。

核心能力

能力 说明
memory_update(key, value, mode?) agent 学到你的稳定偏好时,自动记录 / 追加 / 删除
memory_get(query?, limit?) 需要个性化回答时,主动读取你的画像
{{user_profile}} 系统提示词注入 每个会话每轮自动携带你的画像(空画像零 token 成本)
持久化存储 $DSH_HOME/user-memory/user.md,人类可读、可手改、可删除

工作原理(30 秒版)

你说"记住:我喜欢简洁的中文回答"
   → agent 决定调用 memory_update
   → 写入 $DSH_HOME/user-memory/user.md(原子写、仅属主可读)
   → 之后每个新会话:系统提示词自动注入画像 → agent 天生认识你

2. 下载与安装

前置条件

  • 已安装并跑通 DeepSeek Harness(dsh CLI;已在 0.1.0-rc.x 验证)
  • 无需单独安装 npm 包!dsh plugin 会替你装好

安装(推荐:一条命令)

在你想启用的 profile 上安装,例如 web:

dsh plugin --profile web add dsh-tool-user-memory

headless 或其他 profile 同理:

dsh plugin --profile headless add dsh-tool-user-memory

然后重启你的 dsh 会话(web 模式重启 dsh web),插件即生效。

安装做了两件事:1) 把包加入 profile 依赖;2) 因包声明了 dsh.bundle.patch, 自动把它激活进 profile 的 bundle 层(见下方验证)。

备用:从 GitHub 源码安装

git clone https://github.com/IAMLieutenant/dsh-tool-user-memory.git
cd dsh-tool-user-memory
npm install && npm run build
npm pack                       # 生成 dsh-tool-user-memory-0.1.2.tgz
dsh plugin --profile web add ./dsh-tool-user-memory-0.1.2.tgz

手动配置(可选)

默认零配置即可用。如需调整,在 profile 的 cordis.patch.yml 覆盖(按行 id tool-user-memory):

配置项 默认值 含义
path $DSH_HOME/user-memory/user.md 画像文件路径
maxBytes 8192 画像文件体积上限;超限时按最旧优先逐条淘汰
promptMaxBytes 2048 每轮系统提示词注入的字节预算(新近优先);设为 0 注入完整画像
includeInPrompt true 是否在每个会话的系统提示词中注入画像

3. 验证安装成功

方法 1:检查 profile 配置

打开 profile 的 package.json(如 $DSH_HOME/profiles/web/package.json), dsh.profile.bundles 中应包含 dsh-tool-user-memory:

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

← 上一个 Prev promptaflow 下一个 Next dsh-codex-project →