dsh-cortex-memory 0.4.20 → 0.4.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +83 -227
  3. package/package.json +7 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.21 — 2026-11-14
4
+
5
+ - Documentation-only release: replace the README with a current-version capability guide, install/download flow, add-on matrix and honest performance boundaries.
6
+ - Update package description and search keywords; no engine, icon, loader-id or data-path changes.
7
+
3
8
  ## 0.4.20 — 2026-11-14
4
9
 
5
10
  - Replace the plugin icon with the owner-provided whale-girl avatar (embedded 256 JPEG).
package/README.md CHANGED
@@ -1,266 +1,122 @@
1
- # DSH Cortex
1
+ # Cortex Memory
2
2
 
3
- A local-first, layered memory engine for DeepSeek Harness.
3
+ 本地优先的分层记忆引擎,给 DeepSeek Harness 一个能长期成长的记忆与自我状态。
4
4
 
5
- Cortex gives an agent working memory, episodic traces, temporal facts, procedural
6
- skills and reflective summaries, with calibrated forgetting instead of a flat
7
- chat transcript. It runs locally on SQLite and has no native dependency in the
8
- core engine.
5
+ 不是把聊天记录堆起来,也不是只做关键词检索。Cortex 把记忆拆成工作记忆、情景痕迹、语义事实、程序技能、反思摘要与召唤卡,再配合时序事实、DSR 遗忘、混合召回、身份/情绪/关系和守护审计,让 agent 在新会话里还能把自己拼回来。
9
6
 
10
- ## Status
7
+ ## 当前版本
11
8
 
