@a9i5k4/dsh-auto-memory 0.1.28 → 0.1.30
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.
- package/README.md +352 -266
- package/README.zh-CN.md +370 -264
- package/cordis.patch.yml +9 -9
- package/lib/activation-host.js +455 -0
- package/lib/activation-inbox-state.js +261 -0
- package/lib/activation-inbox.js +426 -0
- package/lib/client.js +1395 -50
- package/lib/context-bridge.js +619 -0
- package/lib/context-host.js +712 -0
- package/lib/context-sink-python.js +90 -0
- package/lib/episodic-store.js +316 -0
- package/lib/evidence-store.js +272 -0
- package/lib/fact-store.js +418 -0
- package/lib/index-sync.js +160 -0
- package/lib/index.js +2386 -105
- package/lib/intent-clean.js +74 -0
- package/lib/m4-corpus.js +169 -0
- package/lib/m7-index-sync-host.js +194 -0
- package/lib/m7-wire.js +268 -0
- package/lib/memory-anchor.js +451 -0
- package/lib/memory-hub.js +259 -0
- package/lib/memory-index.js +145 -0
- package/lib/memory-writer.js +391 -0
- package/lib/policies/activation_policy_v2.json +88 -0
- package/lib/policies/recall_intent_lr_v1.json +1 -0
- package/lib/procedure-store.js +406 -0
- package/lib/python-sidecar-client.js +326 -0
- package/lib/semantic-decide.js +265 -0
- package/lib/semantic-js.js +381 -0
- package/lib/shadow-host.js +361 -0
- package/lib/shadow-retrieval.js +673 -0
- package/lib/storage-manage.js +203 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,266 +1,352 @@
|
|
|
1
|
-
# dsh-auto-memory —
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- **
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
###
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
- **
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
##
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
<
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
<img width="
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
-
|
|
1
|
+
# dsh-auto-memory — Auto Memory & Proactive Companion for DeepSeek Harness
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://htmlpreview.github.io/?https://github.com/Aik358/dsh-auto-memory/blob/preview/docs/landing/index.html"><strong>🌐 Landing page (full feature tour · data flow · papers · screenshots)</strong></a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="docs/screenshots/promo/promo-1-hero.png"><img width="820" alt="dsh-auto-memory hero: she remembers, unbidden" src="docs/screenshots/promo/promo-1-hero.png"></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="docs/screenshots/promo/promo-1-hero.png"><img width="130" alt="hero" src="docs/screenshots/promo/promo-1-hero.png"></a>
|
|
13
|
+
<a href="docs/screenshots/promo/promo-2-tour.png"><img width="130" alt="welcome tour" src="docs/screenshots/promo/promo-2-tour.png"></a>
|
|
14
|
+
<a href="docs/screenshots/promo/promo-3-recall.png"><img width="130" alt="recall & crystallization" src="docs/screenshots/promo/promo-3-recall.png"></a>
|
|
15
|
+
<a href="docs/screenshots/promo/promo-4-unattended.png"><img width="130" alt="unattended mode" src="docs/screenshots/promo/promo-4-unattended.png"></a>
|
|
16
|
+
<a href="docs/screenshots/promo/promo-5-external.png"><img width="130" alt="external memory inheritance" src="docs/screenshots/promo/promo-5-external.png"></a>
|
|
17
|
+
<a href="docs/screenshots/promo/promo-6-greeting.png"><img width="130" alt="scheduled greetings" src="docs/screenshots/promo/promo-6-greeting.png"></a>
|
|
18
|
+
</p>
|
|
19
|
+
<p align="center"><sub>Promo gallery · six frames · click any thumbnail to view full size</sub></p>
|
|
20
|
+
|
|
21
|
+
<details>
|
|
22
|
+
<summary><b>Promo gallery, frame by frame</b> (expand and flip through)</summary>
|
|
23
|
+
|
|
24
|
+
#### Frame 1 · Hero — She remembers, unbidden
|
|
25
|
+
|
|
26
|
+
<p align="center"><img width="720" alt="hero" src="docs/screenshots/promo/promo-1-hero.png"></p>
|
|
27
|
+
|
|
28
|
+
#### Frame 2 · Welcome Tour — Every feature, explained and toggled on the spot
|
|
29
|
+
|
|
30
|
+
<p align="center"><img width="720" alt="welcome tour" src="docs/screenshots/promo/promo-2-tour.png"></p>
|
|
31
|
+
|
|
32
|
+
#### Frame 3 · Recall & Crystallization — Conversation condenses into skills, traceably
|
|
33
|
+
|
|
34
|
+
<p align="center"><img width="720" alt="recall" src="docs/screenshots/promo/promo-3-recall.png"></p>
|
|
35
|
+
|
|
36
|
+
#### Frame 4 · Unattended Mode — Runs all night, zero small talk, zero interruptions
|
|
37
|
+
|
|
38
|
+
<p align="center"><img width="720" alt="unattended" src="docs/screenshots/promo/promo-4-unattended.png"></p>
|
|
39
|
+
|
|
40
|
+
#### Frame 5 · External Memory Inheritance — Your other AIs feed her memory too
|
|
41
|
+
|
|
42
|
+
<p align="center"><img width="720" alt="external" src="docs/screenshots/promo/promo-5-external.png"></p>
|
|
43
|
+
|
|
44
|
+
#### Frame 6 · Scheduled Greetings — Every day remembered
|
|
45
|
+
|
|
46
|
+
<p align="center"><img width="720" alt="greeting" src="docs/screenshots/promo/promo-6-greeting.png"></p>
|
|
47
|
+
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
<p align="center">
|
|
51
|
+
<a href="README.md">中文</a> · <b>English</b> · License BSD-3-Clause · <code>pnpm add @a9i5k4/dsh-auto-memory</code>
|
|
52
|
+
</p>
|
|
53
|
+
|
|
54
|
+
> **v0.1.30 MAJOR UPDATE** — A brand-new Welcome Tour: every feature introduced step by step with per-feature switches; an Office/Fluent-style liquid-glass app icon family; a changelog intro animation; and an unattended mode built for long batch jobs.
|
|
55
|
+
|
|
56
|
+
A **proactive associative-memory plugin** for the DeepSeek Harness Web GUI: memory is recalled by situation and injected into the next turn without the model ever asking for it — alongside three-layer auto-consolidation, AI greetings and daily reflections, calendar reminders, cross-tool memory inheritance, and production-grade unattended/batch support.
|
|
57
|
+
|
|
58
|
+
**The problem it solves**: AI assistants start from zero every session, and every existing memory solution still relies on the model "remembering to look" — call a tool, send a request; skip it once and the memory might as well not exist. This plugin removes the instruction entirely: a host-side middleware watches the conversation context continuously, and the right memories walk toward the model on their own — your preferences, project conventions, yesterday's progress, next week's deadlines, plus that "welcome back" when you return.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Highlights in 30 seconds
|
|
63
|
+
|
|
64
|
+
| | |
|
|
65
|
+
|---|---|
|
|
66
|
+
| **Proactive recall, zero instructions** | Memory is never fetched by the model — the host watches context and recalls automatically, injected at a fixed boundary, prefix-cache friendly |
|
|
67
|
+
| **Three-layer memory engine** | User rules → project notes → daily logs; injected + on-demand recall |
|
|
68
|
+
| **Memory writes itself** | A subagent quietly evaluates every turn and files topic-grouped entries — you never "remember to log" |
|
|
69
|
+
| **Every activation is auditable** | Each recall decision carries a full evidence chain, gradeable in the Recall review tab; skills crystallize from cross-session evidence |
|
|
70
|
+
| **Proactive reminders** | The AI spots deadlines and promises in conversation, files them into the calendar and reminds you later |
|
|
71
|
+
| **Everything is a switch** | Welcome tour + settings page, every feature individually toggleable (incl. unattended mode) |
|
|
72
|
+
| **External memory inheritance** | Memories from WorkBuddy / CodeBuddy / Claude Code / Codex are scanned, importable, per-source managed |
|
|
73
|
+
| **Production-grade hygiene** | Write gate (mojibake/stutter/JSON-injection blocking) + dirty-token scanner + credentials never enter prompts |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Welcome Tour (new in v0.1.30)
|
|
78
|
+
|
|
79
|
+
After first install or an upgrade, the plugin auto-plays a **step-by-step welcome tour** — not an ad popup, but the home of every feature switch:
|
|
80
|
+
|
|
81
|
+
<p align="center"><img width="720" alt="welcome tour" src="docs/screenshots/tour-welcome.png"></p>
|
|
82
|
+
|
|
83
|
+
- **One Office/Fluent-style liquid-glass app icon per step**: cyan inject, amber greeting, green calendar, violet engine, sky radar, coral finish — each with its own looping motion (bell sway, page flip, radar sweep, rising spark…)
|
|
84
|
+
- **Flip every feature right in the tour**: switches write config instantly; no second trip to settings required
|
|
85
|
+
- **Semantic-engine detection/download inline**: the three retrieval tiers (lexical 0GB floor → built-in ~130MB → advanced Python BGE-M3) are auto-detected and one-click installable (SHA256 verify + inference self-test)
|
|
86
|
+
- **Live external-memory scan**: WorkBuddy / Claude Code / Codex sources found on your machine, tick-per-source
|
|
87
|
+
- **No "how do I close this"**: closing mid-tour lands on a finish page telling you exactly where each feature lives in Settings
|
|
88
|
+
|
|
89
|
+
<p align="center"><img width="720" alt="tour core" src="docs/screenshots/tour-core.png"></p>
|
|
90
|
+
|
|
91
|
+
One-time catch-up for upgraders: from v0.1.30 every user auto-plays the full tour once after upgrading, then the changelog follows (skippable). Reopen anytime via **Settings → Appearance → Welcome tour → ▶ Replay**.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Three-layer memory system
|
|
96
|
+
|
|
97
|
+
| Layer | Location | Content |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| User-level memory | `~/.dsh/memory/MEMORY.md` | Cross-project rules & preferences |
|
|
100
|
+
| Project notes | `~/.dsh/memory/workspaces/{workspace}/MEMORY.md` | Conventions & decisions |
|
|
101
|
+
| Daily logs | `~/.dsh/memory/workspaces/{workspace}/YYYY-MM-DD.md` | Append-only work log |
|
|
102
|
+
| Daily reflections | `…/reflections/YYYY-MM-DD.md` | Structured review (results / lessons / next) |
|
|
103
|
+
|
|
104
|
+
**Injection strategy**: static discipline lives in the system prompt (byte-stable, keeps the prefix cache hot); dynamic memory rides a runtime snapshot — only the last day of logs plus a reflection digest are injected, everything else is fetched on demand via `memory_read` / `memory_recall`. Credential/secret sections are **always filtered out of prompts**.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Feature tour
|
|
109
|
+
|
|
110
|
+
### Auto-consolidation — memory writes itself
|
|
111
|
+
|
|
112
|
+
After every turn a small subagent quietly evaluates what happened: long-term-valuable topics are grouped into today's log (`## Topic (HH:MM)` + bullets), durable decisions are promoted to project notes, cross-project rules to user-level memory, small talk is skipped, failures queue and retry every 5 minutes (a 15-second heartbeat file proves the loop is alive). Daily write budgets with AI auto-compaction — going over budget never rejects a write.
|
|
113
|
+
|
|
114
|
+
### Activation & crystallization — interrupt only when it matters
|
|
115
|
+
|
|
116
|
+
Associative recall detects memory needs directly in the conversation chain and injects at the next boundary (prefix-cache friendly); frequent workflows crystallize into skill checklists that attach automatically, promote after cross-session validation (approvals in the Memory Hub tab, 90-day auto-archive with pinning). **Every "should I interrupt" decision can be reviewed and graded** in the Recall review tab (A activate / P prefetch / S suppress / H harmful / E edit); the review queue digests into policy hints.
|
|
117
|
+
|
|
118
|
+
<p align="center"><img width="720" alt="refine" src="docs/screenshots/panel-refine.png"></p>
|
|
119
|
+
|
|
120
|
+
### Unattended mode — built for batch jobs
|
|
121
|
+
|
|
122
|
+
Running long pipelines or automated flows? Settings → Automation offers **Unattended mode** and **auto-unattended overnight** (22:00-08:00, tunable). While engaged: no greetings, no niceties or behavioural directives, calendar silent, context stable — tokens go to the work, not the small talk.
|
|
123
|
+
|
|
124
|
+
### AI greetings & daily reflections
|
|
125
|
+
|
|
126
|
+
A period-aware greeting (morning/afternoon/evening) that mentions your most important work; return after an hour away and the memory panel auto-opens with "welcome back" plus a recent-work digest; the first session of each day presents yesterday's structured reflection.
|
|
127
|
+
|
|
128
|
+
### Smart search
|
|
129
|
+
|
|
130
|
+
Ask in natural language — the AI expands your query into keywords, scans every memory layer, and answers conversationally with sources cited; cross-workspace search included.
|
|
131
|
+
|
|
132
|
+
### Calendar — maintained by the AI
|
|
133
|
+
|
|
134
|
+
The AI spots deadlines and promises in conversation and files them (`calendar_add`); pending items are injected into later sessions until completed; day view is a 07:00–22:00 timeline with location/reminder fields and urgency-tinted colors.
|
|
135
|
+
|
|
136
|
+
### External memory inheritance
|
|
137
|
+
|
|
138
|
+
Sessions and memories from WorkBuddy / CodeBuddy / Claude Code / Codex are scanned, importable per source (**path pointers only, never copied content**), removable per source; import-side and injection-side hygiene gates keep external dirt out.
|
|
139
|
+
|
|
140
|
+
### Memory hygiene (production-grade write gate)
|
|
141
|
+
|
|
142
|
+
- All three write tools run `sanitizeForWrite`: GBK mojibake (34-feature table), stutter degeneration, consecutive duplicate lines, external-AI-profile JSON signatures, base64 residue — rejected with a human-readable reason
|
|
143
|
+
- Settings → Debug Center "Scan dirty tokens": one-click scan of user memory / notes / logs / reflections, reported by line range (locations only, no content)
|
|
144
|
+
- Caps: 8,000 chars per append, 200,000 per rewrite; appends deduped against the last ~60 lines
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Engineering core (restraint by design)
|
|
149
|
+
|
|
150
|
+
- **Zero runtime dependencies** beyond Node built-ins
|
|
151
|
+
- **Prefix-cache friendly**: byte-stable prompts keep DeepSeek's prefix cache hitting — your history is never re-encoded
|
|
152
|
+
- **Rate-limited AI**: auto-consolidation ≤8×/day with cooldown; useful memory without burning budget
|
|
153
|
+
- **Centralized storage**: all workspace memory under one root (`~/.dsh/memory/workspaces/`), readable from any session
|
|
154
|
+
- **30-day distillation**: old logs are AI-distilled into project notes; originals archived, nothing lost
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## UI gallery
|
|
159
|
+
|
|
160
|
+
### Memory panel · Overview (away greeting + AI period summaries)
|
|
161
|
+
|
|
162
|
+
<img width="480" alt="overview" src="docs/screenshots/panel-overview.png">
|
|
163
|
+
|
|
164
|
+
### Memory Hub · three stores + skill promotion approvals
|
|
165
|
+
|
|
166
|
+
<img width="480" alt="hub" src="docs/screenshots/panel-hub.png">
|
|
167
|
+
|
|
168
|
+
### Recall review · grade every activation decision
|
|
169
|
+
|
|
170
|
+
<img width="720" alt="refine" src="docs/screenshots/panel-refine.png">
|
|
171
|
+
|
|
172
|
+
### Welcome tour · feature switches + engine detection
|
|
173
|
+
|
|
174
|
+
<img width="720" alt="tour" src="docs/screenshots/tour-toggles.png">
|
|
175
|
+
|
|
176
|
+
<details>
|
|
177
|
+
<summary><b>More screenshots</b> (click to expand)</summary>
|
|
178
|
+
|
|
179
|
+
### External memory scan (inside the tour)
|
|
180
|
+
|
|
181
|
+
<img width="720" alt="external scan" src="docs/screenshots/tour-external.png">
|
|
182
|
+
|
|
183
|
+
### Connect other AI tools
|
|
184
|
+
|
|
185
|
+
<img width="480" alt="connect" src="docs/screenshots/connect-en.png">
|
|
186
|
+
|
|
187
|
+
### Calendar view
|
|
188
|
+
|
|
189
|
+
<img width="480" alt="calendar" src="docs/screenshots/calendar-zh.png">
|
|
190
|
+
|
|
191
|
+
### Workspace mind map
|
|
192
|
+
|
|
193
|
+
<img width="480" alt="workspace map" src="docs/screenshots/workspace-map-zh.png">
|
|
194
|
+
|
|
195
|
+
### Settings
|
|
196
|
+
|
|
197
|
+
<img width="480" alt="settings" src="docs/screenshots/settings-en.png">
|
|
198
|
+
<img width="480" alt="settings 2" src="docs/screenshots/settings-2-zh.png">
|
|
199
|
+
|
|
200
|
+
</details>
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Install (one command)
|
|
205
|
+
|
|
206
|
+
> Prerequisite: install [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) and start `dsh web` at least once.
|
|
207
|
+
|
|
208
|
+
Run in the **profile directory** (`~/.dsh/profiles/web`):
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
cd ~/.dsh/profiles/web
|
|
212
|
+
pnpm add @a9i5k4/dsh-auto-memory
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Then edit `package.json` in that directory and append to the `dsh.profile.bundles` array:
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
"@a9i5k4/dsh-auto-memory"
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Restart **dsh web** (the 「Memory」entry appears in the sidebar).
|
|
222
|
+
|
|
223
|
+
> No pnpm? `npm install @a9i5k4/dsh-auto-memory` works the same.
|
|
224
|
+
> pnpm v11 blocks packages published <1 day ago: set `minimumReleaseAge: 0` in pnpm-workspace.yaml or pin an explicit version for same-day updates.
|
|
225
|
+
|
|
226
|
+
### AI-era installation
|
|
227
|
+
|
|
228
|
+
Copy this to the AI assistant you're already using:
|
|
229
|
+
|
|
230
|
+
```text
|
|
231
|
+
Install the npm package @a9i5k4/dsh-auto-memory in the DeepSeek Harness web profile
|
|
232
|
+
directory ~/.dsh/profiles/web (pnpm add or npm install),
|
|
233
|
+
append "@a9i5k4/dsh-auto-memory" to the dsh.profile.bundles array in package.json,
|
|
234
|
+
then restart dsh web to activate the plugin.
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Updating
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
cd ~/.dsh/profiles/web && pnpm up @a9i5k4/dsh-auto-memory
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
The Settings → Auto Memory page has a "Check for updates" button comparing your version with the npm registry; registry installs get a one-click update.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Configuration
|
|
248
|
+
|
|
249
|
+
Config file `~/.dsh/dsh-auto-memory.json` (everything adjustable in the Settings GUI, zh/en UI and panel font size included):
|
|
250
|
+
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"userMemoryDir": "~/.dsh/memory",
|
|
254
|
+
"memoryRoot": "~/.dsh/memory/workspaces",
|
|
255
|
+
"injectEnabled": true,
|
|
256
|
+
"injectBudgetChars": 2400,
|
|
257
|
+
"recentDaysInjected": 1,
|
|
258
|
+
"reflectEnabled": true,
|
|
259
|
+
"autoConsolidate": true,
|
|
260
|
+
"autoConsolidateCooldownMinutes": 30,
|
|
261
|
+
"autoConsolidateDailyMax": 8,
|
|
262
|
+
"unattendedMode": false,
|
|
263
|
+
"unattendedAuto": false,
|
|
264
|
+
"unattendedAutoHours": ["22:00-08:00"],
|
|
265
|
+
"memoryHubEnabled": true,
|
|
266
|
+
"externalSources": { "workbuddy-user": true, "claude-global": true },
|
|
267
|
+
"dayBoundaryMinutes": 450
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
> Full key reference lives in the Settings page — every switch has a description, and every welcome-tour switch maps 1:1 to settings.
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Structure
|
|
276
|
+
|
|
277
|
+
- `lib/index.js` — Host half: engine, injection, tools, routes (zero runtime deps, Node built-ins only)
|
|
278
|
+
- `lib/client.js` — Browser half: memory panel (calendar / mind map) + settings page + welcome tour (zh/en i18n)
|
|
279
|
+
- `python/` — optional Python semantic sidecar (BGE-M3 int8, advanced tier)
|
|
280
|
+
- `cordis.patch.yml` — plugin registration row
|
|
281
|
+
|
|
282
|
+
## Architecture
|
|
283
|
+
|
|
284
|
+
All milestones are implemented and live-verified. The full interactive architecture map lives at [docs/proactive-associative-memory-system-map.html](docs/proactive-associative-memory-system-map.html); the core layering:
|
|
285
|
+
|
|
286
|
+
```
|
|
287
|
+
DeepSeek Harness (Node, 127.0.0.1:3080)
|
|
288
|
+
├─ JS memory core (lib/*_pre.js, zero runtime deps)
|
|
289
|
+
│ M1 session isolation · M2 ContextObserver projection
|
|
290
|
+
│ M3 memory anchoring (anchored records + sidecar identity)
|
|
291
|
+
│ M4 corpus adapter + shadow retrieval host (evidence store)
|
|
292
|
+
│ M5 context/evidence bridge (envelope · coverage · cite/correction)
|
|
293
|
+
│ M6 activation inbox (validate→offer→claim→reference tail→delivered/seen)
|
|
294
|
+
│ lexical_pre_v2 lexical fallback retrieval (BM25 + CJK 2gram, 0GB always-on)
|
|
295
|
+
│ C2 built-in semantic tier (e5-small q8 ~130MB, default)
|
|
296
|
+
└─ Python sidecar M7 (optional, lazy-spawned child process)
|
|
297
|
+
worker_semantic_pre_v1.py
|
|
298
|
+
├─ index_sync: JS-authorized paged index build (digest checks, scope grouping)
|
|
299
|
+
├─ dense: BGE-M3 int8 + para-512 chunks + cosine (R@5 0.925)
|
|
300
|
+
├─ hybrid: dense 0.7 + lexical 0.3 fusion
|
|
301
|
+
└─ fv2 activation policy: two lanes + hard gates (echo/correction/stale/scope)
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Separation of powers**: the Python semantic layer decides *what to recall and when to suggest*; the JS authority layer decides identity, authorization, timing, and delivery — Python never creates evidence nor injects directly. Data flow: `context_push → M5 envelope → decision → M6 fixed-boundary injection → delivered/seen evidence back`.
|
|
305
|
+
|
|
306
|
+
### Design papers
|
|
307
|
+
|
|
308
|
+
The design is not guesswork — every algorithmic conclusion comes from reproducible experiments, frozen into an engineering decision ledger:
|
|
309
|
+
|
|
310
|
+
| Paper | Content |
|
|
311
|
+
|---|---|
|
|
312
|
+
| [Multilingual Embedding Retrieval Study](docs/M7-RESEARCH-PAPER.md) | 3 models × 5 chunkings × 6 retrieval channels ≈ 90 evaluation cells; BGE-M3 leads across the board, frozen as decisions D1–D11 |
|
|
313
|
+
| [Activation v2: The Echo Trap](docs/M7-ACTIVATION-V2-PAPER.md) | Why semantic relevance ≠ recall necessity — activation policy technical report + dual-track deployment architecture (§7) |
|
|
314
|
+
| [Embedding Benchmark Report](docs/M7-EMBEDDING-BENCHMARK.md) | Frozen basis for model/chunk/fusion: bge-m3 + para-512-noov + weighted fusion |
|
|
315
|
+
| [Frozen Algorithm Decisions D1–D11](docs/M7-ALGORITHM-DECISION.md) | The decision ledger from research conclusions to production implementation |
|
|
316
|
+
| [Held-out Human-Gold Acceptance](docs/M7-ACTIVATION-V2-HOLDEDOUT-EVAL.md) | 67 human-labeled verdicts: actPrecision 0.917 / harmful injections 0 / echo tier 7/7 |
|
|
317
|
+
| [Python Sidecar Contract](docs/PYTHON-SIDECAR-CONTRACT.md) | Protocol / lifecycle / authority boundary / per-milestone regression evidence |
|
|
318
|
+
|
|
319
|
+
Papers were authored by the autonomous engineering agent (ZCode / GLM); all conclusions were frozen into the production implementation under human review.
|
|
320
|
+
|
|
321
|
+
## Known limitations
|
|
322
|
+
|
|
323
|
+
- Memory files are plain-text Markdown; no secrets stored unless explicitly requested.
|
|
324
|
+
- `memory_recall` session search depends on the deployed session-query index; without it, only local search works.
|
|
325
|
+
- Plugin-set changes require a dsh restart.
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Community
|
|
330
|
+
|
|
331
|
+
- [@ProperSAMA](https://github.com/ProperSAMA) — panel readability fix for DSH Desktop enhanced mode (transparent/Mica materials) + entry-button anti-occlusion & outside-click/Esc close ([PR #12](https://github.com/Aik358/dsh-auto-memory/pull/12))
|
|
332
|
+
- [@nkh0472](https://github.com/nkh0472) — unattended/batch workflow hardening feedback that drove the welcome tour and per-feature switches ([Issue #10](https://github.com/Aik358/dsh-auto-memory/issues/10))
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Credits
|
|
337
|
+
|
|
338
|
+
This project is built human-machine collaboratively. In addition to engineering and community contributions above:
|
|
339
|
+
|
|
340
|
+
- **Aik358** — project owner: product direction, architecture, and engineering.
|
|
341
|
+
- **ZCode (GLM, Z.ai)** — autonomous engineering agent: M-series semantic-engine implementation, benchmark research papers ([M7-RESEARCH-PAPER](docs/M7-RESEARCH-PAPER.md) / [Activation v2 report](docs/M7-ACTIVATION-V2-PAPER.md)), regression suites, and the landing-page design/build.
|
|
342
|
+
- **Kimi K3 (Moonshot AI)** — frontend agent: contributed to the v0.1.30 welcome-tour interface assets and visual QA.
|
|
343
|
+
|
|
344
|
+
AI agents are credited as authors of the research papers and parts of the implementation, under human review and direction.
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Release
|
|
349
|
+
|
|
350
|
+
- GitHub: https://github.com/Aik358/dsh-auto-memory
|
|
351
|
+
- npm: `@a9i5k4/dsh-auto-memory`
|
|
352
|
+
- License: BSD-3-Clause
|