@a9i5k4/dsh-auto-memory 0.1.25 → 0.1.26
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 +253 -234
- package/README.zh-CN.md +251 -232
- package/lib/client.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,234 +1,253 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
DSH Web GUI
|
|
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
|
-
> pnpm v11 默认限制安装发布不足 1 天的版本。当天发布想立即拿到新版,在 profile 目录的 pnpm-workspace.yaml 加 `minimumReleaseAge: 0`,或用显式版本 `pnpm add @a9i5k4/dsh-auto-memory@0.1.16`。(pnpm v11 blocks packages published <1 day ago; set `minimumReleaseAge: 0` in pnpm-workspace.yaml or use an explicit version for same-day releases.)
|
|
29
|
-
|
|
30
|
-
Then edit `package.json` in that directory and append to the `dsh.profile.bundles` array:
|
|
31
|
-
|
|
32
|
-
```json
|
|
33
|
-
"@a9i5k4/dsh-auto-memory"
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Restart **dsh web** to activate (the 「Memory」entry appears in the sidebar).
|
|
37
|
-
|
|
38
|
-
> No pnpm? Use npm: `npm install @a9i5k4/dsh-auto-memory`
|
|
39
|
-
|
|
40
|
-
## Updating (check & upgrade)
|
|
41
|
-
|
|
42
|
-
The plugin is a normal npm package, so updating is one command in the same profile directory:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
cd ~/.dsh/profiles/web
|
|
46
|
-
pnpm up @a9i5k4/dsh-auto-memory # or: npm install @a9i5k4/dsh-auto-memory@latest
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Then restart **dsh web**.
|
|
50
|
-
|
|
51
|
-
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).
|
|
52
|
-
|
|
53
|
-
## AI-Era Installation (copy-paste for your AI)
|
|
54
|
-
|
|
55
|
-
> 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.
|
|
56
|
-
|
|
57
|
-
```text
|
|
58
|
-
Install the npm package @a9i5k4/dsh-auto-memory in the DeepSeek Harness web profile
|
|
59
|
-
directory ~/.dsh/profiles/web (run "pnpm add @a9i5k4/dsh-auto-memory" or "npm install @a9i5k4/dsh-auto-memory"),
|
|
60
|
-
append "@a9i5k4/dsh-auto-memory" to the dsh.profile.bundles array in package.json,
|
|
61
|
-
then restart dsh web to activate the plugin.
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
##
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- **
|
|
80
|
-
- **Lean
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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
|
+
A cache-friendly three-layer memory engine for the DeepSeek Harness Web GUI — lean auto injection, per-turn AI consolidation, on-demand reads and cross-tool memory inheritance — wrapped in human touches: proactive calendar reminders, warm AI greetings, and a daily journal that writes itself.
|
|
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
|
+
> pnpm v11 默认限制安装发布不足 1 天的版本。当天发布想立即拿到新版,在 profile 目录的 pnpm-workspace.yaml 加 `minimumReleaseAge: 0`,或用显式版本 `pnpm add @a9i5k4/dsh-auto-memory@0.1.16`。(pnpm v11 blocks packages published <1 day ago; set `minimumReleaseAge: 0` in pnpm-workspace.yaml or use an explicit version for same-day releases.)
|
|
29
|
+
|
|
30
|
+
Then edit `package.json` in that directory and append to the `dsh.profile.bundles` array:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
"@a9i5k4/dsh-auto-memory"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Restart **dsh web** to activate (the 「Memory」entry appears in the sidebar).
|
|
37
|
+
|
|
38
|
+
> No pnpm? Use npm: `npm install @a9i5k4/dsh-auto-memory`
|
|
39
|
+
|
|
40
|
+
## Updating (check & upgrade)
|
|
41
|
+
|
|
42
|
+
The plugin is a normal npm package, so updating is one command in the same profile directory:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
cd ~/.dsh/profiles/web
|
|
46
|
+
pnpm up @a9i5k4/dsh-auto-memory # or: npm install @a9i5k4/dsh-auto-memory@latest
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Then restart **dsh web**.
|
|
50
|
+
|
|
51
|
+
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).
|
|
52
|
+
|
|
53
|
+
## AI-Era Installation (copy-paste for your AI)
|
|
54
|
+
|
|
55
|
+
> 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.
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
Install the npm package @a9i5k4/dsh-auto-memory in the DeepSeek Harness web profile
|
|
59
|
+
directory ~/.dsh/profiles/web (run "pnpm add @a9i5k4/dsh-auto-memory" or "npm install @a9i5k4/dsh-auto-memory"),
|
|
60
|
+
append "@a9i5k4/dsh-auto-memory" to the dsh.profile.bundles array in package.json,
|
|
61
|
+
then restart dsh web to activate the plugin.
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## A companion that takes initiative
|
|
67
|
+
|
|
68
|
+
Auto Memory is designed to feel less like a database and more like an assistant who knows you:
|
|
69
|
+
|
|
70
|
+
- **Proactive reminders** — when the AI notices a deadline, appointment or promise in your conversation, it files it into the calendar automatically and reminds you in later sessions before the time arrives (`calendar_add` / `calendar_done` / `calendar_remove`).
|
|
71
|
+
- **Warm greetings** — an AI-written greeting for the current period (morning / afternoon / evening) that mentions your most important work of the day; come back after an hour away and it says "welcome back" and catches you up.
|
|
72
|
+
- **It writes its own journal** — after every conversation turn, a small subagent quietly decides what's worth keeping and appends topic-grouped entries to today's log; long-term decisions are promoted to project notes and cross-project rules to user-level memory. You never have to remember to log anything.
|
|
73
|
+
- **Daily reflections** — structured results / lessons / next steps are kept in the background, so you can review how a day really went.
|
|
74
|
+
- **Calendar with human touches** — semantic colors for urgency, a day timeline (07:00–22:00), location and reminder fields; the AI maintains it from context instead of you filling forms.
|
|
75
|
+
- **Inherited memory** — memories accumulated in WorkBuddy / CodeBuddy / Claude Code / Codex are discoverable and importable, so the plugin picks up where your other AI tools left off.
|
|
76
|
+
|
|
77
|
+
### Under the hood — engineering that stays out of your way
|
|
78
|
+
|
|
79
|
+
- **Prefix-cache friendly** — static rules live in the system prompt, dynamic memory in runtime snapshots; the prompt stays byte-stable so DeepSeek's prefix cache keeps hitting (no repeated re-encoding of your whole history).
|
|
80
|
+
- **Lean injection, low token cost** — only the last day of logs + a reflection digest are injected; everything else is fetched on demand via `memory_read` / `memory_recall`.
|
|
81
|
+
- **Rate-limited AI** — auto-consolidation runs at most 8×/day with a configurable cooldown (doubled outside work hours), so memory stays useful without burning your budget.
|
|
82
|
+
- **Credentials never enter the prompt** — sensitive sections (tokens / secrets / credentials) are filtered out of injection while staying safe in the files.
|
|
83
|
+
- **Cross-workspace & cross-tool** — centralized storage readable from any session; memories from WorkBuddy / CodeBuddy / Claude Code / Codex are discoverable and importable.
|
|
84
|
+
|
|
85
|
+
## Features
|
|
86
|
+
|
|
87
|
+
### Three-layer Memory
|
|
88
|
+
|
|
89
|
+
| Layer | Location | Description |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| User-level memory | `~/.dsh/memory/MEMORY.md` | Cross-project rules & preferences |
|
|
92
|
+
| Project notes | `~/.dsh/memory/workspaces/{workspace}/MEMORY.md` | Project conventions & decisions (centralized) |
|
|
93
|
+
| Daily logs | `~/.dsh/memory/workspaces/{workspace}/YYYY-MM-DD.md` | Append-only work log (centralized) |
|
|
94
|
+
| Reflections | `~/.dsh/memory/workspaces/{workspace}/reflections/YYYY-MM-DD.md` | Daily reflection (structured, kept in background) |
|
|
95
|
+
|
|
96
|
+
> **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).
|
|
97
|
+
|
|
98
|
+
- **Auto injection (at the end of the system prompt)**: every prompt gets a `<memory_system>` block (user rules + project notes + reflection digest + recent 1 day of log tails + external memory paths + 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
|
|
99
|
+
- **Lean by default, details on demand (v0.1.24)**: injection stays small — the last 1 day of logs, a reflection digest (achievements section only), and paths for external memory instead of full text. `memory_read` fetches full log/reflection/user/notes/calendar files when needed; sensitive sections (credentials/tokens/secrets) are **filtered out of the prompt** but kept in the files
|
|
100
|
+
- **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
|
|
101
|
+
|
|
102
|
+
### Auto-Consolidation — memory writes itself after every turn (v0.1.9)
|
|
103
|
+
|
|
104
|
+
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:
|
|
105
|
+
|
|
106
|
+
- **Today's log** gets entries like `- 21:03 [自动沉淀] …` — no manual `memory_log` needed for routine work
|
|
107
|
+
- **Long-term value is promoted**: project decisions/architecture → project notes (with a `## YYYY-MM-DD` heading); cross-project rules → user-level memory
|
|
108
|
+
- **Small talk is skipped** (content threshold `autoConsolidateMinChars`), each turn is deduplicated by turn number, subagent turns are ignored
|
|
109
|
+
- **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
|
|
110
|
+
- **`memory_consolidate` tool**: read recent logs and distill long-term decisions / architecture / user preferences into MEMORY.md on demand ("dream-like" consolidation)
|
|
111
|
+
- Configurable in `~/.dsh/dsh-auto-memory.json`: `autoConsolidate` (default true), `autoConsolidateMinChars` (default 240), `autoConsolidateCooldownMinutes` (default 30, doubled 22:00–08:00), `autoConsolidateDailyMax` (default 8) — all adjustable in the Settings → Automation section
|
|
112
|
+
|
|
113
|
+
### AI Greetings & Three-level Drawers (Overview page, v0.1.9)
|
|
114
|
+
|
|
115
|
+
The first thing you see when opening the memory panel is an **AI-generated** period greeting, not a template and not technical info:
|
|
116
|
+
|
|
117
|
+
- **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
|
|
118
|
+
- **Drawer titles are the AI summaries**: the "Today afternoon / Today evening" window titles are replaced with the AI's casual summary text itself
|
|
119
|
+
- **Three-level drawer structure**:
|
|
120
|
+
- Level 1: period drawer, titled with the AI summary
|
|
121
|
+
- Level 2: inside it, small drawers — one per work item the AI distilled (with a point count)
|
|
122
|
+
- Level 3: expand a work item to read its detail points
|
|
123
|
+
- **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
|
|
124
|
+
- **Smart timing**: if you were away for more than 1 hour and come back, the greeting says "Welcome back" with what was finished meanwhile
|
|
125
|
+
- **Daily reflection stays in background**: structured reflections (results / lessons / next steps) are kept, while the front page only shows a light greeting
|
|
126
|
+
|
|
127
|
+
### Smart Search (Search tab, v0.1.9)
|
|
128
|
+
|
|
129
|
+
The Search tab adds a **Smart search** button next to the keyword search:
|
|
130
|
+
|
|
131
|
+
- The AI expands your natural-language query into 3-6 keywords (e.g. "last time publishing npm hit a snag" → 发布 / 踩坑 / GitHub / npm / 推送)
|
|
132
|
+
- Scans all three memory layers plus reflections with those keywords
|
|
133
|
+
- 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
|
|
134
|
+
- Raw keyword hits with their sources are listed under the answer
|
|
135
|
+
|
|
136
|
+
### Calendar View (Four Quadrants)
|
|
137
|
+
|
|
138
|
+
「Calendar」tab (liquid-glass monthly view):
|
|
139
|
+
|
|
140
|
+
- Monthly grid, today highlighted, click any date to add an item
|
|
141
|
+
- **Four-quadrant colors**: Urgent & Important (red) / Important (blue) / Urgent (orange) / Neither (gray)
|
|
142
|
+
- Click an item to toggle done, click again to delete; legend + weekday header
|
|
143
|
+
- **Cross-conversation persistence**: data lives at user level `~/.dsh/memory/CALENDAR.md`, shared across workspaces, survives DSH reinstall
|
|
144
|
+
- **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
|
|
145
|
+
|
|
146
|
+
### Agent Tools
|
|
147
|
+
|
|
148
|
+
`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`
|
|
149
|
+
|
|
150
|
+
### UI
|
|
151
|
+
|
|
152
|
+
- Sidebar 「Memory」entry → floating panel (Overview / Logs / Notes / Reflections / Connect / Calendar / Search)
|
|
153
|
+
- 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
|
|
154
|
+
- **External memory inheritance**: import memories accumulated by other AI tools (CodeBuddy / Claude Code / Codex / project convention files)
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Screenshots
|
|
159
|
+
|
|
160
|
+
All screenshots below are real captures of the plugin running inside the DSH Web GUI (Chinese UI for now; English UI captures will be added later).
|
|
161
|
+
|
|
162
|
+
### Memory panel overview — away greeting & AI period summaries
|
|
163
|
+
|
|
164
|
+
<img width="480" alt="Memory panel overview" src="docs/screenshots/overview-zh.png">
|
|
165
|
+
|
|
166
|
+
### Connect — inherit global memory & history sessions from other AI agents
|
|
167
|
+
|
|
168
|
+
<img width="480" alt="Connect tab" src="docs/screenshots/connect-zh.png">
|
|
169
|
+
|
|
170
|
+
### Calendar — AI adds items, toggles status and marks completion from context
|
|
171
|
+
|
|
172
|
+
<img width="480" alt="Calendar tab" src="docs/screenshots/calendar-zh.png">
|
|
173
|
+
|
|
174
|
+
### Workspace mind map — auto-generated, workspace-centered cross-workspace overview
|
|
175
|
+
|
|
176
|
+
<img width="480" alt="Workspace mind map" src="docs/screenshots/workspace-map-zh.png">
|
|
177
|
+
|
|
178
|
+
### Settings — highly customizable, covers most technical details
|
|
179
|
+
|
|
180
|
+
<img width="480" alt="Auto Memory settings" src="docs/screenshots/settings-zh.png">
|
|
181
|
+
<img width="480" alt="Auto Memory settings (2)" src="docs/screenshots/settings-2-zh.png">
|
|
182
|
+
|
|
183
|
+
## Beyond the screenshots
|
|
184
|
+
|
|
185
|
+
- **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).
|
|
186
|
+
- **Smart search**: ask in natural language — the AI expands your query into keywords, scans every memory layer, then answers conversationally with sources cited.
|
|
187
|
+
- **Calendar with day timeline (v0.1.24)**: click a date to open a 07:00–22:00 timeline with events placed on their time slots; add events with location/reminder/details; the AI proactively files deadlines via `calendar_add` and marks them done via `calendar_done`/`calendar_remove`.
|
|
188
|
+
- **Workspace mind map (v0.1.24)**: an AI-generated graph of workspaces, topics and cross-workspace links; pan by dragging, resize with the slider, click a card for details.
|
|
189
|
+
- **Memory panel UI (v0.1.24)**: liquid-glass panel with smooth animations everywhere — tab strip with arrow scrolling, expanding sections (greeting drawers, workspace summaries), floating save bar in Settings that highlights when there are unsaved changes.
|
|
190
|
+
- **External memory management (v0.1.24)**: per-source view/import/remove — imported sources show "✓" and become "Delete" buttons per target (notes vs user-level); full content is read on demand and never injected in bulk.
|
|
191
|
+
- **Calendar reminders**: pending items are injected into future sessions' system prompts until completed — the AI reminds you without being asked.
|
|
192
|
+
- **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.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Configuration
|
|
197
|
+
|
|
198
|
+
Defaults (JSON file `~/.dsh/dsh-auto-memory.json`):
|
|
199
|
+
|
|
200
|
+
```json
|
|
201
|
+
{
|
|
202
|
+
"userMemoryDir": "~/.dsh/memory",
|
|
203
|
+
"projectMemoryDir": ".dsh-memory",
|
|
204
|
+
"injectEnabled": true,
|
|
205
|
+
"injectBudgetChars": 2400,
|
|
206
|
+
"recentDaysInjected": 1,
|
|
207
|
+
"reflectEnabled": true,
|
|
208
|
+
"reflectStyle": "auto",
|
|
209
|
+
"locale": "zh",
|
|
210
|
+
"autoConsolidate": true,
|
|
211
|
+
"autoConsolidateMinChars": 240,
|
|
212
|
+
"autoConsolidateCooldownMinutes": 30,
|
|
213
|
+
"autoConsolidateDailyMax": 8,
|
|
214
|
+
"externalInjectionChars": 1400,
|
|
215
|
+
"memoryRoot": "~/.dsh/memory/workspaces",
|
|
216
|
+
"dayBoundaryMinutes": 450
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Adjustable in the GUI (Settings → Auto Memory), including the UI language (zh / en), the panel font size and the day boundary.
|
|
221
|
+
|
|
222
|
+
### v0.1.9 hardening (budget / boundary / picker)
|
|
223
|
+
|
|
224
|
+
- **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.
|
|
225
|
+
- **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.
|
|
226
|
+
- **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.
|
|
227
|
+
- **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.
|
|
228
|
+
- **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).
|
|
229
|
+
- **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.
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Structure
|
|
234
|
+
|
|
235
|
+
- `lib/index.js` — Host half: engine, injection, tools, routes (zero runtime deps, Node built-ins only)
|
|
236
|
+
- `lib/client.js` — Browser half: memory panel (with calendar view) + settings page (built-in zh/en i18n)
|
|
237
|
+
- `cordis.patch.yml` — Plugin row (`auto-memory`)
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Limitations
|
|
242
|
+
|
|
243
|
+
- Memory files are plain-text Markdown; no secrets stored unless explicitly requested.
|
|
244
|
+
- `memory_recall` session search depends on the deployed session-query index; without it, only local search works.
|
|
245
|
+
- Plugin-set changes require a dsh restart.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Release Info
|
|
250
|
+
|
|
251
|
+
- GitHub: https://github.com/Aik358/dsh-auto-memory
|
|
252
|
+
- npm: `@a9i5k4/dsh-auto-memory`
|
|
253
|
+
- License: BSD-3-Clause
|
package/README.zh-CN.md
CHANGED
|
@@ -1,232 +1,251 @@
|
|
|
1
|
-
# dsh-auto-memory — DSH
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<img width="820" alt="dsh-auto-memory 宣传图" src="docs/banner.jpg">
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
DSH Web GUI
|
|
8
|
-
|
|
9
|
-
> **快速安装**:`cd ~/.dsh/profiles/web` → `pnpm add @a9i5k4/dsh-auto-memory` → 在该目录 `package.json` 的 `dsh.profile.bundles` 里追加 `"@a9i5k4/dsh-auto-memory"` → 重启 **dsh web**(侧边栏出现「记忆」入口)。完整步骤见 [安装](#安装npm-一键);没有 pnpm 可用 `npm install @a9i5k4/dsh-auto-memory`。
|
|
10
|
-
|
|
11
|
-
[English](README.md) | [中文版](README.zh-CN.md)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## 安装(NPM 一键)
|
|
16
|
-
|
|
17
|
-
> 前提:已安装 DeepSeek Harness(dsh)并至少启动过一次 `dsh web`。
|
|
18
|
-
|
|
19
|
-
在 **profile 目录**(`~/.dsh/profiles/web`)下执行:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
cd ~/.dsh/profiles/web
|
|
23
|
-
pnpm add @a9i5k4/dsh-auto-memory
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
然后编辑该目录下的 `package.json`,在 `dsh.profile.bundles` 数组里追加:
|
|
27
|
-
|
|
28
|
-
```json
|
|
29
|
-
"@a9i5k4/dsh-auto-memory"
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
保存后**重启 dsh web**,插件即生效(侧边栏出现「记忆」入口)。
|
|
33
|
-
|
|
34
|
-
> 没有 pnpm?用 npm 也行:`npm install @a9i5k4/dsh-auto-memory`
|
|
35
|
-
|
|
36
|
-
## 更新(检查与升级)
|
|
37
|
-
|
|
38
|
-
插件就是普通的 npm 包,更新同样是在 profile 目录里一条命令:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
cd ~/.dsh/profiles/web
|
|
42
|
-
pnpm up @a9i5k4/dsh-auto-memory # 或: npm install @a9i5k4/dsh-auto-memory@latest
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
然后**重启 dsh web** 生效。
|
|
46
|
-
|
|
47
|
-
设置 → 自动记忆 页面有「检查更新」按钮,会拿你当前安装的版本和 npm registry 上的最新版对比(有新版时直接显示更新命令)。
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## AI 时代安装(把这句话直接丢给 AI)
|
|
52
|
-
|
|
53
|
-
> 现在是 AI 时代,你可以直接把下面这句话复制给你的 AI 助手(DeepSeek / Claude / Codex 等),它会帮你完成安装:
|
|
54
|
-
|
|
55
|
-
```text
|
|
56
|
-
请在 DeepSeek Harness 的 web profile 目录 ~/.dsh/profiles/web 下安装 npm 包
|
|
57
|
-
@a9i5k4/dsh-auto-memory(执行 pnpm add @a9i5k4/dsh-auto-memory 或 npm install),
|
|
58
|
-
然后在 package.json 的 dsh.profile.bundles 数组追加 "@a9i5k4/dsh-auto-memory",
|
|
59
|
-
最后重启 dsh web 使插件生效。
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
1
|
+
# dsh-auto-memory — DSH 自动记忆与人性化交互插件
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img width="820" alt="dsh-auto-memory 宣传图" src="docs/banner.jpg">
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
DSH Web GUI 的缓存友好三层记忆引擎:精简自动注入、每轮 AI 自动沉淀、按需读取与跨工具记忆继承——并点缀以人性化细节:主动日历提醒、暖心 AI 问候、自己会写的每日日志。
|
|
8
|
+
|
|
9
|
+
> **快速安装**:`cd ~/.dsh/profiles/web` → `pnpm add @a9i5k4/dsh-auto-memory` → 在该目录 `package.json` 的 `dsh.profile.bundles` 里追加 `"@a9i5k4/dsh-auto-memory"` → 重启 **dsh web**(侧边栏出现「记忆」入口)。完整步骤见 [安装](#安装npm-一键);没有 pnpm 可用 `npm install @a9i5k4/dsh-auto-memory`。
|
|
10
|
+
|
|
11
|
+
[English](README.md) | [中文版](README.zh-CN.md)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 安装(NPM 一键)
|
|
16
|
+
|
|
17
|
+
> 前提:已安装 DeepSeek Harness(dsh)并至少启动过一次 `dsh web`。
|
|
18
|
+
|
|
19
|
+
在 **profile 目录**(`~/.dsh/profiles/web`)下执行:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
cd ~/.dsh/profiles/web
|
|
23
|
+
pnpm add @a9i5k4/dsh-auto-memory
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
然后编辑该目录下的 `package.json`,在 `dsh.profile.bundles` 数组里追加:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
"@a9i5k4/dsh-auto-memory"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
保存后**重启 dsh web**,插件即生效(侧边栏出现「记忆」入口)。
|
|
33
|
+
|
|
34
|
+
> 没有 pnpm?用 npm 也行:`npm install @a9i5k4/dsh-auto-memory`
|
|
35
|
+
|
|
36
|
+
## 更新(检查与升级)
|
|
37
|
+
|
|
38
|
+
插件就是普通的 npm 包,更新同样是在 profile 目录里一条命令:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
cd ~/.dsh/profiles/web
|
|
42
|
+
pnpm up @a9i5k4/dsh-auto-memory # 或: npm install @a9i5k4/dsh-auto-memory@latest
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
然后**重启 dsh web** 生效。
|
|
46
|
+
|
|
47
|
+
设置 → 自动记忆 页面有「检查更新」按钮,会拿你当前安装的版本和 npm registry 上的最新版对比(有新版时直接显示更新命令)。
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## AI 时代安装(把这句话直接丢给 AI)
|
|
52
|
+
|
|
53
|
+
> 现在是 AI 时代,你可以直接把下面这句话复制给你的 AI 助手(DeepSeek / Claude / Codex 等),它会帮你完成安装:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
请在 DeepSeek Harness 的 web profile 目录 ~/.dsh/profiles/web 下安装 npm 包
|
|
57
|
+
@a9i5k4/dsh-auto-memory(执行 pnpm add @a9i5k4/dsh-auto-memory 或 npm install),
|
|
58
|
+
然后在 package.json 的 dsh.profile.bundles 数组追加 "@a9i5k4/dsh-auto-memory",
|
|
59
|
+
最后重启 dsh web 使插件生效。
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 主动懂你的伙伴
|
|
65
|
+
|
|
66
|
+
自动记忆想让你感觉:它不像一个数据库,而像一个了解你的助手——
|
|
67
|
+
|
|
68
|
+
- **主动提醒** — AI 在对话里发现 deadline、约定或承诺时,自动写进日历,并在之后的会话中赶在时间到达前提醒你(`calendar_add` / `calendar_done` / `calendar_remove`)。
|
|
69
|
+
- **暖心问候** — 每个时段(早上 / 下午 / 晚上)都有 AI 写的问候,还会提起你今天最重要的工作;离开超过一小时回来,它会说「欢迎回来」并帮你补上这段时间发生了什么。
|
|
70
|
+
- **它自己写日志** — 每轮对话结束,一个小型子代理悄悄判断什么值得记,按主题把条目追加进今日日志;长期决策升格到项目笔记、跨项目规则升格到用户级记忆。你永远不用记得去记录。
|
|
71
|
+
- **每日反思** — 结构化记录成果 / 教训 / 下一步,想回顾时可以看看一天到底过得怎么样。
|
|
72
|
+
- **有人情味的日历** — 紧急程度用语义色区分,07:00-22:00 当天时间轴,支持地点与提醒字段;AI 从上下文帮你维护,而不是让你去填表单。
|
|
73
|
+
- **记忆继承** — WorkBuddy / CodeBuddy / Claude Code / Codex 里积累的记忆可被发现并导入,插件接着你其他 AI 工具留下的进度继续。
|
|
74
|
+
|
|
75
|
+
### 底层工程 — 技术默默服务,不打扰你
|
|
76
|
+
|
|
77
|
+
- **前缀缓存友好** — 静态规则在系统提示词里保持字节级稳定,动态记忆走运行时快照,DeepSeek 前缀缓存持续命中(不会反复重编码你的全部历史)。
|
|
78
|
+
- **注入精简、token 成本低** — 只注入最近 1 天日志 + 反思精华,其余通过 `memory_read` / `memory_recall` 按需读取。
|
|
79
|
+
- **AI 调用限频** — 自动沉淀每天最多 8 次、间隔可配置(非工作时间自动翻倍),记忆有用又不烧预算。
|
|
80
|
+
- **凭据不进 prompt** — 敏感段落(令牌 / 密钥 / 凭据)从注入中过滤,文件里安全保留。
|
|
81
|
+
- **跨工作区与跨工具** — 集中式存储任何会话可读;WorkBuddy / CodeBuddy / Claude Code / Codex 的记忆可发现并导入。
|
|
82
|
+
|
|
83
|
+
## 功能
|
|
84
|
+
|
|
85
|
+
### 三层记忆
|
|
86
|
+
|
|
87
|
+
| 层 | 位置 | 说明 |
|
|
88
|
+
|---|---|---|
|
|
89
|
+
| 用户级记忆 | `~/.dsh/memory/MEMORY.md` | 跨项目规则/偏好(用户明确要求时写) |
|
|
90
|
+
| 项目笔记 | `~/.dsh/memory/workspaces/{工作区}/MEMORY.md` | 项目长期约定、决策、架构要点(集中式) |
|
|
91
|
+
| 每日日志 | `~/.dsh/memory/workspaces/{工作区}/YYYY-MM-DD.md` | append-only 工作日志(集中式) |
|
|
92
|
+
| 反思 | `~/.dsh/memory/workspaces/{工作区}/reflections/YYYY-MM-DD.md` | 每日反思(后台结构化积累) |
|
|
93
|
+
|
|
94
|
+
> **集中式存储(WorkBuddy 式)**:所有工作区的记忆统一存放在一个根目录 `~/.dsh/memory/workspaces/` 下,每工作区一个子目录——任何模型、任何会话都能通过注入 + 跨工作区 `memory_recall` 读取。旧版分散在各工作区 `.dsh-memory/` 的记忆会在升级后首次运行时自动迁移(旧副本保留不删)。
|
|
95
|
+
|
|
96
|
+
- **自动注入(放在系统提示词末尾)**:每次组装系统提示词时注入 `<memory_system>` 块(用户规则 + 项目笔记 + 反思精华 + 最近 1 天日志尾部 + 外部记忆路径 + 未完成日历事项 + 写入纪律),并置于提示词**最末尾**——模型在回复前最后读到记忆纪律,遵循度更高
|
|
97
|
+
- **注入精简、细节按需(v0.1.24)**:注入保持轻量——只含最近 1 天日志、反思「成果回顾」精华、外部记忆绝对路径(不再整段注入);需要完整日志/反思/记忆文件时用 `memory_read` 工具按需读取;**敏感段落(凭据/令牌/密钥)从注入中过滤**(文件保留,不进 prompt)
|
|
98
|
+
- **记忆操作可见**:更新/检索记忆时,AI 会在对话正文中明文说明(如"已把 X 记入今日日志""我查了记忆,发现…"),不藏在工具调用里
|
|
99
|
+
|
|
100
|
+
### 每轮自动沉淀 — 记忆自己写自己(v0.1.9)
|
|
101
|
+
|
|
102
|
+
每轮对话结束时自动评估本轮内容(经小型 subagent 判断+提炼),值得记的自动写入,无需你手动调 memory_log,也不依赖模型记得写:
|
|
103
|
+
|
|
104
|
+
- **今日日志**自动追加 `- 21:03 [自动沉淀] …` 条目
|
|
105
|
+
- **长期价值自动升格**:项目决策/架构 → 项目笔记(带 `## YYYY-MM-DD` 日期标题);跨项目规则 → 用户级记忆
|
|
106
|
+
- **寒暄轮自动跳过**(内容门槛 `autoConsolidateMinChars`);按 turn 去重,每轮只写一次;子代理轮次不参与
|
|
107
|
+
- **GUI 有 Agent 参与痕迹**:概览页显示"今日已自动沉淀 N 条要点(最近 HH:MM)";面板打开即刷新、打开期间每 30 秒自动重拉、⟳ 按钮手动刷新
|
|
108
|
+
- **`memory_consolidate` 工具**:AI 读最近日志发散提炼,把有长期价值的决策/架构/用户偏好固化进 MEMORY.md("做梦式"固化)
|
|
109
|
+
- 可在 `~/.dsh/dsh-auto-memory.json` 配置:`autoConsolidate`(默认开)、`autoConsolidateMinChars`(默认 240)、`autoConsolidateCooldownMinutes`(默认 30,22:00-08:00 自动翻倍)、`autoConsolidateDailyMax`(默认 8)——全部可在设置页「自动化」分组调整
|
|
110
|
+
|
|
111
|
+
### AI 时段问候与三级抽屉(概览页,v0.1.9)
|
|
112
|
+
|
|
113
|
+
打开记忆面板第一眼看到的是 **AI 生成**的生活化问候,不是模板、不是严肃的技术信息:
|
|
114
|
+
|
|
115
|
+
- **AI 写问候**:subagent 按当前时段(早上/上午/中午/下午/晚上)写一句温暖随口的问候,自然提起今天最重要的 1-2 件工作;每天每时段生成一次并缓存到 `.dsh-memory/greetings/`,不重复消耗 API
|
|
116
|
+
- **抽屉标题就是 AI 总结**:"今日下午 / 今日晚上" 的大窗口标题替换为 AI 总结的原文(如"下午这段你干得真不少呢,最能看到成果的就是 dsh-auto-memory 这一条线…")
|
|
117
|
+
- **三级抽屉结构**:
|
|
118
|
+
- 第一层:时段抽屉,标题即 AI 总结
|
|
119
|
+
- 第二层:拉开后是若干小抽屉——AI 归纳的每项工作(带细点数)
|
|
120
|
+
- 第三层:展开某项工作,阅读其细点
|
|
121
|
+
- **总结有缓存**:结构化结果存 `.dsh-memory/summaries/`;打开面板读缓存(离线可看、不重复生成);⟳ 刷新键或暂离超 1 小时回来才强制重新生成;每份总结显示生成时间
|
|
122
|
+
- **智能时机**:离开超过 1 小时(下班/暂离)再打开,自动显示"欢迎回来"并列出期间的完成事项
|
|
123
|
+
- **每日反思**:后台保留结构化反思(成果/教训/要点),前台只有轻松问候
|
|
124
|
+
|
|
125
|
+
### 智能检索(检索页,v0.1.9)
|
|
126
|
+
|
|
127
|
+
检索页在「检索」旁新增「**智能检索**」按钮:
|
|
128
|
+
|
|
129
|
+
- AI 把你的自然语言查询扩散成 3-6 个关键词(如"上次发布 npm 踩的坑" → 发布 / 踩坑 / GitHub / npm / 推送)
|
|
130
|
+
- 用这些关键词扫描三层记忆 + 反思
|
|
131
|
+
- AI 再**综合成一段自然语言回答**,注明每条信息来自哪份记忆(日志日期/项目笔记/用户级),**绝不编造记忆里没有的事实**
|
|
132
|
+
- 回答下方列出关键词与原始命中明细(来源 + 原文)
|
|
133
|
+
|
|
134
|
+
### 日历视图(四象限)
|
|
135
|
+
|
|
136
|
+
「日历」页签(液态玻璃风格月视图):
|
|
137
|
+
|
|
138
|
+
- 月视图网格,今日高亮,点击任意日期添加事项
|
|
139
|
+
- **四象限色标**:重要紧急(红)/ 重要不紧急(蓝)/ 紧急不重要(橙)/ 不重要不紧急(灰)
|
|
140
|
+
- 点条目切换完成状态,再点删除;图例 + 星期头
|
|
141
|
+
- **跨对话持久**:数据存用户级 `~/.dsh/memory/CALENDAR.md`,所有工作区共享,重装 DSH 不丢
|
|
142
|
+
- **AI 主动维护**:AI 会从对话中提取 deadline、约定时间等自动写入日历(`calendar_add` / `calendar_list` / `calendar_done` / `calendar_remove`),并在正文转述;未完成事项注入每次会话的系统提示词
|
|
143
|
+
|
|
144
|
+
### Agent 工具
|
|
145
|
+
|
|
146
|
+
`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`
|
|
147
|
+
|
|
148
|
+
### 界面
|
|
149
|
+
|
|
150
|
+
- 侧边栏「记忆」入口 → 浮层面板(概览/日志/笔记/反思/接续/日历/检索)
|
|
151
|
+
- 设置页(设置 → 自动记忆):存储位置、注入预算、反思风格、界面语言(中文 / English)、**界面字号(小/标准/大/特大,默认大)**——切换立即生效,无需保存
|
|
152
|
+
- **外部记忆继承**:接入其他 AI 工具(CodeBuddy / Claude Code / Codex / 项目约定文件)积累的记忆
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 界面截图
|
|
157
|
+
|
|
158
|
+
以下都是插件在 DSH Web GUI 中的真实运行截图(当前为中文界面;英文界面截图稍后补充)。
|
|
159
|
+
|
|
160
|
+
### 记忆面板概览 — 暂离问候、AI 总结等
|
|
161
|
+
|
|
162
|
+
<img width="480" alt="记忆面板概览" src="docs/screenshots/overview-zh.png">
|
|
163
|
+
|
|
164
|
+
### 接续 — 从其他 AI Agent 提取全局记忆与历史会话
|
|
165
|
+
|
|
166
|
+
<img width="480" alt="接续页签" src="docs/screenshots/connect-zh.png">
|
|
167
|
+
|
|
168
|
+
### 日历 — AI 根据上下文自动添加事项、切换状态、标记完成
|
|
169
|
+
|
|
170
|
+
<img width="480" alt="日历页签" src="docs/screenshots/calendar-zh.png">
|
|
171
|
+
|
|
172
|
+
### 工作区导图 — 自动生成的以工作区为中心的跨工作区记忆导图
|
|
173
|
+
|
|
174
|
+
<img width="480" alt="工作区记忆导图" src="docs/screenshots/workspace-map-zh.png">
|
|
175
|
+
|
|
176
|
+
### 设置 — 高度自定义,可操作绝大部分技术细节
|
|
177
|
+
|
|
178
|
+
<img width="480" alt="自动记忆设置" src="docs/screenshots/settings-zh.png">
|
|
179
|
+
<img width="480" alt="自动记忆设置(续)" src="docs/screenshots/settings-2-zh.png">
|
|
180
|
+
|
|
181
|
+
## 截图之外
|
|
182
|
+
|
|
183
|
+
- **每轮自动沉淀**:每轮对话结束由小代理自动评估,按主题分组写进今日日志(`## 主题(HH:MM)` + 要点列表)——常规工作不需要手动 memory_log。有长期价值的内容自动升格项目笔记 / 用户级记忆;寒暄轮跳过;AI 失败入队,每 5 分钟重试(15 秒心跳文件证明轮询存活)。
|
|
184
|
+
- **智能检索**:自然语言提问,AI 扩成关键词扫描全部记忆层,再综合成带出处的自然语言回答。
|
|
185
|
+
- **日历与当天时间轴(v0.1.24)**:点击日期打开 07:00-22:00 时间轴,事件按时间槽落位;支持地点/提醒/补充说明;AI 主动提取 deadline 用 `calendar_add` 写入、`calendar_done`/`calendar_remove` 维护。
|
|
186
|
+
- **工作区思维导图(v0.1.24)**:AI 生成工作区/主题/跨工作区关联图,支持拖动画布、滑块缩放、点击卡片看摘要。
|
|
187
|
+
- **记忆面板 UI(v0.1.24)**:液态玻璃面板 + 全站丝滑动效——模块箭头滚动条、抽屉展开/收起过渡、设置页浮动保存栏(未保存高亮)。
|
|
188
|
+
- **外部记忆管理(v0.1.24)**:按来源查看/接入/移除——已接入显示 ✓、按目标(笔记/用户级)独立删除;内容按需读取,不再整段注入。
|
|
189
|
+
- **日历提醒**:未完成事项注入之后每次会话的系统提示词——AI 不用你提醒就会主动提及。
|
|
190
|
+
- **一键更新**:设置页对比本地版本与 npm registry 最新版;registry 安装的用户可直接「一键更新」(后台自动跑 pnpm/npm),重启后生效。
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 配置
|
|
195
|
+
|
|
196
|
+
默认值(JSON 文件 `~/.dsh/dsh-auto-memory.json`):
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"userMemoryDir": "~/.dsh/memory",
|
|
201
|
+
"projectMemoryDir": ".dsh-memory",
|
|
202
|
+
"injectEnabled": true,
|
|
203
|
+
"injectBudgetChars": 2400,
|
|
204
|
+
"recentDaysInjected": 1,
|
|
205
|
+
"reflectEnabled": true,
|
|
206
|
+
"reflectStyle": "auto",
|
|
207
|
+
"locale": "zh",
|
|
208
|
+
"autoConsolidate": true,
|
|
209
|
+
"autoConsolidateMinChars": 240,
|
|
210
|
+
"autoConsolidateCooldownMinutes": 30,
|
|
211
|
+
"autoConsolidateDailyMax": 8,
|
|
212
|
+
"externalInjectionChars": 1400,
|
|
213
|
+
"memoryRoot": "~/.dsh/memory/workspaces",
|
|
214
|
+
"dayBoundaryMinutes": 450
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
可在 GUI(设置 → 自动记忆)中调整,包括界面语言(zh / en)、界面字号与日界。
|
|
219
|
+
|
|
220
|
+
### v0.1.9 加固(预算 / 日界 / 目录选择器)
|
|
221
|
+
|
|
222
|
+
- **每日写入预算 + 超限自动压缩**:用户级记忆 ≤4000 字/天、项目笔记 ≤3000 字/天(所有会话共享一天额度,日界重置)。超限不拒绝写入——框架先把「今天之前」的旧内容交给 AI 压缩(合并重复、删除过期、保留硬信息)腾出空间再写;AI 不可用时把最早段落归档到 `archived-user.md` / `archive/notes-archived.md`,信息不丢。压缩 10 分钟节流。
|
|
223
|
+
- **日界(凌晨的活儿归昨晚)**:`dayBoundaryMinutes`(默认 450 = 早上 7:30)。日界之前的活儿记入前一天日志,前一天的每日反思也要等过了日界才开始——凌晨不再一过午夜就催「昨天干了什么」。
|
|
224
|
+
- **系统原生文件夹选择器**:记忆根目录旁的「浏览…」按钮直接弹系统的文件夹选择器(经 DSH directory-picker 原生后端);无原生选择器时自动回退内嵌浏览。更换根目录时自动把已有工作区记忆迁移到新位置(旧文件保留),所有路径变量在下一次刷新时跟随新配置。
|
|
225
|
+
- **30 天蒸馏**:`memory_maintain` 把 30 天前的旧日志交给 AI 提炼进项目笔记,原文保底归档到 `archive/`,并从活跃日志列表移除。
|
|
226
|
+
- **首轮注入保障**:`pre-step` 钩子在第一步放行前等待记忆状态刷新,模型从第一个 token 起就能看到记忆(此前异步加载可能让首轮注入为空)。
|
|
227
|
+
- **每步带时间戳的提醒**:注入的纪律块携带实时 `HH:MM:SS` 时间戳,每次组装提示词都刷新;另有 15 秒心跳文件证明后台轮询存活。
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 结构
|
|
232
|
+
|
|
233
|
+
- `lib/index.js` — Host 半:引擎、注入、工具、路由(零运行时依赖,仅 node 内置模块)
|
|
234
|
+
- `lib/client.js` — 浏览器半:记忆面板(含日历视图)+ 设置页(内置中英双语)
|
|
235
|
+
- `cordis.patch.yml` — 插件行(`auto-memory`)
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## 限制
|
|
240
|
+
|
|
241
|
+
- 记忆文件为明文 Markdown;不存密钥,除非用户明确要求。
|
|
242
|
+
- `memory_recall` 的历史会话检索依赖部署的 session-query 索引,未启用时仅本地检索。
|
|
243
|
+
- 插件集变更需重启 dsh 生效。
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## 发布信息
|
|
248
|
+
|
|
249
|
+
- GitHub: https://github.com/Aik358/dsh-auto-memory
|
|
250
|
+
- npm: `@a9i5k4/dsh-auto-memory`
|
|
251
|
+
- License: BSD-3-Clause
|
package/lib/client.js
CHANGED
|
@@ -346,6 +346,11 @@ window.__ModuleLoader__.load({
|
|
|
346
346
|
|
|
347
347
|
// ───────────────────────── 更新弹窗 / 首次指导 ─────────────────────────
|
|
348
348
|
var CHANGELOG = {
|
|
349
|
+
'0.1.26': { zh: [
|
|
350
|
+
'文档:README 定位改为「技术先行 + 人性化」——intro 强调缓存友好三层记忆引擎,新增「底层工程」章节(前缀缓存友好/注入精简/AI限频/凭据过滤/跨工具),与「主动懂你的伙伴」章节互补。',
|
|
351
|
+
], en: [
|
|
352
|
+
'Docs: README repositioned as tech-first with human touch — intro highlights the cache-friendly three-layer memory engine; a new "Under the hood" section (prefix-cache friendly / lean injection / rate-limited AI / credential filtering / cross-tool) complements the "companion that takes initiative" section.',
|
|
353
|
+
] },
|
|
349
354
|
'0.1.25': { zh: [
|
|
350
355
|
'文档:README 界面截图更新为最新实机截图(记忆面板概览/接续/日历/工作区导图/设置),中英双语说明。',
|
|
351
356
|
], en: [
|
package/package.json
CHANGED