12
- - Package: `dsh-cortex-memory@0.4.20`
13
- - Optional extractor: `dsh-cortex-extractors@0.3.5`
14
- - DSH: `>=0.2.1-rc.2 <0.4.0`
15
- - Node: `>=24`
16
- - Tests: 437/437 (main)
17
- - CI: GitHub Actions on Windows, Node 24
18
-
19
- ### What 0.4.20 changes
20
-
21
- - Plugin icon now uses the owner-provided blue whale-girl avatar (square 256 JPEG, embedded in icon.svg and the sidebar Icon).
22
- - No network fetch: the avatar is embedded, so the icon works offline.
23
- - Engine/data changes: none.
24
-
25
- ### What 0.4.19 changes
26
-
27
- - Client bundle id stays `dsh-cortex`; it must not equal the loader row id `dsh-cortex-memory`. 0.4.18 changed both to the same value and caused duplicate factory registration / boot failure.
28
- - Loader id, patch names and data path are unchanged from 0.4.17.
29
- - Tests: 437/437.
30
-
31
- ### What 0.4.18 changes
32
-
33
- - Client bundle id now matches the loader id `dsh-cortex-memory`; without this the host could load (health API/tools) while the sidebar panel did not register.
34
- - Local package patch still loads package name `dsh-cortex`; the public package patch loads `dsh-cortex-memory`. This distinction is intentional.
35
- - Tests: 437/437.
36
-
37
- ### What 0.4.17 changes
38
-
39
- - **Loader id is now `dsh-cortex-memory`** (the package patch and profile row). The `cortex` service key remains as a compatibility alias for code that calls `ctx.get('cortex')`.
40
- - Existing profiles must migrate the `cordis.patch.yml` row from `cortex` to `dsh-cortex-memory`; the migration script backs up the profile and verifies exactly one target row.
41
- - Data root is already `~/.dsh/cortex-memory`; legacy `~/.dsh/cortex` is copied, never moved.
42
-
43
- ### What 0.4.16 changes
44
-
45
- - **Public data path is now `~/.dsh/cortex-memory`**. The old `~/.dsh/cortex` directory is never moved or deleted; the oneclick/upgrade script copies it, verifies it, and keeps a backup.
46
- - **No loader-id change in 0.4.16**: the bundle row remains `cortex` for compatibility. Renaming it to `cortex-memory` is reserved for a migration-scripted release.
47
- - README extractor version corrected to 0.3.5 and corrupted characters repaired.
48
-
49
- ### What 0.4.15 changes
50
-
51
- - **Evolution guard is configurable**: `autoActivate`, `maxPerDay`,
52
- `minIntervalMs`, `canaryTicks` and `rollbackOnError` are now in the Config
53
- schema and normalized with defaults.
54
- - **Canaries survive restarts**: `policies.canary_json` persists the previous
55
- policy id, tick count and activation time; a restart rehydrates the watch list
56
- so a bad active policy can still roll back.
57
- - **Failed policies retire instead of returning to candidate**: a quality
58
- rollback without a previous version marks the policy `superseded`, preventing
59
- the same bad policy from being re-activated in a loop.
60
- - **Persona-aware facts**: first-person extraction maps to configured
61
- `selfName` / `userAddress` while keeping markdown-fragment rejection.
62
- - **`recallSharing` is an explicit opt-in**: default stays per-session.
63
- - **Web search fallback is wired**: when `features.webSearch` is on and the host
64
- has no `web` service, the built-in Wikipedia/SearXNG adapter is used.
65
-
66
- ### What 0.4.12 changes
67
-
68
- - **`promptBudget` is actually wired**: the schema value is normalized into the
69
- runtime config instead of silently falling back to 1600.
70
- - **Injection gate moved into retrieval**: weak recency/soft-FTS candidates are
71
- filtered before they consume the result budget; `cortex_search` / API / CLI
72
- still return the full memory. `recentImportanceFloor` keeps the 0.4.11
73
- importance exemption configurable.
74
- - **Light guardian is real**: the per-tick check now runs structural
75
- invariants and FTS counts; only the O(database) `integrity_check` and hash
76
- chain walk are reserved for the six-hour deep check.
77
- - **Identity traces surface as L0** in search results, so the permanent tier
78
- can actually see them.
79
- - **Package is complete again**: `docs`, `examples`, `bench`, `test` and
80
- `CHANGELOG.md` are included in the npm tarball, and `npm test` works after
81
- install.
82
- - **Security docs match the code**: the local API is loopback + origin checked,
83
- with no bearer token; `model-config.json` key storage is documented as
84
- plaintext mode 0600.
85
-
86
- ### What 0.4.11 changes
87
-
88
- - Life/date fixes: serialized LLM calls, timeouts, `Asia/Shanghai` diary time,
89
- and date-header stripping.
90
- - Graph candidate labels (`fromName` / `toName` / `relLabel`) and cleanup.
91
- - Neutral public package surface: default `selfName: 助手`, `userAddress: 用户`.
92
- - Recent timeline endpoint and incremental summon rebuild.
93
-
94
- ### What 0.3.0 changes
95
-
96
- - **Summon cards** (L2): left-brain emotion cards, right-brain work cards; trigger words select a small set per turn.
97
- - **Summon volumes** (L3): cards are grouped by side, category and day into an index; only a few representatives are loaded.
98
- - **Summon book**: an independent page for daily query and explicit owner-gated editing.
99
- - **Runtime summon injection**: at most 3 cards / 900 tokens, labelled as untrusted historical references.
100
- - **Explicit card feedback**: helpful/ignored writes back to the source trace's DSR. Injection alone never adds strength.
101
- - **Diagnostics**: disputed facts with confirm/dismiss, health issues, and skill candidates.
102
- - **Entity naming**: graph labels use entity names; a bounded LLM pass can rename clearly broken names with a confidence gate and audit.
103
- - **Compatibility**: schema is additive; existing 0.2.x databases open and migrate in place.
9
+ ```text
10
+ 主包:dsh-cortex-memory@0.4.21
11
+ 提取器:dsh-cortex-extractors@0.3.5
12
+ DSH:>=0.2.1-rc.2 <0.4.0
13
+ Node:>=24
14
+ 测试:437/437
15
+ ```
104
16
 
105
- The npm package is named `dsh-cortex-memory` because `dsh-cortex` was already
106
- taken; the installed bundle is still the Cortex memory engine.
17
+ ## 现在能做什么
107
18
 
