dsh-mnemon 0.1.2 → 0.1.3
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.en.md +87 -120
- package/README.md +88 -121
- package/docs/assets/diagrams/en/memory-system-flow.png +0 -0
- package/docs/assets/diagrams/zh-CN/memory-system-flow.png +0 -0
- package/docs/assets/media/dsh-mnemon-memory-system-demo-poster.jpg +0 -0
- package/docs/assets/media/dsh-mnemon-memory-system-demo.gif +0 -0
- package/docs/assets/media/dsh-mnemon-memory-system-demo.mp4 +0 -0
- package/docs/assets/screenshots/conversation-memory-jump.png +0 -0
- package/docs/assets/screenshots/conversation-save-dialog.png +0 -0
- package/docs/assets/screenshots/conversation-turn-memory.png +0 -0
- package/docs/assets/screenshots/document-create-dialog.png +0 -0
- package/docs/assets/screenshots/documents-markdown.png +0 -0
- package/docs/assets/screenshots/entities-context.png +0 -0
- package/docs/assets/screenshots/memory-content.png +0 -0
- package/docs/assets/screenshots/overview-memory-graph.png +0 -0
- package/docs/assets/screenshots/recall-agent-answer.png +0 -0
- package/docs/assets/screenshots/remember-dialog.png +0 -0
- package/docs/assets/screenshots/runtime-memory-add.png +0 -0
- package/docs/assets/screenshots/runtime-memory.png +0 -0
- package/docs/assets/screenshots/settings-memory-system.png +0 -0
- package/docs/assets/screenshots/status-overview.png +0 -0
- package/docs/assets/screenshots/version-check.png +0 -0
- package/docs/en/README.md +38 -32
- package/docs/en/architecture.md +3 -1
- package/docs/en/configuration.md +4 -5
- package/docs/en/development.md +24 -4
- package/docs/en/getting-started.md +77 -87
- package/docs/en/interfaces.md +98 -90
- package/docs/en/operations.md +103 -93
- package/docs/en/project-overview.md +82 -198
- package/docs/en/ui-guide.md +156 -0
- package/docs/zh-CN/README.md +35 -29
- package/docs/zh-CN/architecture.md +3 -1
- package/docs/zh-CN/configuration.md +4 -5
- package/docs/zh-CN/development.md +24 -4
- package/docs/zh-CN/getting-started.md +70 -80
- package/docs/zh-CN/interfaces.md +84 -76
- package/docs/zh-CN/operations.md +96 -86
- package/docs/zh-CN/project-overview.md +78 -194
- package/docs/zh-CN/ui-guide.md +160 -0
- package/lib/client.js +2358 -1948
- package/lib/client.js.map +1 -1
- package/lib/index.js +446 -39
- package/lib/types/channels.d.ts +4 -0
- package/lib/types/channels.d.ts.map +1 -0
- package/lib/types/channels.js +4 -0
- package/lib/types/channels.js.map +1 -0
- package/lib/types/client/MnemonSaveAction.d.ts.map +1 -1
- package/lib/types/client/MnemonSaveAction.js +4 -55
- package/lib/types/client/MnemonSaveAction.js.map +1 -1
- package/lib/types/client/MnemonSettingsCard.d.ts.map +1 -1
- package/lib/types/client/MnemonSettingsCard.js +4 -5
- package/lib/types/client/MnemonSettingsCard.js.map +1 -1
- package/lib/types/client/MnemonTurnTail.d.ts +3 -0
- package/lib/types/client/MnemonTurnTail.d.ts.map +1 -1
- package/lib/types/client/MnemonTurnTail.js +15 -3
- package/lib/types/client/MnemonTurnTail.js.map +1 -1
- package/lib/types/client/MnemonView.d.ts +4 -0
- package/lib/types/client/MnemonView.d.ts.map +1 -1
- package/lib/types/client/MnemonView.js +424 -97
- package/lib/types/client/MnemonView.js.map +1 -1
- package/lib/types/client/MnemonViewAppearance.d.ts +21 -0
- package/lib/types/client/MnemonViewAppearance.d.ts.map +1 -0
- package/lib/types/client/MnemonViewAppearance.js +67 -0
- package/lib/types/client/MnemonViewAppearance.js.map +1 -0
- package/lib/types/client/anchor.d.ts +1 -1
- package/lib/types/client/anchor.js +1 -1
- package/lib/types/client/api.d.ts +4 -0
- package/lib/types/client/api.d.ts.map +1 -1
- package/lib/types/client/api.js +10 -1
- package/lib/types/client/api.js.map +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js +22 -25
- package/lib/types/client/index.js.map +1 -1
- package/lib/types/client/locales.d.ts +126 -294
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/locales.js +140 -308
- package/lib/types/client/locales.js.map +1 -1
- package/lib/types/client/settings.d.ts +1 -1
- package/lib/types/client/settings.d.ts.map +1 -1
- package/lib/types/client/settings.js +1 -1
- package/lib/types/client/settings.js.map +1 -1
- package/lib/types/client/sidebar-entry.d.ts +1 -1
- package/lib/types/client/sidebar-entry.d.ts.map +1 -1
- package/lib/types/client/sidebar-entry.js +3 -1
- package/lib/types/client/sidebar-entry.js.map +1 -1
- package/lib/types/client/workspace-mount.d.ts.map +1 -1
- package/lib/types/client/workspace-mount.js +8 -5
- package/lib/types/client/workspace-mount.js.map +1 -1
- package/lib/types/config.d.ts +1 -3
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/config.js +10 -12
- package/lib/types/config.js.map +1 -1
- package/lib/types/index.d.ts +2 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +2 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/lifecycle.js +3 -3
- package/lib/types/lifecycle.js.map +1 -1
- package/lib/types/memory-bodies.d.ts +1 -0
- package/lib/types/memory-bodies.d.ts.map +1 -1
- package/lib/types/memory-bodies.js +7 -0
- package/lib/types/memory-bodies.js.map +1 -1
- package/lib/types/rpc.d.ts +5 -7
- package/lib/types/rpc.d.ts.map +1 -1
- package/lib/types/rpc.js +28 -8
- package/lib/types/rpc.js.map +1 -1
- package/lib/types/service.d.ts +2 -0
- package/lib/types/service.d.ts.map +1 -1
- package/lib/types/service.js +4 -0
- package/lib/types/service.js.map +1 -1
- package/lib/types/settings.d.ts.map +1 -1
- package/lib/types/settings.js +1 -2
- package/lib/types/settings.js.map +1 -1
- package/lib/types/version-updates.d.ts +61 -0
- package/lib/types/version-updates.d.ts.map +1 -0
- package/lib/types/version-updates.js +377 -0
- package/lib/types/version-updates.js.map +1 -0
- package/package.json +4 -1
- package/docs/zh-CN/assets/screenshots/conversation-recall.png +0 -0
- package/docs/zh-CN/assets/screenshots/conversation-writeback.png +0 -0
- package/docs/zh-CN/assets/screenshots/documents-markdown.png +0 -0
- package/docs/zh-CN/assets/screenshots/entities-context.png +0 -0
- package/docs/zh-CN/assets/screenshots/memory-content.png +0 -0
- package/docs/zh-CN/assets/screenshots/overview-memory-graph.png +0 -0
- package/docs/zh-CN/assets/screenshots/recall-agent-answer.png +0 -0
- package/docs/zh-CN/assets/screenshots/runtime-memory.png +0 -0
- package/lib/types/client/MnemonToolviews.d.ts +0 -19
- package/lib/types/client/MnemonToolviews.d.ts.map +0 -1
- package/lib/types/client/MnemonToolviews.js +0 -172
- package/lib/types/client/MnemonToolviews.js.map +0 -1
- /package/docs/{en/assets → assets/diagrams/en}/project-architecture.svg +0 -0
- /package/docs/{zh-CN/assets → assets/diagrams/zh-CN}/project-architecture.svg +0 -0
package/README.en.md
CHANGED
|
@@ -1,85 +1,33 @@
|
|
|
1
1
|
<h1 align="center">dsh-mnemon</h1>
|
|
2
2
|
|
|
3
|
-
<p align="center"><a href="./README.md">简体中文</a>
|
|
3
|
+
<p align="center"><a href="./README.md">简体中文</a> · <strong>English</strong></p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<a href="./docs/en/
|
|
7
|
-
<img src="./docs/assets/dsh-mnemon-memory-system-demo-poster.jpg" alt="
|
|
6
|
+
<a href="./docs/en/ui-guide.md">
|
|
7
|
+
<img src="./docs/assets/media/dsh-mnemon-memory-system-demo-poster.jpg" alt="dsh-mnemon Sidebar Memory System with Memory Space catalog and relationship graph" width="760">
|
|
8
8
|
</a>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
|
-
>
|
|
11
|
+
<p align="center"><strong>Local, layered, supervised long-term memory for DeepSeek Harness.</strong></p>
|
|
12
12
|
|
|
13
|
-
`dsh-mnemon`
|
|
13
|
+
`dsh-mnemon` integrates [Mnemon](https://github.com/mnemon-dev/mnemon) with DeepSeek Harness (DSH). It brings hot memory needed every turn, full project Documents, and on-demand long-term Memory Spaces into one workbench.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
- **Local first**: memory stays in local SQLite, JSON, and Markdown; no remote memory service is required.
|
|
16
|
+
- **Three cooperating tiers**: Runtime Memory, Project Documents, and Memory Spaces retain information at the right granularity.
|
|
17
|
+
- **Supervised writes**: isolated memory subagents make semantic decisions; the Host enforces paths, permissions, capacity, locks, and revisions.
|
|
18
|
+
- **Native DSH experience**: a Sidebar workbench by default, turn memory, a Save-to-memory dialog, bilingual copy, and global themes.
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
Current user instructions, repository files, and live tool results always take precedence over historical memory.
|
|
18
21
|
|
|
19
22
|
## Live demo
|
|
20
23
|
|
|
21
|
-

|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
See the [Sidebar and conversation UI guide](./docs/en/ui-guide.md) for the complete visual walkthrough.
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|---|---|---|---|
|
|
27
|
-
| Runtime Memory | User preferences, stable conventions, environment facts, frequently used lessons | Explicit operations or an eligible background review update `memories.json`, then generate `USER.md` / `MEMORY.md` projections | Injected directly every turn |
|
|
28
|
-
| Project Documents | Designs, investigations, procedures, rationale, and handoffs | Create or update managed Markdown and `index.json`; capacity maintenance creates a Mnemon cold reference before moving the original | Search active Documents first, then read full text on demand |
|
|
29
|
-
| Memory Spaces | Cross-session facts, decisions, entities, and relationships | A bounded `spawn` worker selects the narrowest space, checks duplicates, and writes four-graph memory through Mnemon `remember` / `link` | Recalled on demand from active Memory Spaces only |
|
|
28
|
+
## Start in five minutes
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
Reusable knowledge produced by current work
|
|
33
|
-
|
|
|
34
|
-
+-- Compact, stable, useful every turn
|
|
35
|
-
| root Agent / eligible fork review
|
|
36
|
-
| |
|
|
37
|
-
| add | replace | remove
|
|
38
|
-
| v
|
|
39
|
-
| memories.json (source of truth)
|
|
40
|
-
| |
|
|
41
|
-
| USER.md + MEMORY.md ----------> every prompt
|
|
42
|
-
|
|
|
43
|
-
+-- Complete designs, research, procedures, handoffs
|
|
44
|
-
| root Agent / eligible fork review
|
|
45
|
-
| |
|
|
46
|
-
| create | update
|
|
47
|
-
| v
|
|
48
|
-
| index.json + active/*.md ------> full text after search
|
|
49
|
-
| |
|
|
50
|
-
| Mnemon cold reference -> archived/*.md (maintenance)
|
|
51
|
-
|
|
|
52
|
-
`-- Cross-session facts, decisions, entities, relations
|
|
53
|
-
root Agent
|
|
54
|
-
|
|
|
55
|
-
spawn: route / deduplicate / write
|
|
56
|
-
v
|
|
57
|
-
Mnemon CLI -> <space>/mnemon.db
|
|
58
|
-
|
|
|
59
|
-
spawn: recall active spaces only -> bounded evidence
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Highlights
|
|
63
|
-
|
|
64
|
-
- Proactive memory routing: built-in prompts, lifecycle cues, and tool descriptions encourage the LLM to use every read/write surface when useful; explicit requests to revisit, retain, correct, forget, or document are routed to the matching tier and operation.
|
|
65
|
-
- One `global`, `workspace`, or `custom` storage scope for all three tiers.
|
|
66
|
-
- A Memory Space directory in which each space has a stable ID, name, routing description, activation state, and its own `mnemon.db`.
|
|
67
|
-
- Bounded subagents: isolated `spawn` workers handle durable recall and semantic writes; a `fork` worker inherits a completed checkpoint for background review.
|
|
68
|
-
- Safe capacity maintenance: USER memory is compacted locally, MEMORY entries are archived before compaction, and Documents are cold-indexed before migration; revision conflicts preserve the original data.
|
|
69
|
-
- Native DSH integration through model tools, `/mnemon` commands, a bilingual Web workspace, global light/dark themes, and diagnostics.
|
|
70
|
-
- Local-first execution: the CLI is started with argument arrays and no shell, and no remote memory service is required.
|
|
71
|
-
|
|
72
|
-
## Prerequisites
|
|
73
|
-
|
|
74
|
-
- A working DSH Web profile.
|
|
75
|
-
- A local `mnemon` CLI.
|
|
76
|
-
- A subagent provider supporting `outputSchema`, `toolFilter`, `persona`, and `depthLimit`. Regular semantic work prefers `spawn`; the default background review also requires a provider named `fork` that inherits parent context.
|
|
77
|
-
|
|
78
|
-
**Compatibility baseline**: `dsh-mnemon` 0.1.0 has been verified end-to-end on a live web profile running `@deepseek-ai/dsh` 0.1.0-rc.6 (2026-08-13 snapshot); last verified 2026-08-14. The plugin declares no fixed minimum-version matrix. DSH moves fast: before upgrading, re-run the [Getting Started](./docs/en/getting-started.md) verification steps in an isolated profile or a backed-up data directory.
|
|
79
|
-
|
|
80
|
-
## Quick start
|
|
81
|
-
|
|
82
|
-
Install Mnemon:
|
|
30
|
+
### 1. Install Mnemon
|
|
83
31
|
|
|
84
32
|
```sh
|
|
85
33
|
# macOS
|
|
@@ -91,42 +39,66 @@ go install github.com/mnemon-dev/mnemon@latest
|
|
|
91
39
|
mnemon --version
|
|
92
40
|
```
|
|
93
41
|
|
|
94
|
-
Install the plugin
|
|
42
|
+
### 2. Install the plugin
|
|
95
43
|
|
|
96
44
|
```sh
|
|
97
45
|
dsh plugin --profile web add dsh-mnemon
|
|
98
46
|
dsh --profile web
|
|
99
47
|
```
|
|
100
48
|
|
|
101
|
-
|
|
49
|
+
Use an absolute path for a local development checkout:
|
|
102
50
|
|
|
103
51
|
```sh
|
|
104
|
-
dsh plugin --profile web add "
|
|
52
|
+
dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
|
|
105
53
|
```
|
|
106
54
|
|
|
107
|
-
|
|
55
|
+
### 3. Open Memory System
|
|
108
56
|
|
|
109
|
-
|
|
110
|
-
dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
|
|
111
|
-
```
|
|
57
|
+
New installations use `sidebar` by default. Click **Memory System** in the DSH sidebar, then follow this first-run path:
|
|
112
58
|
|
|
113
|
-
|
|
59
|
+
1. Confirm the Mnemon CLI, Runtime, Memory Spaces, and Documents are healthy under **Status**.
|
|
60
|
+
2. Create a narrowly scoped Memory Space under **Memory Spaces → Overview**.
|
|
61
|
+
3. Submit one stable, future-useful item through **Remember**.
|
|
62
|
+
4. Verify it with a focused question under **Recall**.
|
|
63
|
+
5. Return to the conversation and expand **Turn memory** below the answer.
|
|
114
64
|
|
|
115
|
-
|
|
65
|
+
See [Getting Started](./docs/en/getting-started.md) for provider requirements and complete verification.
|
|
116
66
|
|
|
117
|
-
|
|
118
|
-
# Upgrade
|
|
119
|
-
dsh plugin --profile web update dsh-mnemon
|
|
67
|
+
## One workbench, three memory tiers
|
|
120
68
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
69
|
+
| Tier | Best for | How it reaches context |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| **Runtime** | User preferences, collaboration rules, project conventions, environment facts | Compact `USER.md` / `MEMORY.md` projections on every turn |
|
|
72
|
+
| **Documents** | Designs, investigations, procedures, postmortems, and handoffs | Deterministic search of active Documents, then full text on demand |
|
|
73
|
+
| **Memory Spaces** | Cross-session facts, decisions, entities, and relations | Bounded evidence recalled on demand from active spaces only |
|
|
74
|
+
|
|
75
|
+
The tiers are not simple copies of the same content. Knowledge is routed by frequency, narrative length, and retrieval needs. See [Storage and the three-tier model](./docs/en/storage-model.md).
|
|
76
|
+
|
|
77
|
+
## Sidebar workbench
|
|
78
|
+
|
|
79
|
+
| Page | Main purpose |
|
|
80
|
+
|---|---|
|
|
81
|
+
| **Status** | Inspect connection, storage root, tier summaries, and Mnemon / dsh-mnemon versions |
|
|
82
|
+
| **Runtime** | Inspect USER / MEMORY capacity; filter, add, edit, or remove hot memory |
|
|
83
|
+
| **Memory Spaces** | Manage activation; switch among Overview, Recall, Content, and Entities; open Remember |
|
|
84
|
+
| **Documents** | Search, read, create, edit, and archive managed Markdown documents |
|
|
85
|
+
|
|
86
|
+
Add and edit use consistent dialogs, destructive actions require confirmation, long collections expose filters and progressive loading, and Documents use a dedicated reader.
|
|
87
|
+
|
|
88
|
+
### Memory inside conversations
|
|
89
|
+
|
|
90
|
+
| Turn memory | Save to memory |
|
|
91
|
+
|---|---|
|
|
92
|
+
| [](./docs/assets/screenshots/conversation-turn-memory.png) | [](./docs/assets/screenshots/conversation-save-dialog.png) |
|
|
124
93
|
|
|
125
|
-
|
|
94
|
+
- **Turn memory** summarizes recalls, writes, and Document searches for the turn; expand it to jump to the matching page.
|
|
95
|
+
- **Save to memory** loads an editable candidate. Only confirmation sends it to the memory subagent for qualification, deduplication, distillation, and writing.
|
|
126
96
|
|
|
127
|
-
|
|
97
|
+
Both are on by default. Disable them independently under **Settings → Memory System → Conversation interface**; saved changes apply live.
|
|
128
98
|
|
|
129
|
-
|
|
99
|
+
## Display and storage
|
|
100
|
+
|
|
101
|
+
Configuration lives in `$DSH_HOME/settings.yaml` (commonly `~/.dsh/settings.yaml`):
|
|
130
102
|
|
|
131
103
|
```yaml
|
|
132
104
|
mnemon:
|
|
@@ -134,23 +106,17 @@ mnemon:
|
|
|
134
106
|
storageScope: global # global | workspace | custom
|
|
135
107
|
```
|
|
136
108
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
The Web workspace contains Status, Runtime, Memory Spaces, Documents, Distill, Recall, Entities, and Content pages in three divider-separated groups: “Status” stands alone; “Runtime, Memory Spaces, Documents” cover the three storage tiers; “Distill, Recall, Entities, Content” are the read/write tools. Its main interface follows DSH's global Chinese/English locale.
|
|
109
|
+
| Choice | Behavior |
|
|
110
|
+
|---|---|
|
|
111
|
+
| `sidebar` | Default dedicated workbench aligned with official DSH panel styling |
|
|
112
|
+
| `buildin` | Preserves the original conversation-area presentation and visuals |
|
|
113
|
+
| `global` | Shares `~/.mnemon` (or `MNEMON_DATA_DIR`) across workspaces |
|
|
114
|
+
| `workspace` | Uses `<workspace>/.mnemon`; the workbench may inspect another workspace while the Agent still follows the current session |
|
|
115
|
+
| `custom` | Uses an absolute or `~/...` path supplied through `dataDir` |
|
|
146
116
|
|
|
147
|
-
|
|
117
|
+
Saved settings apply live without a manual refresh. Changing scope never migrates, merges, or deletes old data. If the inspected workspace differs from the session's effective workspace, the header explains the mismatch and offers one-click alignment.
|
|
148
118
|
|
|
149
|
-
|
|
150
|
-
- **Turn memory bar**: completed calls are separated into successful recalls, writes, document searches, and inspections, with failures reported independently; expand it for the exact tool names;
|
|
151
|
-
- **Save to memory**: every finalized assistant reply carries a “Save to memory” action; the candidate is editable, and submission routes through the isolated memory subagent (judgment, dedupe, distillation) without filling the main conversation context.
|
|
152
|
-
|
|
153
|
-
Common commands:
|
|
119
|
+
## Common commands
|
|
154
120
|
|
|
155
121
|
```text
|
|
156
122
|
/mnemon status
|
|
@@ -160,30 +126,31 @@ Common commands:
|
|
|
160
126
|
/mnemon forget <full memory ID>
|
|
161
127
|
```
|
|
162
128
|
|
|
163
|
-
|
|
129
|
+
Recommended lookup order: Runtime Memory → active Documents → active Memory Spaces → archived original referenced by a hit.
|
|
130
|
+
|
|
131
|
+
## Data and security boundaries
|
|
164
132
|
|
|
165
|
-
|
|
133
|
+
- The plugin reaches durable memory through the local `mnemon` CLI. The WebUI neither reads SQLite directly nor starts processes.
|
|
134
|
+
- CLI calls use argument arrays with shell disabled, bounded output, timeouts, and cancellation.
|
|
135
|
+
- The plugin stores no API keys. Subagent inference uses the provider already configured in DSH.
|
|
136
|
+
- There is no deterministic secret scanner yet. Never store keys, tokens, private keys, or raw sensitive logs in any tier.
|
|
137
|
+
- Uninstalling the plugin does not remove data under `~/.mnemon`, workspace `.mnemon` roots, or custom directories.
|
|
166
138
|
|
|
167
|
-
|
|
168
|
-
- **Processes**: `mnemon` is started as an argument array with shell disabled, bounded output, and `SIGTERM` then `SIGKILL` on timeout.
|
|
169
|
-
- **Network**: the plugin and Mnemon both run locally and make no remote calls; subagent model inference uses DSH's existing provider connection.
|
|
170
|
-
- **Credentials**: the plugin stores and reads no credentials or API keys; model credentials are fully managed by DSH and your provider.
|
|
171
|
-
- **User data**: all memory content (user profile, project Documents, long-term memory) stays in local SQLite / JSON and is never uploaded.
|
|
172
|
-
- **Honest disclosure**: there is no deterministic credential/secret scanner yet — do not write keys, tokens, or private keys into hot memory, Documents, or Memory Spaces. For the full boundaries (process/file/Web/model) and backup/restore, see [Operations, security, and troubleshooting](./docs/en/operations.md).
|
|
139
|
+
See [Operations, security, and troubleshooting](./docs/en/operations.md) for complete boundaries, backup, recovery, and diagnostics.
|
|
173
140
|
|
|
174
141
|
## Documentation
|
|
175
142
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
- [Getting
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
143
|
+
| I want to… | Start here |
|
|
144
|
+
|---|---|
|
|
145
|
+
| Install and complete first-run verification | [Getting Started](./docs/en/getting-started.md) |
|
|
146
|
+
| Learn every page and conversation entry | [Sidebar and conversation UI guide](./docs/en/ui-guide.md) |
|
|
147
|
+
| Understand the three tiers and complete flow | [Project overview](./docs/en/project-overview.md) · [Lifecycle and workflows](./docs/en/workflows.md) |
|
|
148
|
+
| Choose storage scope or advanced switches | [Configuration reference](./docs/en/configuration.md) |
|
|
149
|
+
| Back up, update, or troubleshoot | [Operations, security, and troubleshooting](./docs/en/operations.md) |
|
|
150
|
+
| Integrate tools, commands, or RPC | [Interface reference](./docs/en/interfaces.md) |
|
|
151
|
+
| Develop, test, or publish | [Development and verification](./docs/en/development.md) |
|
|
152
|
+
|
|
153
|
+
See the [documentation hub](./docs/en/README.md) for the full map.
|
|
187
154
|
|
|
188
155
|
## Development
|
|
189
156
|
|
|
@@ -192,8 +159,8 @@ pnpm install
|
|
|
192
159
|
pnpm run verify
|
|
193
160
|
```
|
|
194
161
|
|
|
195
|
-
`verify` runs TypeScript checks, Vitest, and the production build. Generated artifacts are
|
|
162
|
+
`verify` runs TypeScript checks, Vitest, and the production build. Generated artifacts are committed under `lib/`.
|
|
196
163
|
|
|
197
164
|
## License
|
|
198
165
|
|
|
199
|
-
MIT.
|
|
166
|
+
MIT. Report security issues privately through [SECURITY.md](./SECURITY.md), not a public issue.
|
package/README.md
CHANGED
|
@@ -1,132 +1,104 @@
|
|
|
1
1
|
<h1 align="center">dsh-mnemon</h1>
|
|
2
2
|
|
|
3
|
-
<p align="center"><strong>简体中文</strong>
|
|
3
|
+
<p align="center"><strong>简体中文</strong> · <a href="./README.en.md">English</a></p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<a href="./docs/zh-CN/
|
|
7
|
-
<img src="./docs/assets/dsh-mnemon-memory-system-demo-poster.jpg" alt="
|
|
6
|
+
<a href="./docs/zh-CN/ui-guide.md">
|
|
7
|
+
<img src="./docs/assets/media/dsh-mnemon-memory-system-demo-poster.jpg" alt="dsh-mnemon Sidebar 记忆系统:记忆体目录与关系图" width="760">
|
|
8
8
|
</a>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
<p align="center"><strong>让 DeepSeek Harness 拥有本地、分层、可监督的长期记忆。</strong></p>
|
|
12
12
|
|
|
13
|
-
`dsh-mnemon`
|
|
13
|
+
`dsh-mnemon` 将 [Mnemon](https://github.com/mnemon-dev/mnemon) 接入 DeepSeek Harness(DSH),并把每轮需要的热记忆、需要完整阅读的项目档案和按需召回的长期记忆体组织在同一个工作台中。
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
- **本地优先**:记忆保存在本机 SQLite、JSON 与 Markdown 中,不依赖远程记忆服务。
|
|
16
|
+
- **三层协作**:运行时记忆、项目档案、记忆体各自保存适合自己的信息粒度。
|
|
17
|
+
- **受监督写入**:语义判断交给隔离的记忆子 Agent,路径、权限、容量、锁与 revision 由 Host 控制。
|
|
18
|
+
- **DSH 原生体验**:默认 Sidebar 工作台、对话内回合记忆、存入记忆弹窗、双语界面与明暗主题。
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
当前用户指令、仓库文件与实时工具结果始终高于历史记忆。
|
|
18
21
|
|
|
19
22
|
## 实机演示
|
|
20
23
|
|
|
21
|
-

|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
完整逐页说明见 [Sidebar 与对话交互指南](./docs/zh-CN/ui-guide.md)。
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|---|---|---|---|
|
|
27
|
-
| 运行时热记忆 | 用户偏好、稳定约定、环境事实、常用经验 | 显式操作或合格的后台审查更新 `memories.json`,再生成 `USER.md` / `MEMORY.md` 投影 | 每轮直接注入 |
|
|
28
|
-
| 项目档案 | 设计、调查、流程、架构理由、交接材料 | 创建或更新受管 Markdown 与 `index.json`;整理容量时先建立 Mnemon 冷引用,再迁移原文 | 先检索 active Documents,再按需读取全文 |
|
|
29
|
-
| 记忆体 | 跨会话的长期事实、决策、实体与关系 | 受限 `spawn` worker 选择最窄空间并查重,通过 Mnemon `remember` / `link` 写入四图 | 只从已激活 Memory Spaces 按需召回 |
|
|
28
|
+
## 5 分钟开始使用
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
当前任务产生的可复用信息
|
|
33
|
-
|
|
|
34
|
-
+-- 短小、稳定、每轮常用
|
|
35
|
-
| 主 Agent / 合格的 fork 审查
|
|
36
|
-
| |
|
|
37
|
-
| add | replace | remove
|
|
38
|
-
| v
|
|
39
|
-
| memories.json(权威源)
|
|
40
|
-
| |
|
|
41
|
-
| USER.md + MEMORY.md ----------> 每轮 prompt
|
|
42
|
-
|
|
|
43
|
-
+-- 完整设计、调查、流程与交接
|
|
44
|
-
| 主 Agent / 合格的 fork 审查
|
|
45
|
-
| |
|
|
46
|
-
| create | update
|
|
47
|
-
| v
|
|
48
|
-
| index.json + active/*.md ------> 检索后按需全文
|
|
49
|
-
| |
|
|
50
|
-
| Mnemon 冷引用 -> archived/*.md(容量整理)
|
|
51
|
-
|
|
|
52
|
-
`-- 跨会话事实、决策、实体与关系
|
|
53
|
-
主 Agent
|
|
54
|
-
|
|
|
55
|
-
spawn:选空间 / 查重 / 写入
|
|
56
|
-
v
|
|
57
|
-
Mnemon CLI -> <space>/mnemon.db
|
|
58
|
-
|
|
|
59
|
-
spawn:仅召回 active 空间 -------> 有界证据
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## 核心能力
|
|
63
|
-
|
|
64
|
-
- 主动记忆路由:内置 Prompt、生命周期提示与工具说明会启发 LLM 按需调用全部读写能力;用户明确要求回顾、记住、修改、忘记或建档时,会自动选择对应层级和操作。
|
|
65
|
-
- 统一的 `global`、`workspace` 或 `custom` 存储范围,覆盖三层数据。
|
|
66
|
-
- 多记忆体目录:每个记忆体拥有稳定 ID、名称、路由说明、激活状态和独立 `mnemon.db`。
|
|
67
|
-
- 受限子 Agent:长期召回与语义写入使用隔离的 `spawn` worker;后台审查使用继承已完成 checkpoint 的 `fork` worker。
|
|
68
|
-
- 可靠容量维护:USER 热记忆在本地保守合并,MEMORY 热记忆先归档再压缩,Documents 先建立冷索引再迁移;revision 冲突时保留原数据。
|
|
69
|
-
- DSH 原生体验:模型工具、`/mnemon` 命令、双语 Web 工作台、全局明暗主题和诊断状态页。
|
|
70
|
-
- 本地优先:CLI 以参数数组启动且禁用 shell;数据库和文档不需要远程记忆服务。
|
|
71
|
-
|
|
72
|
-
## 前置条件
|
|
73
|
-
|
|
74
|
-
- 可用的 DSH Web profile。
|
|
75
|
-
- 本地 `mnemon` CLI。
|
|
76
|
-
- 支持 `outputSchema`、`toolFilter`、`persona` 和 `depthLimit` 的子 Agent provider。常规语义操作优先使用 `spawn`;默认后台审查还需要名为 `fork`、可继承父上下文的 provider。
|
|
77
|
-
|
|
78
|
-
**兼容基线**:`dsh-mnemon` 0.1.0 已在 `@deepseek-ai/dsh` 0.1.0-rc.6(2026-08-13 快照)的 live web profile 上实测通过,最后验证日期 2026-08-14。插件不声明固定的最低版本矩阵;DSH 迭代快,升级前先在隔离 profile 或已备份的数据目录中复跑[快速开始](./docs/zh-CN/getting-started.md)的验证步骤。
|
|
79
|
-
|
|
80
|
-
## 快速开始
|
|
81
|
-
|
|
82
|
-
安装 Mnemon:
|
|
30
|
+
### 1. 安装 Mnemon
|
|
83
31
|
|
|
84
32
|
```sh
|
|
85
33
|
# macOS
|
|
86
34
|
brew install --cask mnemon-dev/tap/mnemon
|
|
87
35
|
|
|
88
|
-
# macOS / Linux
|
|
36
|
+
# macOS / Linux,也可以通过 Go 安装
|
|
89
37
|
go install github.com/mnemon-dev/mnemon@latest
|
|
90
38
|
|
|
91
39
|
mnemon --version
|
|
92
40
|
```
|
|
93
41
|
|
|
94
|
-
|
|
42
|
+
### 2. 安装插件
|
|
95
43
|
|
|
96
44
|
```sh
|
|
97
45
|
dsh plugin --profile web add dsh-mnemon
|
|
98
46
|
dsh --profile web
|
|
99
47
|
```
|
|
100
48
|
|
|
101
|
-
未发布到 npm 的预发布版本可从 git 安装:
|
|
102
|
-
|
|
103
|
-
```sh
|
|
104
|
-
dsh plugin --profile web add "github:omdsh-dev/dsh-mnemon"
|
|
105
|
-
```
|
|
106
|
-
|
|
107
49
|
本地开发检出使用绝对路径:
|
|
108
50
|
|
|
109
51
|
```sh
|
|
110
52
|
dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
|
|
111
53
|
```
|
|
112
54
|
|
|
113
|
-
|
|
55
|
+
### 3. 打开记忆系统
|
|
114
56
|
|
|
115
|
-
|
|
57
|
+
安装后默认使用 `sidebar`:点击 DSH 左侧栏的“记忆系统”即可进入。第一次使用建议按以下顺序:
|
|
116
58
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
59
|
+
1. 在“状态”确认 Mnemon CLI、运行时、记忆体与档案均正常;
|
|
60
|
+
2. 在“记忆体 → 概览”创建一个边界明确的记忆体;
|
|
61
|
+
3. 用“沉淀记忆”提交一条稳定、未来仍有用的信息;
|
|
62
|
+
4. 在“检索”用一个聚焦问题验证召回;
|
|
63
|
+
5. 回到对话,展开回复下方的“本回合记忆”查看工具轨迹。
|
|
120
64
|
|
|
121
|
-
|
|
122
|
-
dsh plugin --profile web remove dsh-mnemon
|
|
123
|
-
```
|
|
65
|
+
更完整的安装、Provider 要求与验证步骤见[快速开始](./docs/zh-CN/getting-started.md)。
|
|
124
66
|
|
|
125
|
-
|
|
67
|
+
## 一个工作台,三层记忆
|
|
126
68
|
|
|
127
|
-
|
|
69
|
+
| 层级 | 适合保存 | 如何进入上下文 |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| **运行时** | 用户偏好、协作要求、项目约定、环境事实 | `USER.md` / `MEMORY.md` 每轮紧凑注入 |
|
|
72
|
+
| **档案** | 设计、调查、流程、复盘、交接材料 | 先确定性检索 active Documents,再按需阅读全文 |
|
|
73
|
+
| **记忆体** | 跨会话事实、决策、实体与关系 | 只从已激活 Memory Spaces 按需召回有界证据 |
|
|
128
74
|
|
|
129
|
-
|
|
75
|
+
三层不是同一内容的简单复制:信息会按使用频率、叙事长度和召回方式进入最合适的层级。完整规则见[存储与三层记忆模型](./docs/zh-CN/storage-model.md)。
|
|
76
|
+
|
|
77
|
+
## Sidebar 工作台
|
|
78
|
+
|
|
79
|
+
| 页面 | 主要用途 |
|
|
80
|
+
|---|---|
|
|
81
|
+
| **状态** | 检查连接、存储根、三层数据摘要,以及 Mnemon / dsh-mnemon 版本 |
|
|
82
|
+
| **运行时** | 查看 USER / MEMORY 容量,筛选、添加、编辑或移除热记忆 |
|
|
83
|
+
| **记忆体** | 管理激活边界;在概览、检索、内容、实体之间切换;打开“沉淀记忆” |
|
|
84
|
+
| **档案** | 搜索、阅读、新建、编辑与归档受管 Markdown 文档 |
|
|
85
|
+
|
|
86
|
+
添加与编辑使用统一弹窗;危险操作需要二次确认;长列表采用筛选、计数与“加载更多”,档案正文使用独立阅读区域。
|
|
87
|
+
|
|
88
|
+
### 对话内记忆
|
|
89
|
+
|
|
90
|
+
| 本回合记忆 | 存入记忆 |
|
|
91
|
+
|---|---|
|
|
92
|
+
| [](./docs/assets/screenshots/conversation-turn-memory.png) | [](./docs/assets/screenshots/conversation-save-dialog.png) |
|
|
93
|
+
|
|
94
|
+
- **本回合记忆**汇总本轮的召回、沉淀与档案检索;展开后可以跳到对应页面。
|
|
95
|
+
- **存入记忆**先加载可编辑候选,只有确认后才交给记忆子 Agent 判断、查重、提炼并写入。
|
|
96
|
+
|
|
97
|
+
这两个入口默认开启,可在“设置 → 记忆系统 → 对话界面”中分别关闭,保存后实时生效。
|
|
98
|
+
|
|
99
|
+
## 展示与存储
|
|
100
|
+
|
|
101
|
+
配置位于 `$DSH_HOME/settings.yaml`(通常为 `~/.dsh/settings.yaml`):
|
|
130
102
|
|
|
131
103
|
```yaml
|
|
132
104
|
mnemon:
|
|
@@ -134,23 +106,17 @@ mnemon:
|
|
|
134
106
|
storageScope: global # global | workspace | custom
|
|
135
107
|
```
|
|
136
108
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
Web 工作台提供状态、运行时、记忆体、档案、沉淀、检索、实体、内容八个页面,分为三组:「状态」独立成第一组;「运行时、记忆体、档案」对应三层存储;「沉淀、检索、实体、内容」为读写工具。主要界面随 DSH 全局语言在中文与英文间切换。
|
|
109
|
+
| 选择 | 行为 |
|
|
110
|
+
|---|---|
|
|
111
|
+
| `sidebar` | 默认;左侧栏独立工作台,采用与 DSH 官方面板一致的极简外观 |
|
|
112
|
+
| `buildin` | 保留原有对话区内嵌形态及其既有视觉 |
|
|
113
|
+
| `global` | 多个工作区共享 `~/.mnemon`(或 `MNEMON_DATA_DIR`) |
|
|
114
|
+
| `workspace` | 每个工作区使用自己的 `<workspace>/.mnemon`;工作台可查看其他工作区,Agent 仍跟随当前会话 |
|
|
115
|
+
| `custom` | 使用 `dataDir` 指定的绝对路径或 `~/...` |
|
|
146
116
|
|
|
147
|
-
|
|
117
|
+
设置保存后实时生效,无需手动刷新。切换存储范围不会自动迁移、合并或删除旧数据;工作区查看目标与会话实际目录不一致时,顶部会提示并提供一键对齐。
|
|
148
118
|
|
|
149
|
-
|
|
150
|
-
- **回合记忆条**:完成的回合若触及记忆,回合尾会按成功结果区分召回、沉淀、档案检索和检查,并单独标出失败数;展开可见具体工具名;
|
|
151
|
-
- **存入记忆**:每条已定稿的助手回复旁有「存入记忆」按钮,候选内容可编辑,提交后由隔离的记忆子 Agent 判断、查重并沉淀,不占用主对话上下文。
|
|
152
|
-
|
|
153
|
-
常用命令:
|
|
119
|
+
## 常用命令
|
|
154
120
|
|
|
155
121
|
```text
|
|
156
122
|
/mnemon status
|
|
@@ -160,30 +126,31 @@ Web 工作台提供状态、运行时、记忆体、档案、沉淀、检索、
|
|
|
160
126
|
/mnemon forget <完整记忆 ID>
|
|
161
127
|
```
|
|
162
128
|
|
|
163
|
-
|
|
129
|
+
推荐查询顺序:运行时热记忆 → active Documents → 已激活记忆体 → 命中记录指向的归档原文。
|
|
130
|
+
|
|
131
|
+
## 数据与安全边界
|
|
164
132
|
|
|
165
|
-
|
|
133
|
+
- 插件通过本地 `mnemon` CLI 访问长期记忆;WebUI 不直接读取 SQLite,也不直接启动进程。
|
|
134
|
+
- CLI 使用参数数组且禁用 shell;输出、超时和取消均有边界。
|
|
135
|
+
- 插件不保存 API key;子 Agent 推理复用 DSH 已配置的 Provider。
|
|
136
|
+
- 当前没有确定性的秘密扫描器。不要把密钥、token、私钥或原始敏感日志写入任何记忆层。
|
|
137
|
+
- 卸载插件不会删除 `~/.mnemon`、工作区 `.mnemon` 或自定义目录中的数据。
|
|
166
138
|
|
|
167
|
-
-
|
|
168
|
-
- **进程**:`mnemon` 以参数数组启动且禁用 shell,输出有上限,超时先 `SIGTERM` 再 `SIGKILL`。
|
|
169
|
-
- **网络**:插件与 Mnemon 均本地运行,不发起远程调用;子 Agent 的模型推理走 DSH 已有的 provider 连接。
|
|
170
|
-
- **凭据**:插件不存储、不读取任何凭据或 API key,模型凭据完全由 DSH 与 provider 管理。
|
|
171
|
-
- **用户数据**:记忆内容(用户画像、项目档案、长期记忆)全部落在本地 SQLite / JSON,不会上传。
|
|
172
|
-
- **诚实披露**:当前没有确定性的凭据/秘密检测器,请勿向热记忆、Documents 或 Memory Spaces 写入密钥、token 或私钥。完整边界(进程/文件/Web/模型)与备份恢复见[运维、安全与故障排查](./docs/zh-CN/operations.md)。
|
|
139
|
+
完整边界、备份恢复与故障排查见[运维指南](./docs/zh-CN/operations.md)。
|
|
173
140
|
|
|
174
141
|
## 文档
|
|
175
142
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
143
|
+
| 我想要…… | 从这里开始 |
|
|
144
|
+
|---|---|
|
|
145
|
+
| 安装并完成第一次验证 | [快速开始](./docs/zh-CN/getting-started.md) |
|
|
146
|
+
| 认识每个页面与对话内入口 | [Sidebar 与对话交互指南](./docs/zh-CN/ui-guide.md) |
|
|
147
|
+
| 理解三层模型和完整流转 | [项目介绍](./docs/zh-CN/project-overview.md) · [生命周期与核心流程](./docs/zh-CN/workflows.md) |
|
|
148
|
+
| 选择存储范围或高级开关 | [配置参考](./docs/zh-CN/configuration.md) |
|
|
149
|
+
| 备份、更新或排查问题 | [运维、安全与故障排查](./docs/zh-CN/operations.md) |
|
|
150
|
+
| 集成工具、命令或 RPC | [接口参考](./docs/zh-CN/interfaces.md) |
|
|
151
|
+
| 开发、测试或发布 | [开发与验证](./docs/zh-CN/development.md) |
|
|
152
|
+
|
|
153
|
+
完整目录见[文档中心](./docs/zh-CN/README.md)。
|
|
187
154
|
|
|
188
155
|
## 开发
|
|
189
156
|
|
|
@@ -192,8 +159,8 @@ pnpm install
|
|
|
192
159
|
pnpm run verify
|
|
193
160
|
```
|
|
194
161
|
|
|
195
|
-
`verify` 依次运行 TypeScript 检查、Vitest
|
|
162
|
+
`verify` 依次运行 TypeScript 检查、Vitest 和生产构建。构建产物提交在 `lib/` 中。
|
|
196
163
|
|
|
197
164
|
## License
|
|
198
165
|
|
|
199
|
-
MIT
|
|
166
|
+
MIT。安全问题请按 [SECURITY.md](./SECURITY.md) 私下报告,不要直接创建公开 issue。
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|