@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 CHANGED
@@ -1,289 +1,227 @@
1
- # dsh-auto-memory — DSH Auto Memory Plugin / DSH 自动记忆插件
2
-
3
- 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.
4
-
5
- DSH Web GUI 的记忆插件:三层记忆自动注入与检索、每日反思、AI 时段问候与三级抽屉、每轮自动沉淀、智能检索、日历视图与设置页,支持继承其他 AI 工具的历史记忆。
6
-
7
- [**English**](README.md) | [中文版](README.zh-CN.md)
8
-
9
- ---
10
-
11
- ## Features
12
-
13
- ### Three-layer Memory
14
-
15
- | Layer | Location | Description |
16
- |---|---|---|
17
- | User-level memory | `~/.dsh/memory/MEMORY.md` | Cross-project rules & preferences |
18
- | Project notes | `~/.dsh/memory/workspaces/{workspace}/MEMORY.md` | Project conventions & decisions (centralized) |
19
- | Daily logs | `~/.dsh/memory/workspaces/{workspace}/YYYY-MM-DD.md` | Append-only work log (centralized) |
20
- | Reflections | `~/.dsh/memory/workspaces/{workspace}/reflections/YYYY-MM-DD.md` | Daily reflection (structured, kept in background) |
21
-
22
- > **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).
23
-
24
- - **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
25
- - **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
26
-
27
- ### Auto-Consolidation — memory writes itself after every turn (v0.1.9)
28
-
29
- 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:
30
-
31
- - **Today's log** gets entries like `- 21:03 [自动沉淀] …` — no manual `memory_log` needed for routine work
32
- - **Long-term value is promoted**: project decisions/architecture → project notes (with a `## YYYY-MM-DD` heading); cross-project rules → user-level memory
33
- - **Small talk is skipped** (content threshold `autoConsolidateMinChars`), each turn is deduplicated by turn number, subagent turns are ignored
34
- - **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
35
- - **`memory_consolidate` tool**: read recent logs and distill long-term decisions / architecture / user preferences into MEMORY.md on demand ("dream-like" consolidation)
36
- - Configurable in `~/.dsh/dsh-auto-memory.json`: `autoConsolidate` (default true), `autoConsolidateMinChars` (default 60)
37
-
38
- ### AI Greetings & Three-level Drawers (Overview page, v0.1.9)
39
-
40
- The first thing you see when opening the memory panel is an **AI-generated** period greeting, not a template and not technical info:
41
-
42
- - **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
43
- - **Drawer titles are the AI summaries**: the "Today afternoon / Today evening" window titles are replaced with the AI's casual summary text itself
44
- - **Three-level drawer structure**:
45
- - Level 1: period drawer, titled with the AI summary
46
- - Level 2: inside it, small drawers — one per work item the AI distilled (with a point count)
47
- - Level 3: expand a work item to read its detail points
48
- - **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
49
- - **Smart timing**: if you were away for more than 1 hour and come back, the greeting says "Welcome back" with what was finished meanwhile
50
- - **Daily reflection stays in background**: structured reflections (results / lessons / next steps) are kept, while the front page only shows a light greeting
51
-
52
- ### Smart Search (Search tab, v0.1.9)
53
-
54
- The Search tab adds a **Smart search** button next to the keyword search:
55
-
56
- - The AI expands your natural-language query into 3-6 keywords (e.g. "last time publishing npm hit a snag" → 发布 / 踩坑 / GitHub / npm / 推送)
57
- - Scans all three memory layers plus reflections with those keywords
58
- - 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
59
- - Raw keyword hits with their sources are listed under the answer
60
-
61
- ### Calendar View (Four Quadrants)
62
-
63
- 「Calendar」tab (liquid-glass monthly view):
64
-
65
- - Monthly grid, today highlighted, click any date to add an item
66
- - **Four-quadrant colors**: Urgent & Important (red) / Important (blue) / Urgent (orange) / Neither (gray)
67
- - Click an item to toggle done, click again to delete; legend + weekday header
68
- - **Cross-conversation persistence**: data lives at user level `~/.dsh/memory/CALENDAR.md`, shared across workspaces, survives DSH reinstall
69
- - **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
70
-
71
- ### Agent Tools
72
-
73
- `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`
74
-
75
- ### UI
76
-
77
- - Sidebar 「Memory」entry floating panel (Overview / Logs / Notes / Reflections / Connect / Calendar / Search)
78
- - 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
79
- - **External memory inheritance**: import memories accumulated by other AI tools (CodeBuddy / Claude Code / Codex / project convention files)
80
-
81
- ---
82
-
83
- ## Demos
84
-
85
- ### 1. Auto-consolidation in action
86
-
87
- You finish a conversation turn no memory commands needed. The moment the turn ends, the plugin writes a topic-grouped entry into today's log:
88
-
89
- ```
90
- ── Chat ──────────────────────────────────────────────────
91
-
92
- You: 我把抽屉的 bug 修好了,顺便加了字号功能,设置页可以调,默认大号。
93
-
94
- AI: 已把 X 记入今日日志。 (回复末尾加粗转述,记忆操作对用户可见)
95
-
96
- ── Turn ends auto-consolidation writes to .dsh-memory/2026-08-14.md ──
97
-
98
- ## 修复抽屉bug与字号功能(22:30)
99
- - 修复了抽屉 bug
100
- - 新增界面字号功能(设置页,默认大号)
101
- ```
102
-
103
- Long-term decisions are promoted to project notes with a `## YYYY-MM-DD` heading automatically. If the AI call fails, the entry is queued and retried by the 5-minute polling loop.
104
-
105
- ### 2. AI greeting & three-level drawers
106
-
107
- Click the 「Memory」 button the floating panel opens with an AI-written greeting, cross-workspace summaries, and drawers titled by the AI summaries themselves:
108
-
109
- ```
110
- ┌──────────────────────────────────────────────────────┐
111
- 自动记忆 ⤾ ⟳ ✕ │
112
- ├──────────────────────────────────────────────────────┤
113
- │ 概览 │ 日志 │ 笔记 │ 反思 │ 接续 │ 日历 │ 检索 │ 工作区 │
114
- ├──────────────────────────────────────────────────────┤
115
- │ 晚上好 · 晚上 │
116
- │ │
117
- │ 晚上好,这一晚上你收获满满呀。把 Ark9Tools 扩展框架整个 │
118
- 捋了一遍,冒烟测试 18 项全过,还一口气把 dsh-auto-memory │
119
- 推到 0.1.9… │
120
- │ │
121
- 工作区总结(跨工作区) ────────────────────────────┐ │
122
- dsh_debug · 8-10 ~ 8-14 │ │
123
- │ │ 主要在做 dsh-auto-memory 插件,逐步发布 v0.1.x… │ │
124
- · 8-14: v0.1.9 系列功能落地 │ │
125
- │ │ · 8-13: 中文乱码与 no-branches 修复 │ │
126
- └────────────────────────────────────────────────┘ │
127
- │ │
128
- ▼ 下午把 dsh-auto-memory 完整发布出去了… │
129
- │ 今日下午 · 10 条日志 · 生成于 21:28 │
130
- │ ▸ 发布与收尾 (3 )
131
- │ ▸ 修复发布过程中的坑 (2 )
132
- │ │
133
- │ ▼ 晚上搭建了扩展框架… │
134
- │ 今日晚上 · 7 条日志 · 生成于 21:28 │
135
- │ ▸ EventBus 与服务容器 (4 项) │
136
- └──────────────────────────────────────────────────────┘
137
- ```
138
-
139
- Tap any small drawer (▸) to read its detail points. Greetings and summaries are cached per period — reopening the panel costs no API calls; the ⟳ button forces fresh generation.
140
-
141
- ### 3. Smart search
142
-
143
- Type a natural-language question in the Search tab and hit 「智能检索」:
144
-
145
- ```
146
- ┌──────────────────────────────────────────────────────┐
147
- │ 检索: [上次发布 npm 包踩了什么坑 ] [检索] [智能检索]│
148
- ├──────────────────────────────────────────────────────┤
149
- │ ┌ 智能回答 ───────────────────────────────────────┐ │
150
- 上次发布踩了三个坑:GitHub 中文 description 乱码 │ │
151
- │ │ (PowerShell GBK,改用 Node fetch);第一次 push │ │
152
- 实际没成功(凭据管理器拦截,需 -c credential.helper=);│
153
- │ │ npm 2FA 需要 Automation 令牌。以上来自 │ │
154
- 2026-08-14 日志。 │ │
155
- │ └────────────────────────────────────────────────┘ │
156
- 关键词: 发布 / 踩坑 / GitHub / npm / 推送 │
157
- │ · [2026-08-14.md] 发布完成:①GitHub 仓库已建… │
158
- · [reflections/2026-08-14.md] 成果回顾:… │
159
- └──────────────────────────────────────────────────────┘
160
- ```
161
-
162
- The AI expands your query into 3-6 keywords, scans all memory layers, then composes a conversational answer citing its sources — never fabricating facts.
163
-
164
- ### 4. AI-maintained calendar
165
-
166
- Mention a deadline in chatthe AI writes it into the calendar and says so in plain text:
167
-
168
- ```
169
- ── Chat ──────────────────────────────────────────────────
170
-
171
- You: 周五 10 点要交周报,别忘了。
172
-
173
- AI: 已把『2026-08-15 10:00 交周报』记入日历(重要不紧急)。
174
-
175
- ── Calendar tab · 2026 年 8 月 ──────────────────────────
176
-
177
- 一 二 三 四 五 六 日
178
- 11 12 13 14 [15]
179
- 交周报
180
- ```
181
-
182
- Pending items are injected into every future session's system prompt until completed — the AI reminds you without being asked.
183
-
184
- ---
185
-
186
- ## Installation (one command)
187
-
188
- > Prerequisite: install [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) and start `dsh web` at least once.
189
-
190
- Run in the **profile directory** (`~/.dsh/profiles/web`):
191
-
192
- ```bash
193
- cd ~/.dsh/profiles/web
194
- pnpm add @a9i5k4/dsh-auto-memory
195
- ```
196
-
197
- Then edit `package.json` in that directory and append to the `dsh.profile.bundles` array:
198
-
199
- ```json
200
- "@a9i5k4/dsh-auto-memory"
201
- ```
202
-
203
- Restart **dsh web** to activate (the 「Memory」entry appears in the sidebar).
204
-
205
- > No pnpm? Use npm: `npm install @a9i5k4/dsh-auto-memory`
206
-
207
- ## Updating (check & upgrade)
208
-
209
- The plugin is a normal npm package, so updating is one command in the same profile directory:
210
-
211
- ```bash
212
- cd ~/.dsh/profiles/web
213
- pnpm up @a9i5k4/dsh-auto-memory # or: npm install @a9i5k4/dsh-auto-memory@latest
214
- ```
215
-
216
- Then restart **dsh web**.
217
-
218
- 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).
219
-
220
- ---
221
-
222
- ## AI-Era Installation (copy-paste for your AI)
223
-
224
- > 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.
225
-
226
- ```text
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