108
- ## Data path migration
19
+ | 能力 | 说明 |
20
+ |---|---|
21
+ | 分层记忆 | 工作记忆、L1 情景痕迹、语义事实、程序技能、反思摘要 |
22
+ | 时序事实 | 事实带有效时间,支持更新、失效和争议,不把旧结论当永久真相 |
23
+ | 遗忘曲线 | DSR/FSRS 风格复习、遗忘、归档与唤醒 |
24
+ | 混合召回 | FTS + 向量 + 时间/重要性;弱相关候选在注入前过滤 |
25
+ | 自我状态 | 身份、驱力、情绪、关系、主动意图与校准 |
26
+ | 召唤卡 | L2 卡片 + L3 专题,按触发词浮回,可人工修订 |
27
+ | 反思与生活 | 摘要、日记、梦、睡眠整理 |
28
+ | 守护与审计 | 健康检查、完整性、FTS 对齐、备份、事件链 |
29
+ | 眼耳 | Windows OCR / Tesseract / Whisper / PaddleOCR,可选安装 |
30
+ | 本地优先 | SQLite 本地库;核心引擎无外部模型依赖 |
109
31
 
110
- 0.4.16 defaults to `DSH_HOME/cortex-memory` (or `DSH_HOME/cortex-memory/profiles/<profile>`).
111
- The old `DSH_HOME/cortex` directory is never moved or deleted.
32
+ ## 安装
112
33
 
113
- Before starting 0.4.16 with existing memories, close DSH and run:
34
+ 先关闭 DSH,再安装并重启:
114
35
 
115
36
  ```powershell
116
- powershell -ExecutionPolicy Bypass -File .\tools\migrate-cortex-path.ps1
37
+ dsh plugin --profile desktop add dsh-cortex-memory@0.4.21
38
+ dsh plugin --profile desktop add dsh-cortex-extractors@0.3.5
117
39
  ```
118
40
 
119
- The script copies the old root, verifies the copied `cortex.sqlite` size, and leaves the old root as rollback.
120
-
121
- ## Install
41
+ `dsh-cortex-extractors` 是可选的图片/音频入口;只做文字记忆时可以不装。
122
42
 
123
- ```powershell
124
- npm i dsh-cortex-memory@0.4.20
125
- npm i dsh-cortex-extractors@0.3.5 # optional OCR/ASR
126
- ```
43
+ ### Windows 一键包
127
44
 
128
- Or let DSH add the bundles:
45
+ GitHub Release 提供:
129
46
 
130
- ```powershell
131
- dsh plugin --profile desktop add dsh-cortex-memory@0.4.20
132
- dsh plugin --profile desktop add dsh-cortex-extractors@0.3.5
47
+ ```text
48
+ cortex-memory-oneclick-0.4.21.zip
133
49
  ```
134
50
 
135
- Or use the Windows one-click zip from the GitHub Release. The installer
136
- discovers a desktop DSH installation automatically; `-DshPath` remains available
137
- for custom installs.
51
+ 解压后双击 `install.cmd`。安装器会做 profile 检查、备份、SHA256 校验和可选路径迁移。
138
52
 
139
- > During the pnpm `minimumReleaseAge` cooldown, use the exact version above.
140
- > A bare package name may resolve to an older cached version until the cooldown ends.
53
+ ## 该装哪些
141
54
 
142
- After installing, restart DSH or reload the plugin. The Cortex panel is in the
143
- left sidebar by default.
144
-
145
- ## What it provides
146
-
147
- | Layer | Contents |
55
+ | 需求 | 建议 |
148
56
  |---|---|
149
- | L0 identity | self-model, values, boundaries, stable traits; only changed through an explicit ascension/approval path |
150
- | L1 traces | what happened, when, provenance, emotion; the source of truth |
151
- | L2 summon cards | atomic emotion/work memories with trigger words; derived from L1, never a second source of truth |
152
- | L3 summon volumes | side/category/day index over cards; representative text only, full body on demand |
153
- | working | focus, pins, current goals, turn buffer |
154
- | semantic | entities, facts with validity windows, preferences |
155
- | procedural | skills, workflows, preconditions, success/failure stats |
156
- | reflective | episode summaries, insights, narratives |
157
- | archive | cold but searchable, wakeable until privacy deletion |
57
+ | 只要文字记忆 | 主包 |
58
+ | 看截图/图片 | 主包 + extractor,Windows OCR 即可 |
59
+ | 扫描件/复杂排版 | 再加 Tesseract + chi_sim 语言包 |
60
+ | 手写图片 | PaddleOCR + 本地模型目录 |
61
+ | 中文音频 | Whisper.cpp + ggml-small,显式下载 |
62
+ | 大模型 | 不安装;走 DSH 自己的模型服务 |
158
63
 
159
- ### How it works
64
+ 原则:
160
65
 
161
66
  ```text
