项目级跨会话记忆:PROJECT.md 快照注入首条用户消息(缓存友好)+ memory_remember 工具 + ReAct 任务结束自动反思;各项目独立记忆文件,互不互通。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:Phant0Meow/dsh-memory-meow
GitHub 来源的插件在安装时会在你的机器上执行构建脚本。请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
Cross-session project memory for DeepSeek Harness (DSH). Born from the "meow" fork — hence the name — but works on any DSH profile.
The idea: every workspace keeps one human-readable memory file (.dsh-meow/PROJECT.md).
New sessions get it injected into the first user message (not the system prompt), so the
prompt prefix — and your LLM provider's KV/context cache — stays untouched. When the model
finishes a task (a ReAct turn that used tools), the plugin gently asks it to reflect and save
what's worth remembering.
✨ Features
- Cache-friendly by design: memory is injected as a plain user-message suffix on the session's first user message. The system prompt never changes, and the snapshot is frozen for the whole session — later memory updates cannot invalidate the request prefix.
- Human-owned memory:
.dsh-meow/PROJECT.mdper workspace. Plain Markdown, human-editable, git-diffable, deletable withrm. memory_remembertool: the model can write a memory anytime (categories: fact / mistake / preference / user_said / lesson / detail), appended atomically to the right section.- Automatic reflection: after a task turn ends (model stopped calling tools), the plugin
steers a reflection prompt. The model decides whether anything is worth remembering — and
calls
memory_rememberonly when there is. Chat-only turns never trigger reflection. - No recursion: reflection rounds are marked; a turn that already reflected, or whose last
tool call was a
memory_tool, is never asked again. - Zero runtime dependencies: the host bundle is self-contained (esbuild bundles
schemastery / dsh-tools / dsh-llm into
lib/index.js). - Per-workspace isolation: different projects, different memory files.
📦 Install
Via dsh plugin (requires the package to be published / linked)
dsh plugin --profile web add meow-memory
dsh web
By hand (any DSH install, no npm needed)
- Copy (or symlink) this package into the profile's
node_modules:
(On Windows:# e.g. for the web profile of a DSH home at ~/.dsh mkdir -p ~/.dsh/profiles/web/node_modules ln -s /path/to/meow-memory ~/.dsh/profiles/web/node_modules/meow-memoryNew-Item -ItemType Junction ...— NTFS junction, no admin needed.) - Register in the profile's
cordis.patch.yml:- insert: - id: meow-memory name: 'meow-memory' config: enabled: true - Restart
dsh web. New sessions pick up the plugin automatically.
⚙️ Configuration
All fields are optional (profile patch or cordis.patch.yml):
- id: meow-memory
name: 'meow-memory'
config:
enabled: true # master switch (false = no injection, no tool, no reflection)
projectDir: '.dsh-meow' # memory directory, relative to the workspace
projectFile: 'PROJECT.md' # memory file name
maxInjectChars: 4000 # max chars injected into the first user message (truncated beyond)
reflect: true # auto-reflection after ReAct task turns
🧠 How it works
First user message memory_remember tool task end
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────────┐
│ [user text] │ │ model calls it │ │ agent/turn-stopping │
│ ───────────── │ │ → append to │ │ saw tool calls? │
│ [PROJECT.md │ │ .dsh-meow/ │ │ last tool memory_*? │
│ snapshot] │ │ PROJECT.md │ │ already reflected? │
└──────────────────┘ └──────────────────┘ │ → agent.steer(reflect│
injected once per atomic write │ prompt) if yes │
session, never again └──────────────────────┘
Memory content guidance (embedded in the tool description and the reflection prompt):
- important facts, conclusions, decisions;
- mistakes and corrections from the user (always worth keeping);
- the user's own description of the project (quote them);
- surprises;
- lessons from repeated failed attempts;
- user preferences (communication / working / coding style, project-related);
- hard-won details that took many tool calls to find.
🛠 Development
npm install
npm run build # esbuild bundle → lib/index.js (self-contained)
npm run test # 22 logic tests: tool, store, injection, reflection, recursion guard
The @deepseek-ai/* packages live in the dsh-meow pnpm workspace, not in this package's
node_modules. On Windows, npm run link-workspace (or scripts/link-workspace.ps1)
creates junction mirrors of the workspace packages so esbuild can resolve them;
build.mjs uses nodePaths to pick them up. The links are build-time only.
📄 License
MIT — see LICENSE.
链接
同类插件
LoserFox/distill★ 15
自动对话蒸馏:后台 subagent 反省 + 技能 create/update。
omdsh-dev/dsh-mnemon★ 11
Mnemon 深度集成:本地三层记忆(Runtime Memory、可检索 Documents、受监督 Memory Spaces)。
modusensus/dsh-mneme★ 8
跨会话记忆:SQLite + 可人工编辑的 Markdown 镜像,后台自动巩固(去重/合并/冲突裁决),提供 6 个记忆工具。
nowledge-co/nowledge-mem-deepseek-harness★ 5
给所有 AI 工具和 Agent 共用的一层记忆:注入 Context Bundle、提示时检索、MCP 工具与回合结束 DSH 线程捕获。
Jesse-njx/dsh-memory★ 2
基于 DSH 无损会话日志的引用式记忆:蒸馏出的事实带 `(sessionId, eventRange)` 引用,可随时展开回原始日志片段。
PerryLink/dsh-memento★ 1
有界、分层、带审批门、可审计的跨会话记忆:`ctx.memory` 服务 + 零依赖 SQLite 存储 + `memory` 工具与冻结快照注入;写入必过审批门,模型可见内容可自会话日志重建。