@a9i5k4/dsh-auto-memory 0.1.10 → 0.1.12
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 +226 -288
- package/README.zh-CN.md +232 -286
- package/lib/client.js +101 -62
- package/lib/index.js +2 -2
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -1,289 +1,227 @@
|
|
|
1
|
-
# dsh-auto-memory — DSH Auto Memory Plugin / DSH 自动记忆插件
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
The
|
|
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
|
-
|
|
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
|
-
Install the npm package @a9i5k4/dsh-auto-memory in the DeepSeek Harness web profile
|
|
228
|
-
directory ~/.dsh/profiles/web (run "pnpm add @a9i5k4/dsh-auto-memory" or "npm install @a9i5k4/dsh-auto-memory"),
|
|
229
|
-
append "@a9i5k4/dsh-auto-memory" to the dsh.profile.bundles array in package.json,
|
|
230
|
-
then restart dsh web to activate the plugin.
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
|
-
## Configuration
|
|
236
|
-
|
|
237
|
-
Defaults (JSON file `~/.dsh/dsh-auto-memory.json`):
|
|
238
|
-
|
|
239
|
-
```json
|
|
240
|
-
{
|
|
241
|
-
"userMemoryDir": "~/.dsh/memory",
|
|
242
|
-
"projectMemoryDir": ".dsh-memory",
|
|
243
|
-
"injectEnabled": true,
|
|
244
|
-
"injectBudgetChars": 2400,
|
|
245
|
-
"recentDaysInjected": 3,
|
|
246
|
-
"reflectEnabled": true,
|
|
247
|
-
"reflectStyle": "auto",
|
|
248
|
-
"locale": "zh",
|
|
249
|
-
"autoConsolidate": true,
|
|
250
|
-
"autoConsolidateMinChars": 60,
|
|
251
|
-
"memoryRoot": "~/.dsh/memory/workspaces",
|
|
252
|
-
"dayBoundaryMinutes": 450
|
|
253
|
-
}
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
Adjustable in the GUI (Settings → Auto Memory), including the UI language (zh / en), the panel font size and the day boundary.
|
|
257
|
-
|
|
258
|
-
### v0.1.9 hardening (budget / boundary / picker)
|
|
259
|
-
|
|
260
|
-
- **Daily write budget with auto-compaction**: user memory ≤ 4000 chars/day, project notes ≤ 3000 chars/day (shared across sessions, reset at the day boundary). Going over the budget never rejects the write — the framework compacts the pre-today sections with an AI pass (merge duplicates, drop stale entries, keep hard facts) and then writes; if AI is unavailable, the oldest sections are archived to `archived-user.md` / `archive/notes-archived.md` (nothing is lost). Compaction is throttled to once per 10 minutes.
|
|
261
|
-
- **Day boundary (late-night belongs to yesterday)**: `dayBoundaryMinutes` (default 450 = 07:30). Work logged before the boundary is appended to the previous day's log, and the daily reflection for the previous day starts only after the boundary — no more "it's 00:30, tell me what you did yesterday" right after midnight.
|
|
262
|
-
- **Native OS folder picker**: the "Browse…" button next to the memory root opens the real system folder picker (via the DSH directory-picker native backend); falls back to the in-app browser when no native picker is available. Changing the root auto-migrates existing workspace memory folders to the new location (old files are kept) and all path variables follow the new config on the next refresh.
|
|
263
|
-
- **30-day distillation**: `memory_maintain` distills logs older than 30 days with an AI pass into the project notes, archives the originals under `archive/`, and removes them from the active log list.
|
|
264
|
-
- **First-turn injection guarantee**: a `pre-step` hook awaits the memory state refresh before the first step, so the model sees memory from the very first token (previously the async load could leave the first turn empty).
|
|
265
|
-
- **Per-step reminder with timestamp**: the injected discipline block carries a live `HH:MM:SS` timestamp that refreshes on every prompt assembly, and a 15-second heartbeat file proves the background loop is alive.
|
|
266
|
-
|
|
267
|
-
---
|
|
268
|
-
|
|
269
|
-
## Structure
|
|
270
|
-
|
|
271
|
-
- `lib/index.js` — Host half: engine, injection, tools, routes (zero runtime deps, Node built-ins only)
|
|
272
|
-
- `lib/client.js` — Browser half: memory panel (with calendar view) + settings page (built-in zh/en i18n)
|
|
273
|
-
- `cordis.patch.yml` — Plugin row (`auto-memory`)
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
## Limitations
|
|
278
|
-
|
|
279
|
-
- Memory files are plain-text Markdown; no secrets stored unless explicitly requested.
|
|
280
|
-
- `memory_recall` session search depends on the deployed session-query index; without it, only local search works.
|
|
281
|
-
- Plugin-set changes require a dsh restart.
|
|
282
|
-
|
|
283
|
-
---
|
|
284
|
-
|
|
285
|
-
## Release Info
|
|
286
|
-
|
|
287
|
-
- GitHub: https://github.com/Aik358/dsh-auto-memory
|
|
288
|
-
- npm: `@a9i5k4/dsh-auto-memory`
|
|
1
|
+
# dsh-auto-memory — DSH Auto Memory Plugin / DSH 自动记忆插件
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img width="820" alt="dsh-auto-memory banner" src="docs/banner.jpg">
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
An auto-memory plugin for the DeepSeek Harness Web GUI: three-layer memory (user-level / project notes / daily logs) with automatic injection and retrieval, daily reflections, AI period greetings with three-level drawers, auto-consolidation after every turn, smart search, a calendar view and settings page, and inheritance of memories from other AI tools.
|
|
8
|
+
|
|
9
|
+
DSH Web GUI 的记忆插件:三层记忆自动注入与检索、每日反思、AI 时段问候与三级抽屉、每轮自动沉淀、智能检索、日历视图与设置页,支持继承其他 AI 工具的历史记忆。
|
|
10
|
+
|
|
11
|
+
> **Quick install**: `cd ~/.dsh/profiles/web` → `pnpm add @a9i5k4/dsh-auto-memory` → append `"@a9i5k4/dsh-auto-memory"` to `dsh.profile.bundles` in that directory's `package.json` → restart **dsh web** (the 「Memory」entry appears in the sidebar). Full instructions in [Installation](#installation-one-command); no-pnpm alternative: `npm install @a9i5k4/dsh-auto-memory`.
|
|
12
|
+
|
|
13
|
+
[**English**](README.md) | [中文版](README.zh-CN.md)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation (one command)
|
|
18
|
+
|
|
19
|
+
> Prerequisite: install [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) and start `dsh web` at least once.
|
|
20
|
+
|
|
21
|
+
Run in the **profile directory** (`~/.dsh/profiles/web`):
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cd ~/.dsh/profiles/web
|
|
25
|
+
pnpm add @a9i5k4/dsh-auto-memory
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then edit `package.json` in that directory and append to the `dsh.profile.bundles` array:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
"@a9i5k4/dsh-auto-memory"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Restart **dsh web** to activate (the 「Memory」entry appears in the sidebar).
|
|
35
|
+
|
|
36
|
+
> No pnpm? Use npm: `npm install @a9i5k4/dsh-auto-memory`
|
|
37
|
+
|
|
38
|
+
## Updating (check & upgrade)
|
|
39
|
+
|
|
40
|
+
The plugin is a normal npm package, so updating is one command in the same profile directory:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
cd ~/.dsh/profiles/web
|
|
44
|
+
pnpm up @a9i5k4/dsh-auto-memory # or: npm install @a9i5k4/dsh-auto-memory@latest
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Then restart **dsh web**.
|
|
48
|
+
|
|
49
|
+
The Settings → Auto Memory page has a **Check for updates** button that compares your installed version with the latest one on the npm registry (it shows the update command when a newer version exists).
|
|
50
|
+
|
|
51
|
+
## AI-Era Installation (copy-paste for your AI)
|
|
52
|
+
|
|
53
|
+
> It's the AI era — just copy the sentence below to your AI assistant (DeepSeek / Claude / Codex etc.) and it will do the installation for you.
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
Install the npm package @a9i5k4/dsh-auto-memory in the DeepSeek Harness web profile
|
|
57
|
+
directory ~/.dsh/profiles/web (run "pnpm add @a9i5k4/dsh-auto-memory" or "npm install @a9i5k4/dsh-auto-memory"),
|
|
58
|
+
append "@a9i5k4/dsh-auto-memory" to the dsh.profile.bundles array in package.json,
|
|
59
|
+
then restart dsh web to activate the plugin.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Features
|
|
65
|
+
|
|
66
|
+
### Three-layer Memory
|
|
67
|
+
|
|
68
|
+
| Layer | Location | Description |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| User-level memory | `~/.dsh/memory/MEMORY.md` | Cross-project rules & preferences |
|
|
71
|
+
| Project notes | `~/.dsh/memory/workspaces/{workspace}/MEMORY.md` | Project conventions & decisions (centralized) |
|
|
72
|
+
| Daily logs | `~/.dsh/memory/workspaces/{workspace}/YYYY-MM-DD.md` | Append-only work log (centralized) |
|
|
73
|
+
| Reflections | `~/.dsh/memory/workspaces/{workspace}/reflections/YYYY-MM-DD.md` | Daily reflection (structured, kept in background) |
|
|
74
|
+
|
|
75
|
+
> **Centralized storage (WorkBuddy-style)**: all workspace memories live under one root — `~/.dsh/memory/workspaces/`, one subdirectory per workspace (readable by any model in any session via injection + cross-workspace `memory_recall`). Legacy per-workspace `.dsh-memory/` folders are auto-migrated on first run after upgrade (the old copies are kept, not deleted).
|
|
76
|
+
|
|
77
|
+
- **Auto injection (at the end of the system prompt)**: every prompt gets a `<memory_system>` block (user rules + project notes + recent reflections + recent N days of log tails + pending calendar items + writing discipline); it is placed at the very end of the system prompt so the model reads the memory discipline right before replying
|
|
78
|
+
- **Visible memory ops**: when the AI updates or searches memory, it says so in plain text in the chat reply (e.g. "Logged X to today's journal", "I checked memory and found..."), not hidden inside tool calls
|
|
79
|
+
|
|
80
|
+
### Auto-Consolidation — memory writes itself after every turn (v0.1.9)
|
|
81
|
+
|
|
82
|
+
Every finished conversation turn is automatically evaluated (via a small subagent) and anything worth keeping is written for you — no reliance on the model remembering to log:
|
|
83
|
+
|
|
84
|
+
- **Today's log** gets entries like `- 21:03 [自动沉淀] …` — no manual `memory_log` needed for routine work
|
|
85
|
+
- **Long-term value is promoted**: project decisions/architecture → project notes (with a `## YYYY-MM-DD` heading); cross-project rules → user-level memory
|
|
86
|
+
- **Small talk is skipped** (content threshold `autoConsolidateMinChars`), each turn is deduplicated by turn number, subagent turns are ignored
|
|
87
|
+
- **Agent traces in the GUI**: the overview shows "Auto-consolidated N points today (latest HH:MM)"; the panel refreshes on open, every 30s while open, and via the ⟳ button
|
|
88
|
+
- **`memory_consolidate` tool**: read recent logs and distill long-term decisions / architecture / user preferences into MEMORY.md on demand ("dream-like" consolidation)
|
|
89
|
+
- Configurable in `~/.dsh/dsh-auto-memory.json`: `autoConsolidate` (default true), `autoConsolidateMinChars` (default 60)
|
|
90
|
+
|
|
91
|
+
### AI Greetings & Three-level Drawers (Overview page, v0.1.9)
|
|
92
|
+
|
|
93
|
+
The first thing you see when opening the memory panel is an **AI-generated** period greeting, not a template and not technical info:
|
|
94
|
+
|
|
95
|
+
- **AI-written greeting**: a subagent writes a warm, casual greeting for the current period (morning / forenoon / noon / afternoon / evening), mentioning your most important work of the day; generated once per period per day and cached in `.dsh-memory/greetings/` — no repeated API cost
|
|
96
|
+
- **Drawer titles are the AI summaries**: the "Today afternoon / Today evening" window titles are replaced with the AI's casual summary text itself
|
|
97
|
+
- **Three-level drawer structure**:
|
|
98
|
+
- Level 1: period drawer, titled with the AI summary
|
|
99
|
+
- Level 2: inside it, small drawers — one per work item the AI distilled (with a point count)
|
|
100
|
+
- Level 3: expand a work item to read its detail points
|
|
101
|
+
- **Summaries are cached**: structured results live in `.dsh-memory/summaries/`; opening the panel reads the cache (offline-friendly, no regeneration); the ⟳ refresh button or returning after >1h away forces a fresh generation; every summary shows its generation time
|
|
102
|
+
- **Smart timing**: if you were away for more than 1 hour and come back, the greeting says "Welcome back" with what was finished meanwhile
|
|
103
|
+
- **Daily reflection stays in background**: structured reflections (results / lessons / next steps) are kept, while the front page only shows a light greeting
|
|
104
|
+
|
|
105
|
+
### Smart Search (Search tab, v0.1.9)
|
|
106
|
+
|
|
107
|
+
The Search tab adds a **Smart search** button next to the keyword search:
|
|
108
|
+
|
|
109
|
+
- The AI expands your natural-language query into 3-6 keywords (e.g. "last time publishing npm hit a snag" → 发布 / 踩坑 / GitHub / npm / 推送)
|
|
110
|
+
- Scans all three memory layers plus reflections with those keywords
|
|
111
|
+
- The AI then composes a **conversational answer** in natural language, citing where each fact came from (log date / project note / user-level memory) — it never fabricates facts not present in memory
|
|
112
|
+
- Raw keyword hits with their sources are listed under the answer
|
|
113
|
+
|
|
114
|
+
### Calendar View (Four Quadrants)
|
|
115
|
+
|
|
116
|
+
「Calendar」tab (liquid-glass monthly view):
|
|
117
|
+
|
|
118
|
+
- Monthly grid, today highlighted, click any date to add an item
|
|
119
|
+
- **Four-quadrant colors**: Urgent & Important (red) / Important (blue) / Urgent (orange) / Neither (gray)
|
|
120
|
+
- Click an item to toggle done, click again to delete; legend + weekday header
|
|
121
|
+
- **Cross-conversation persistence**: data lives at user level `~/.dsh/memory/CALENDAR.md`, shared across workspaces, survives DSH reinstall
|
|
122
|
+
- **AI-maintained**: the AI extracts deadlines and appointments from conversations and writes them to the calendar automatically (`calendar_add` / `calendar_list` / `calendar_done` / `calendar_remove`), restating it in plain text; pending items are injected into every session's system prompt
|
|
123
|
+
|
|
124
|
+
### Agent Tools
|
|
125
|
+
|
|
126
|
+
`memory_log` / `memory_note` / `memory_user` / `memory_recall` / `memory_external` / `memory_maintain` / `memory_status` / `memory_reflect` / `memory_consolidate` / `calendar_add` / `calendar_list` / `calendar_done` / `calendar_remove`
|
|
127
|
+
|
|
128
|
+
### UI
|
|
129
|
+
|
|
130
|
+
- Sidebar 「Memory」entry → floating panel (Overview / Logs / Notes / Reflections / Connect / Calendar / Search)
|
|
131
|
+
- Settings page (Settings → Auto Memory): storage paths, injection budget, reflection style, UI language (中文 / English), **panel font size (Small / Normal / Large / Extra large, default Large)** — applies immediately, no save needed
|
|
132
|
+
- **External memory inheritance**: import memories accumulated by other AI tools (CodeBuddy / Claude Code / Codex / project convention files)
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Screenshots
|
|
137
|
+
|
|
138
|
+
All screenshots below are real captures of the plugin running inside the DSH Web GUI.
|
|
139
|
+
|
|
140
|
+
### Main interface — the Auto Memory panel (Connect tab)
|
|
141
|
+
|
|
142
|
+
<img width="480" alt="Auto Memory panel in the DSH web UI" src="docs/screenshots/main-connect-en.png">
|
|
143
|
+
|
|
144
|
+
### Connect tab — inherit memories accumulated by other AI tools
|
|
145
|
+
|
|
146
|
+
<img width="480" alt="Connect tab" src="docs/screenshots/connect-en.png">
|
|
147
|
+
|
|
148
|
+
### Overview — AI-written greeting, today's drawers & cross-workspace summaries
|
|
149
|
+
|
|
150
|
+
<img width="480" alt="Overview tab" src="docs/screenshots/overview-en.png">
|
|
151
|
+
|
|
152
|
+
### Calendar — AI-maintained four-quadrant schedule
|
|
153
|
+
|
|
154
|
+
<img width="480" alt="Calendar tab" src="docs/screenshots/calendar-en.png">
|
|
155
|
+
|
|
156
|
+
### Reflections — structured daily reviews
|
|
157
|
+
|
|
158
|
+
<img width="480" alt="Reflections tab" src="docs/screenshots/reflections-en.png">
|
|
159
|
+
|
|
160
|
+
### Settings — memory storage, day boundary, daily budget, update check
|
|
161
|
+
|
|
162
|
+
<img width="480" alt="Auto Memory settings" src="docs/screenshots/settings-en.png">
|
|
163
|
+
|
|
164
|
+
## Beyond the screenshots
|
|
165
|
+
|
|
166
|
+
- **Auto-consolidation**: every finished turn is evaluated by a small subagent and topic-grouped entries are written to today's log automatically (`## 主题(HH:MM)` + bullet points) — no `memory_log` needed for routine work. Long-term value is promoted to project notes / user-level memory, small talk is skipped, failures are queued and retried every 5 minutes (a 15-second heartbeat file proves the loop is alive).
|
|
167
|
+
- **Smart search**: ask in natural language — the AI expands your query into keywords, scans every memory layer, then answers conversationally with sources cited.
|
|
168
|
+
- **Calendar reminders**: pending items are injected into future sessions' system prompts until completed — the AI reminds you without being asked.
|
|
169
|
+
- **One-click update**: the settings page shows your installed version vs. the npm registry latest; registry installs get a one-click update button (pnpm/npm runs under the hood), then restart to apply.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Configuration
|
|
174
|
+
|
|
175
|
+
Defaults (JSON file `~/.dsh/dsh-auto-memory.json`):
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"userMemoryDir": "~/.dsh/memory",
|
|
180
|
+
"projectMemoryDir": ".dsh-memory",
|
|
181
|
+
"injectEnabled": true,
|
|
182
|
+
"injectBudgetChars": 2400,
|
|
183
|
+
"recentDaysInjected": 3,
|
|
184
|
+
"reflectEnabled": true,
|
|
185
|
+
"reflectStyle": "auto",
|
|
186
|
+
"locale": "zh",
|
|
187
|
+
"autoConsolidate": true,
|
|
188
|
+
"autoConsolidateMinChars": 60,
|
|
189
|
+
"memoryRoot": "~/.dsh/memory/workspaces",
|
|
190
|
+
"dayBoundaryMinutes": 450
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Adjustable in the GUI (Settings → Auto Memory), including the UI language (zh / en), the panel font size and the day boundary.
|
|
195
|
+
|
|
196
|
+
### v0.1.9 hardening (budget / boundary / picker)
|
|
197
|
+
|
|
198
|
+
- **Daily write budget with auto-compaction**: user memory ≤ 4000 chars/day, project notes ≤ 3000 chars/day (shared across sessions, reset at the day boundary). Going over the budget never rejects the write — the framework compacts the pre-today sections with an AI pass (merge duplicates, drop stale entries, keep hard facts) and then writes; if AI is unavailable, the oldest sections are archived to `archived-user.md` / `archive/notes-archived.md` (nothing is lost). Compaction is throttled to once per 10 minutes.
|
|
199
|
+
- **Day boundary (late-night belongs to yesterday)**: `dayBoundaryMinutes` (default 450 = 07:30). Work logged before the boundary is appended to the previous day's log, and the daily reflection for the previous day starts only after the boundary — no more "it's 00:30, tell me what you did yesterday" right after midnight.
|
|
200
|
+
- **Native OS folder picker**: the "Browse…" button next to the memory root opens the real system folder picker (via the DSH directory-picker native backend); falls back to the in-app browser when no native picker is available. Changing the root auto-migrates existing workspace memory folders to the new location (old files are kept) and all path variables follow the new config on the next refresh.
|
|
201
|
+
- **30-day distillation**: `memory_maintain` distills logs older than 30 days with an AI pass into the project notes, archives the originals under `archive/`, and removes them from the active log list.
|
|
202
|
+
- **First-turn injection guarantee**: a `pre-step` hook awaits the memory state refresh before the first step, so the model sees memory from the very first token (previously the async load could leave the first turn empty).
|
|
203
|
+
- **Per-step reminder with timestamp**: the injected discipline block carries a live `HH:MM:SS` timestamp that refreshes on every prompt assembly, and a 15-second heartbeat file proves the background loop is alive.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Structure
|
|
208
|
+
|
|
209
|
+
- `lib/index.js` — Host half: engine, injection, tools, routes (zero runtime deps, Node built-ins only)
|
|
210
|
+
- `lib/client.js` — Browser half: memory panel (with calendar view) + settings page (built-in zh/en i18n)
|
|
211
|
+
- `cordis.patch.yml` — Plugin row (`auto-memory`)
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Limitations
|
|
216
|
+
|
|
217
|
+
- Memory files are plain-text Markdown; no secrets stored unless explicitly requested.
|
|
218
|
+
- `memory_recall` session search depends on the deployed session-query index; without it, only local search works.
|
|
219
|
+
- Plugin-set changes require a dsh restart.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Release Info
|
|
224
|
+
|
|
225
|
+
- GitHub: https://github.com/Aik358/dsh-auto-memory
|
|
226
|
+
- npm: `@a9i5k4/dsh-auto-memory`
|
|
289
227
|
- License: BSD-3-Clause
|