npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-memory-fortress

v1.0.0

Published

Memory Fortress for DeepSeek Harness: 5-track layered memory, self-evolution, knowledge graph (SQLite+FTS5), status pill. 本地记忆堡垒:五轨记忆·自我进化·知识图谱·状态灯。

Readme

🏰 dsh-memory-fortress · DeepSeek Harness 本地记忆堡垒

让 AI 拥有跨会话的长期记忆、自我进化能力和知识图谱 —— 一套装齐,零核心修改,随装随用,卸载即净。

English | 中文


这是什么?(30 秒了解)

Memory Fortress 是 DeepSeek Harness 的本地记忆增强插件,把三块能力合成一个包:

| 能力 | 说明 | |---|---| | 🧠 五轨分层记忆 | 长期记忆 / 用户档案 / 项目关键记忆 / 项目日志 / 每日日志——AI 自动沉淀对话为长期记忆,跨会话不丢上下文 | | 📊 知识图谱 | SQLite + FTS5 全文检索的本地图谱(实体/关系/任务/技能/事件),gm_record 写入、gm_search 语义查询 | | 🔄 自我进化 | 回合末自审查沉淀经验、技能自动创建与隔离审核、待办四象限管理 | | 🌐 外部 AI 调度 | COI 一键把任务派给 kimi / codex / grok / hermes 等外部 CLI,记忆注入、会话分层 | | 💡 状态灯 | 对话输入框常驻记忆状态灯(绿/黄/红/灰),一键关闭/只读记忆写入 | | 🛡️ 数据安全 | 写入前自动快照、对话结束自动提取实体入图谱、快照轮转上限 |

所有数据 100% 存在本地(Markdown + SQLite),不上传、不联网、可随时备份迁移。


安装

dsh plugin --profile <你的profile> add dsh-memory-fortress

或从 npm:

cd ~/.dsh/profiles/<你的profile>
pnpm add dsh-memory-fortress

然后在 profile 的 package.json 的 dsh.profile.bundles 数组里加入 "dsh-memory-fortress",重启 DSH 即可。

依赖说明:唯一运行时依赖是 better-sqlite3(知识图谱的存储引擎,含全平台预编译二进制,Windows/macOS/Linux 免编译)。


三大组件

1️⃣ dsh-memory-evolve —— 记忆与自我进化(核心)

五轨记忆体系:

| 轨道 | 用途 | 特性 | |---|---|---| | memory | 全局环境/项目事实 | 归档(archive)双向、UI 按钮 + 工具双入口 | | user | 用户档案(偏好/习惯) | 跨项目生效 | | key | 项目关键记忆 | 自动注入系统提示词,按 git 分支过滤 | | project | 项目日志(按工作目录隔离) | 项目间互不可见 | | daily | 今日日志 | 跨文件查历史 |

核心能力:

  • 记忆工具(memory):add / replace / remove / list / archive / expand,按轨道读写
  • 回合末自审查:每 N 回合自动触发记忆审查,经验沉淀防遗忘
  • 情绪反馈:识别用户正/负面情绪,自动附加【反馈】行到记忆
  • 技能系统(skill_manage):create → 隔离区 → approve → 技能库,防止低质技能污染
  • 待办管理(dtodo):四象限(重要×紧急)、每日待办、逾期提醒、跨项目查询
  • COI 外部 AI 调度:de_coi_dispatch 把任务派给 kimi/codex/grok/hermes,支持会话恢复、记忆注入、完成唤醒
  • WebUI 管理界面:记忆 / 技能 / 待办 / COI 调度 / 提示词管理,全部可视化操作
  • 临时信息便签、会话广播/编排/搜索、模型设置

2️⃣ graph-memory —— 知识图谱

本地知识图谱(better-sqlite3 + FTS5 全文检索):

| 工具 | 功能 | |---|---| | gm_record | 写入实体(TASK/SKILL/EVENT)和关系(SOLVED_BY/USED_SKILL/PATCHES/REQUIRES/CONFLICTS_WITH) | | gm_search | 按 PageRank 排序的模糊检索 | | gm_stats | 图谱统计(节点/边/类型分布) | | gm_status | 健康状态 |

特性:FTS5 全文检索、WAL 模式、Schema 自动迁移、每回合对话结束自动提取实体入图谱。

数据位置:~/.dsh/graph-memory/graph-memory.db

3️⃣ memory-status-pill —— 状态灯

  • 对话输入框常驻状态灯(绿=正常 / 黄=注意 / 红=错误 / 灰=关闭)
  • 一键关闭/只读:ui_state 开关控制记忆写入(off 拒写 / readonly 拒写允读)
  • 自动化钩子(代码强制):
    • AUTO-07 对话结束自动提取:回合结束自动提取实体入图谱
    • AUTO-09 写入前快照:记忆写入前自动快照(节流 30s),防数据丢失
  • 快照保留上限 20 个,自动轮转

快速上手

安装重启后,AI 自动获得这些工具,你可以直接对话:

"记住这个项目用 pnpm 不用 npm"           → AI 写入 key 轨记忆
"查一下之前怎么解决 better-sqlite3 编译问题"  → AI 调 gm_search 查图谱
"把这个任务派给 kimi 跑"                  → AI 调 de_coi_dispatch
"今天做完了什么"                          → AI 调 dtodo list
"输入框那个灯怎么关了"                     → 设置 → Memory Evolve → 状态灯开关

配置

所有配置在 DSH 设置 → Memory Evolve 可视化管理:

  • 记忆审查开关与间隔
  • 技能审核(隔离区)开关
  • COI 调度默认适配器
  • 状态灯样式

高级配置(cordis.patch.yml):

- id: dsh-memory-evolve
  config:
    skillReviewEnabled: true   # 新技能先进隔离区,approve 后入库

- id: graph-memory
  config:
    dbPath: ~/.dsh/graph-memory/graph-memory.db   # 图谱数据位置

- id: memory-status-pill
  config: {}

数据与隐私

  • 全部本地存储:记忆是 Markdown 文件,图谱是 SQLite 文件
  • 数据位置:~/.dsh/memories/(五轨记忆)、~/.dsh/graph-memory/(图谱)、~/.dsh/skills/(技能)
  • 无遥测、无上传、无网络依赖(COI 调度为你显式派发外部 AI 时除外)
  • 卸载即净:插件卸载不删除数据文件,随时备份迁移

系统要求

  • DeepSeek Harness >= 0.1.1-rc.1
  • Node.js >= 20
  • better-sqlite3 支持的平台(Windows x64/arm64、macOS Intel/Apple Silicon、Linux x64/arm64/musl)

许可证

MIT — 版权归属:lib/graph-memory/、lib/status-pill/ 与打包层为本项目原创;lib/memory-evolve/ 为捆绑的第三方项目 [dsh-memory-evolve](MIT © dsh-external,保留原许可)。详见 THIRD_PARTY_NOTICES.md。