Installation
npx -y @deepseek-ai/dsh plugin --profile web add github:M-24rjgc/dsh-memoryThis installation command is an unverified starting point generated from the GitHub repository address.
README
Maintainer-authored documentation snapshot.
Mneme · dsh-memory
Mneme(Μνήμη,记忆女神)是一个完完全全建立在 DeepSeek Harness(DSH)之上的记忆系统。
范式一句话:
记忆不是数据库,而是一个编译器:唯一持久化的是 DSH 事件日志(经验源码),记忆是由可组合编译 pass 从
(经验日志, 时空坐标, 任务)编译出来的、带溯源与证据条件的可执行上下文。
规划中的每一层都已实现,没有“未来工作”占位:事件源、投影、版本/证据分析、LLM 抽取与整合(opt-in)、向量/图候选索引、上下文重建、反馈回路、分层分配、链接演化、结构化技能生成。LLM 相关 pass 需要 provider/model 配置;未配置时保持 keyless 确定性路径。
- 记忆账本本身是一个 DSH Session(事件溯源、可持久化、可检索、可 fork、可压缩);
- 记忆操作是账本里的
user/message表面事件,机器载荷放在 merge-extensible 的kind: 'memory'source 中; - 遗忘、整合与 versionKey/函数谓词冲突遮蔽都用 DSH 原生
surfaceOp: replace;旧修订永存,memory_trace可追溯; - 召回 = replay/vector/graph 候选发现 → 版本/证据检查 → 命中内容/片段/原文 reinstatement → 以 DSH 预置的
form: 'recall'呈现; - 语义/程序/前瞻/情景/元记忆是同一 IR 上不同编译 pass;
- 程序记忆经
emit-skill编译为结构化 SKILL.md,注册进ctx.skills。
详细设计见 docs/design.md。
编译 pass
| 包 | 角色 |
|---|---|
@dsh-memory/ir | Service Definition:MIR、ctx.memory、纯 fold、ledger 会话、索引器注册、分层分配 |
@dsh-memory/index-replay | FTS/字面检索 + 原文窗口 reinstatement |
@dsh-memory/index-vector | 向量候选索引(确定性向量,可选远程 embedding) |
@dsh-memory/index-graph | 事实图谱候选索引(PPR 式扩散) |
@dsh-memory/lower | 确定性 lowering:session/event → MIR |
@dsh-memory/extract | RecMem 复发门控的 LLM claim 抽取 |
@dsh-memory/solve | 版本消解 + 证据条件 + 函数谓词冲突 |
@dsh-memory/optimize | TTL 遗忘 + 最低激活整合 + 预算硬限 |
@dsh-memory/consolidate | CLS 式重放总结(LLM,确定性回退) |
@dsh-memory/layers | MemGPT 式 working/state/archive 分层 |
@dsh-memory/links | A-MEM 式共享 subject 链接演化 |
@dsh-memory/fdo | CoEvo 式 recall/confirm 强化回路 |
@dsh-memory/projections | ctx.sessionProjections 增量投影与 checkpoint 缓存 |
@dsh-memory/emit-context | session-start 分层快照 + pre-step 召回 |
@dsh-memory/emit-tool | memory_remember/recall/list/forget/trace/confirm |
@dsh-memory/emit-skill | policy 节点 → 结构化 SKILL.md → ctx.skills |
快速启用
dsh web --patch "$PWD/examples/dsh-memory.cordis.yml"
LLM pass 通过环境变量启用:
MNEME_EXTRACT_PROVIDER=... MNEME_EXTRACT_MODEL=... \
MNEME_CONSOLIDATE_PROVIDER=... MNEME_CONSOLIDATE_MODEL=... \
MNEME_EMBED_ENDPOINT=... MNEME_EMBED_API_KEY=... MNEME_EMBED_MODEL=... \
dsh web --patch "$PWD/examples/dsh-memory.cordis.yml"
开发集成:本仓库要求与 DeepSeek Harness checkout 并排放置(dsh-repo 为同级目录)。pnpm-workspace.yaml 会把 DSH 的 vendor/* 与 packages/*/* 纳入同一 workspace,因此 workspace:^ 依赖、tsconfig project references 和测试 alias 都解析到 DSH 源码。
# 在 dsh-memory 同级准备 DSH 源码:
# git clone --depth 1 https://github.com/deepseek-ai/deepseek-harness.git dsh-repo
cd dsh-memory
pnpm install
pnpm run typecheck
pnpm test
发布到 npm 时由 pnpm 将 workspace:^ 协议转换为实际版本号。
许可
MIT
Project files and signals
Shown items are public repository signals detected in the directory snapshot.
Repository information
- Language
- TypeScript
- License
- MIT
- Last updated
- Aug 15, 2026, 8:36 AM
Install deliberately
Review source code, permissions, lifecycle hooks, dependencies and network access. Test untrusted plugins in an isolated environment.