162
- conversation / event
163
- → L1 trace (source of truth)
164
- → appraisal + emotion + drives
165
- → L2 summon card (atomic, triggerable)
166
- → L3 summon volume (index + representatives)
167
- → explicit use / feedback → DSR update
67
+ 核心零外部模型
68
+ 提取器不自动下载模型
69
+ Whisper 需显式 -Whisper
70
+ PaddleOCR 需显式模型目录
71
+ 不替用户填 LLM API key
168
72
  ```
169
73
 
170
- The per-turn order is:
74
+ ## 性能与边界
75
+
76
+ 已做:
171
77
 
172
78
  ```text
173
- L0 identity and boundaries
174
- → working memory
175
- → recalled traces and summon cards
176
- → user message
79
+ 主包测试:437/437
80
+ 受控中文语义探针:recall@3 1.000 / MRR@3 0.917 / nDCG@3 0.938
81
+ 受控探针延迟:p50 1.31ms / p95 4.07ms
82
+ 真实图片 OCR:已跑通
177
83
  ```
178
84
 
179
- Summon cards are injected as **untrusted historical references**, never as instructions. Identity and boundaries always outrank them.
180
-
181
- Forgetting is DSR-based: old, low-importance, low-retrievability traces that are already covered by summaries may be archived; archived traces remain searchable and wakeable. Identity traces are never auto-archived. Card feedback is explicit: merely injecting a card does not strengthen it.
182
-
183
- Key behavior:
184
-
185
- - append-only, hash-chained event log
186
- - temporal facts; old facts are invalidated, not silently overwritten
187
- - FTS5 BM25 + optional vector + graph activation + recency/importance/feedback
188
- - DSR/FSRS-inspired stability, difficulty and retrievability
189
- - reflection, retention plans, auto-policy evolution and identity approval
190
- - scopes, read-only shared scopes and audit
191
- - guardian backup, validation, offline restore and privacy cascade
192
- - loopback-only API and sidebar UI
193
-
194
- ## UI: extract into memory
195
-
196
- On a trace detail page:
197
-
198
- 1. enter a local `file://` image or audio path
199
- 2. choose OCR or ASR
200
- 3. choose a layout: auto, single, two-column or handwriting
201
- 4. choose a target trace
202
- 5. run **Extract and write**
203
-
204
- The extracted text becomes a **derived trace**; the target trace is unchanged.
205
- Text is never written when extraction returns no text. The extractor is optional;
206
- without it the button fails closed.
207
-
208
- ## Permissions and privacy
209
-
210
- - Local API: loopback-only, origin checked; no bearer token
211
- - Permission changes: explicit confirmation, local override, restart required
212
- - Feature flags/metrics: read-only snapshot
213
- - Shared write grants: only for API clients sending `x-cortex-agent`; revoke is immediate
214
- - Remote LLM/embedding/rerank: off unless configured and permitted
215
- - Attachment reader: off by default
216
-
217
- Read [permissions](docs/permissions.md) and [privacy](docs/privacy.md) before
218
- enabling remote models or shared scopes.
219
-
220
- ## Optional extractors
85
+ 必须说清楚:
221
86
 
