Repository navigation
本版是重构底座 + 人格串联的初版:不新增记忆层与存储结构,只给现有记录加「表达字段」,并加上读时重构与人格参数网。设计推导见 设计-重构与人格.md | English version。
变化
| # | 变化 | 涉及文件 |
|---|---|---|
| 1 | 记录新增 eventId / cues / source / confidence / status / validFrom / validTo / reconsolidationCount |
src/memory.js |
| 2 | layer 扩展 procedural / autobiographical(同一结构) |
src/memory.js |
| 3 | 重构:按线索组合情景/语义/情绪/程序/自传体,返回缺口与来源 | src/memory.js |
| 4 | 续接:memory_resume 把会话顺序记录拼成目标/做到/最后/下一步 |
src/memory.js |
| 5 | 预测:memory_predict 返回概念/案例/后果/风险 |
src/memory.js |
| 6 | 人格参数网:注意/提取/解释/表达权重,影响重构取材 | src/persona.js |
| 7 | 反馈记忆 → 人格参数建议;memory_persona_update 持久化 |
src/index.js、persona.json |
| 8 | SQLite 索引补列(event_id / source / status / confidence / cues_json) | src/index-db.js |
| 9 | memory_doctor:健康检查(记录/索引/回收站/损坏文件/候选/反馈) |
src/index.js |
存储表达(不新增结构)
- 同一事件的多条记忆用
eventId串起来(分布式);cues让不同线索唤起不同侧面。 source区分事实/推断;status支持active / candidate / superseded;validFrom/To表示有效区间。- 全部是可选字段,旧记录缺省即默认值,不迁移、不改目录。
重构 / 续接 / 预测
memory_reconstruct:按线索从多个分区取材,组合成「我记得 / 那时的感觉 / 这让我想到 / 类似地我会 / 一路走来」,返回gaps与confidence;引用到的记录reconsolidationCount++,原文不改;支持asOf查某个时间点的版本。memory_resume:不存项目表,取该会话kind=turn的记录按序重组成目标/做到/最后/下一步。memory_predict:语义给概念、情景给案例、程序给后果、情绪给风险。
人格串联
persona.attention/persona.retrieval影响重构取材;interpretation/expression作为给模型的框架提示。memory_feedback写普通反馈记忆,memory_persona给出增量建议,memory_persona_update写入persona.json。
健壮性
- 损坏的记忆文件被跳过(不阻塞启动);损坏的
state.json回退默认值。 - 列表上限:
memory_recall≤ 50、memory_timeline≤ 500、memory_reconstruct≤ 20、/memory-list最多 200 条。 memory_doctor报告记录数、各层数量、索引状态、回收站、损坏文件、候选/反馈数量。
测试
| 测试 | 结果 |
|---|---|
self-test |
✅ 32 / 32 |
emotion-test |
✅ 9 / 9 |
library-test |
✅ 15 / 15 |
consolidate-test |
✅ 10 / 10 |
db-test |
✅ 8 / 8 |
reconstruct-test |
✅ 9 / 9 |
persona-test |
✅ 6 / 6 |
gui-test |
✅ 17 / 17 |
client-test |
✅ 4 / 4 |
robustness-test |
✅ 3 / 3 |
| 合计 | 113 / 113 |
文档(中英双语)
中文为原文,英文为 *.en.md 对照版,共 10 份(含仓库根 README)。每份文档顶部都有双向语言切换器:
| 中文 | English |
|---|---|
README.md(仓库根) |
README.en.md |
dsh-human-memory/README.md |
README.en.md |
更新文档.md |
CHANGELOG.en.md |
实现思路.md |
DESIGN.en.md |
测试文档.md |
TESTING.en.md |
备选方案-人类记忆缺陷.md |
ALTERNATIVES.en.md |
设计-记忆类型与数据库.md |
DESIGN-memory-types-and-database.en.md |
设计-重构与人格.md |
DESIGN-reconstruction-and-persona.en.md |
迭代方向-会话短期记忆.md |
ROADMAP-session-memory.en.md |
迭代方向-用户画像记忆.md |
ROADMAP-user-profile.en.md |
安装
git clone https://github.com/Azurimson/dsh-plugin.git
cd dsh-plugin
dsh plugin --profile <你的 profile> add ./dsh-human-memory从插件市场安装:插件页 → 发现 → 添加索引源,填入
https://raw.githubusercontent.com/Azurimson/dsh-plugin/main/dsh-human-memory/dsh-market.json
可安装 v0.1.0 / v0.1.1 / v0.1.2 / v0.1.3 / v0.1.4 任一版本。
v0.1.4 — Reconstruction, Persona, Resume & Predict
The first release of the reconstruction substrate + persona wiring. No new memory layers or storage structures: existing records gain "expression fields", plus read-time reconstruction and a persona parameter network. Design notes: English | 中文.
Changes
| # | Change | Files |
|---|---|---|
| 1 | Records gain eventId / cues / source / confidence / status / validFrom / validTo / reconsolidationCount |
src/memory.js |
| 2 | layer extended with procedural / autobiographical (same structure) |
src/memory.js |
| 3 | Reconstruction: composes episodic / semantic / emotional / procedural / autobiographical by cue, reports gaps and sources | src/memory.js |
| 4 | Resume: memory_resume turns a session's ordered records into goal / done / last / next |
src/memory.js |
| 5 | Predict: memory_predict returns concepts / cases / consequences / risks |
src/memory.js |
| 6 | Persona parameter network: attention / retrieval / interpretation / expression weights shape reconstruction | src/persona.js |
| 7 | Feedback memory → persona suggestions; memory_persona_update persists |
src/index.js, persona.json |
| 8 | SQLite index extra columns (event_id / source / status / confidence / cues_json) | src/index-db.js |
| 9 | memory_doctor: health check (records / index / trash / corrupt files / candidates / feedback) |
src/index.js |
Storage expression (no new structures)
- Multiple memories of one event are linked by
eventId(distributed);cueslet different cues surface different facets. sourceseparates fact from inference;statussupportsactive / candidate / superseded;validFrom/Tomark validity ranges.- All fields are optional, so old records fall back to defaults — no migration, no directory changes.
Reconstruct / Resume / Predict
memory_reconstruct: gathers across partitions by cue and composes "what I remember / how it felt / what it reminds me of / similarly I would / along the way", returninggapsandconfidence; cited records getreconsolidationCount++without altering their text;asOfreads the version at a point in time.memory_resume: stores no project table — it takes the session'skind=turnrecords in order and rebuilds goal / done / last / next.memory_predict: semantics give concepts, episodes give cases, procedures give consequences, emotions give risks.
Persona wiring
persona.attention/persona.retrievalshape what reconstruction draws on;interpretation/expressionact as framing hints for the model.memory_feedbackstores an ordinary feedback memory,memory_personareturns incremental suggestions,memory_persona_updatewritespersona.json.
Robustness
- Corrupt memory files are skipped (never block startup); a corrupt
state.jsonfalls back to defaults. - List caps:
memory_recall≤ 50,memory_timeline≤ 500,memory_reconstruct≤ 20,/memory-listshows at most 200 entries. memory_doctorreports record count, per-layer counts, index status, trash, corrupt files, candidate and feedback counts.
Tests
10 suites, 113 / 113 passing (32 + 9 + 15 + 10 + 8 + 9 + 6 + 17 + 4 + 3).
Documentation (bilingual)
Nine Chinese documents each have an English counterpart (*.en.md): README, changelog, design rationale, testing plan, alternatives, two design notes, and two roadmap docs.
Install
git clone https://github.com/Azurimson/dsh-plugin.git
cd dsh-plugin
dsh plugin --profile <your profile> add ./dsh-human-memoryFrom the plugin market: Plugins → Discover → Add index source, then enter
https://raw.githubusercontent.com/Azurimson/dsh-plugin/main/dsh-human-memory/dsh-market.json
Any of v0.1.0 – v0.1.4 can be installed.