jonah791/dsh-agent-memory

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

面向DeepSeek Harness(DSH)的智能体驱动长期记忆

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH) that enables cross-session long-term memory for DSH agents. It partitions memory into global and per-workspace scopes, organizes entries into three tiers (fact, knowledge, episodic), and automatically compresses episodic memory through time buckets from daily to yearly granularity. To avoid irrelevant memory injection, it weights the context of the last four conversation turns to find the current conversation’s core topic, then injects top relevant memory snippets into every new user message before the agent processes the request. This design fixes the common issue of injecting unrelated memory when a session is restarted with a wakeup message.

The plugin registers 12 tools for agents to use, covering core memory operations like writing new memories, retrieving existing ones, updating entries, archiving outdated content, browsing memory by time pyramid, navigating related memory networks, and running health and value audits. Automatic behaviors include injecting a memory overview on session start, running compression when time buckets close, and saving checkpoints as episodic memory after DSH session compaction. It is designed for DSH users who want their agents to retain long-term project knowledge, explicit user preferences, and decision context across multiple independent sessions.

The plugin runs entirely on host-side DSH, requires Node.js 24 or higher to build and test, and only depends on core DSH packages plus two small pure JavaScript dependencies. It stores all memory data locally in the workspace’s .dsh/memory.yml file, has no external network or service dependencies, and does not encrypt or authenticate stored data. It only supports single-process locking for concurrent writes, so it does not guarantee consistency when multiple DSH instances share the same storage directory. The project explicitly warns against storing credentials like API keys or passwords, and it is released under the permissive open source MIT license.

这是一个专门为DeepSeek Harness(DSH)开发的原生插件,为DSH中的智能体提供跨会话长期记忆能力。它将记忆按全局和工作区分区,分为事实、知识、情景三个层级,实现了从日到年的时间桶自动压缩,还会在用户消息中自动注入相关记忆,帮助智能体在跨会话场景中保留过往的上下文信息和关键知识。

插件提供了12个可调用工具,支持记忆的写入、检索、更新、归档、关联导航、浏览、统计、健康检查、价值审计、版本查询等操作,还会自动在会话启动、用户新消息、时间压缩完成后注入对应记忆。适合需要让DSH智能体保留长期项目经验、用户偏好和决策上下文的开发者与普通用户使用。

插件运行只依赖DSH核心相关包和两个纯JS依赖,无外部网络服务,数据存储在工作区的memory.yml文件中,不加密不鉴权,明确禁止存储密钥等敏感凭据,采用MIT许可证开源,要求Node.js版本不低于24才能正常编译和运行单元测试。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
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 github:jonah791/dsh-agent-memory

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

READMEREADME

dsh-agent-memory

version license TypeScript tests

一句话:给 DSH 里的 agent 装上跨会话的长期记忆——把「经历过的事」结构化写入持久层,再在恰当的时机(会话启动、每条主人消息、时间桶结束、会话压缩完成)把它带回上下文,并允许 agent 检索、修订、归档、沿关系行走。

为什么值得用:agent 的原生记忆边界就是一次会话与一份压缩 checkpoint——上一个项目踩过的坑、主人说过的偏好、决策的理由,新会话里全部蒸发。本插件把「记忆」变成可检索、可压缩、可回滚的资产:全局偏好(global)永随检索,项目知识按 workspace 分区,情景经历按日→周→月→年自动升维成概要,检索到的每条记忆还附带关联链(连着它的邻居一起浮现)。用它的差别很具体:下一条主人消息到手时,相关记忆已经在上下文里(auto-recall),而不是等你想起来去查。

能力

12 个工具(均 defineTool 注册,名称与源码逐字一致):

工具 用途
remember 写入/覆盖/合并。L1 fact 带 key(同 scope+key 精确覆盖);L2 knowledge / L3 episodic 同标题自动合并(标签并集 + 正文追加);未命中则新建。受 max_entries 守卫(仅拦新建)
recall 检索:关键词/层级/标签/时间过滤,相关度(标签 3 > 标题 2 > 正文 1)+ 新鲜度排序;每个结果附 related 关联链;结果标注来源 scope 与压缩层级。v0.5:受角色视野约束(见「角色视野」),可用 role 参数切换视角
memory_relate 联想导航:按 id 展开关联网络;depth>1 走 BFS 多跳记忆社区(hop 标注层级、visited 防环、每跳 limit 扇出)
memory_browse 时间金字塔浏览(年/月/周/日分桶 + 层级/标签/时间过滤 + 分页)。与 recall 互补——「不知道有什么」时的发现路径
update 按 id 修订。v0.9 三模式:replace(缺省·text 首行作标题、全文作正文)/ append(追加到正文末尾)/ patch(find→replace,要求唯一命中,0 处或多处一律拒绝)——内容真变即落修订快照(revisions,保留最近 3 条,改错可回溯);tags 整体替换
forget 软归档(archived=true + 记 reason):不再进活跃检索,includeArchive 可找回。v0.9 三种选择器:id / ids[] / tier(按 memory_audit 分档批量:ARCHIVE/DEMOTE/REVIEW,KEEP 被拒);max 护栏(缺省 100 / 上限 500)+ dryRun 预览
memory_merge v0.9 合并原语:把 ids 的正文并入 canonical(带「合并自 <id>(<title>)」来源标注,信息不丢)后软归档之;strategy=keep-canonical 只归档不追加——用于处理 memory_audit 标出的 REVIEW 近重复簇
memory_stats 各层级/压缩层级/时间桶计数 + 归档数(可 scope 限定)
memory_health 运行时概览:条目总数、归档数、生效读 scopes、注入开关、生效角色(role / rolesEnabled / roleReason)
memory_audit 价值体检(v0.6 · 只读提案器):四档提案 KEEP / DEMOTE / ARCHIVE / REVIEW + 证据行 + 按层级聚合的体量视图。判据序:承重(被概要 archiveRef 引用)> 新(≤ keep_recent_days)> 未引用且老且无溯源(归档候选)> 未引用且体量大(可降级)> 小体量兜底。不归档、不删除、不刷新 accessedAt;分数是序数(权重为启发式先验,非拟合值)
memory_version 插件版本 + 构建时刻(动态读 package.json 与产物 mtime,用于 HMR 验证)
memory_check 「待沉淀建议」——当前恒返回空数组(通道 B 未接线,工具描述已如实声明)

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-user-addons 下一个 Next yuandian_dsh_plugin →