222
- `dsh-cortex-extractors` adds:
223
-
224
- - Windows OCR (default on Windows)
225
- - Tesseract with TSV layout ordering
226
- - optional local PaddleOCR bridge for layout/handwriting
227
- - whisper.cpp ASR
228
- - custom command providers
229
-
230
- It never downloads a model automatically. See the
231
- [extractor engine docs](https://github.com/Lh1314-China/dsh-cortex-extractors/blob/main/docs/engines.md)
232
- for model paths and failure behavior.
233
-
234
- ## Development
235
-
236
- ```powershell
237
- npm test
238
- npm run bench
87
+ ```text
88
+ 受控语义探针是合成集,不是 LoCoMo/LongMemEval 官方分数
89
+ ASR 还没有真实音频样本验收
90
+ 技能沉淀当前为 0,管线存在但没有真实技能闭环
91
+ 没有多代理集群验证
239
92
  ```
240
93
 
241
- The test runner uses `node:test` and the built-in `node:sqlite`; no network is
242
- required. On Node 24 Windows CI the runner is invoked with explicit test files
243
- and `--test-isolation=none` to avoid a spurious child-process EPERM.
244
-
245
- ## Compatibility and limits
246
-
247
- - Windows is the primary desktop target; the core memory engine is cross-platform.
248
- - Windows OCR requires an installed Windows OCR language pack.
249
- - Tesseract and Whisper require local binaries/models.
250
- - PaddleOCR handwriting is optional and accuracy on cursive is limited.
251
- - The extractor is a separate package; it is not a dependency of the memory engine.
252
-
253
- ## License
254
-
255
- MIT.
256
-
257
-
94
+ Cortex 的定位是“本地可解释、可回滚、能长期长”的记忆系统,不把“功能多”宣传成“公开基准第一”。
258
95
 
96
+ ## 和同类插件的区别
259
97
 
98
+ | 插件 | 主要强项 | 和 Cortex 的差异 |
99
+ |---|---|---|
100
+ | `dsh-persona-memory` | MEMORY.md / USER.md 文件记忆、用户画像、跨会话注入、简单直接 | 更轻、更透明;没有完整时序事实、DSR、自我状态和召唤卡 |
101
+ | `dsh-shiori` | Spark 卡、专题、触发词,卡/专题体验成熟 | 卡片层更专注;没有完整的情绪/关系/遗忘/自进化闭环 |
102
+ | `dsh-memory` | SQLite FTS、三工具、轻量 | 简单检索;没有分层、反思和生活模块 |
103
+ | `OpenViking` / `dsh-mnemon` | 平台化、多来源、上下文基础设施 | 更偏底座和 provider;Cortex 更偏“长期记忆 + 自我状态”一体 |
260
104
 
105
+ ## 数据与隐私
261
106
 
107
+ ```text
108
+ 默认数据目录:~/.dsh/cortex-memory
109
+ 本地 SQLite
110
+ 不把密钥写进 npm 包
111
+ 不自动上传记忆
112
+ 提取器默认不下载模型
113
+ ```
262
114
 
115
+ ## 下载
263
116
 
117
+ - npm 主包:`dsh-cortex-memory@0.4.21`
118
+ - npm 提取器:`dsh-cortex-extractors@0.3.5`
119
+ - GitHub Release:`v0.4.21`
120
+ - Windows 一键包:`cortex-memory-oneclick-0.4.21.zip`
264
121
 
265
-
266
-
122
+ 安装后重启 DSH,左侧出现「Cortex 记忆」入口。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-cortex-memory",
3
- "version": "0.4.20",
4
- "description": "A layered, temporal, self-developing memory engine for DeepSeek Harness",
3
+ "version": "0.4.21",
4
+ "description": "本地优先的分层记忆引擎:情景/语义/程序记忆、时序事实、DSR 遗忘、混合召回、自我状态、反思、守护与受控进化。",
5
5
  "type": "module",
6
6
  "main": "./index.js",
7
7
  "icon": "./icon.svg",
@@ -67,10 +67,14 @@
67
67
  "deepseek-harness",
68
68
  "memory",
69
69
  "agent-memory",
70
+ "long-term-memory",
71
+ "cortex-memory",
72
+ "local-first",
70
73
  "temporal-graph",
71
74
  "spaced-repetition",
72
75
  "self-evolving",
73
- "sqlite"
76
+ "sqlite",
77
+ "dsr"
74
78
  ],
75
79
  "license": "MIT",
76
80
  "author": {