dsh-mnemon 0.1.1 → 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 +88 -120
- package/README.md +89 -121
- package/cordis.patch.yml +1 -0
- 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 +13 -9
- package/docs/en/development.md +24 -4
- package/docs/en/getting-started.md +78 -86
- package/docs/en/interfaces.md +99 -89
- package/docs/en/operations.md +103 -92
- package/docs/en/project-overview.md +82 -196
- package/docs/en/roadmap.md +1 -1
- package/docs/en/storage-model.md +1 -1
- 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 +13 -9
- package/docs/zh-CN/development.md +24 -4
- package/docs/zh-CN/getting-started.md +71 -79
- package/docs/zh-CN/interfaces.md +84 -74
- package/docs/zh-CN/operations.md +96 -85
- package/docs/zh-CN/project-overview.md +78 -192
- package/docs/zh-CN/roadmap.md +1 -1
- package/docs/zh-CN/storage-model.md +1 -1
- package/docs/zh-CN/ui-guide.md +160 -0
- package/lib/client.js +2836 -2041
- package/lib/client.js.map +1 -1
- package/lib/index.js +715 -124
- 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 +1 -3
- package/lib/types/client/MnemonSettingsCard.d.ts.map +1 -1
- package/lib/types/client/MnemonSettingsCard.js +13 -31
- 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 +17 -0
- package/lib/types/client/MnemonView.d.ts.map +1 -1
- package/lib/types/client/MnemonView.js +431 -96
- 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 +7 -1
- package/lib/types/client/api.d.ts.map +1 -1
- package/lib/types/client/api.js +41 -24
- package/lib/types/client/api.js.map +1 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js +63 -53
- package/lib/types/client/index.js.map +1 -1
- package/lib/types/client/locales.d.ts +158 -306
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/locales.js +180 -328
- 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 +6 -0
- package/lib/types/client/sidebar-entry.d.ts.map +1 -0
- package/lib/types/client/sidebar-entry.js +134 -0
- package/lib/types/client/sidebar-entry.js.map +1 -0
- package/lib/types/client/workspace-controller.d.ts +15 -0
- package/lib/types/client/workspace-controller.d.ts.map +1 -0
- package/lib/types/client/workspace-controller.js +21 -0
- package/lib/types/client/workspace-controller.js.map +1 -0
- package/lib/types/client/workspace-mount.d.ts +8 -0
- package/lib/types/client/workspace-mount.d.ts.map +1 -0
- package/lib/types/client/workspace-mount.js +138 -0
- package/lib/types/client/workspace-mount.js.map +1 -0
- package/lib/types/commands.d.ts +10 -2
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +5 -1
- package/lib/types/commands.js.map +1 -1
- package/lib/types/config.d.ts +6 -5
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/config.js +12 -12
- package/lib/types/config.js.map +1 -1
- package/lib/types/contracts.d.ts +11 -0
- package/lib/types/contracts.d.ts.map +1 -1
- package/lib/types/documents.d.ts.map +1 -1
- package/lib/types/documents.js +6 -14
- package/lib/types/documents.js.map +1 -1
- package/lib/types/guidance.d.ts +3 -1
- package/lib/types/guidance.d.ts.map +1 -1
- package/lib/types/guidance.js +12 -0
- package/lib/types/guidance.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 +9 -8
- package/lib/types/index.js.map +1 -1
- package/lib/types/lifecycle.d.ts +9 -2
- package/lib/types/lifecycle.d.ts.map +1 -1
- package/lib/types/lifecycle.js +11 -4
- package/lib/types/lifecycle.js.map +1 -1
- package/lib/types/live-runtime.d.ts +26 -2
- package/lib/types/live-runtime.d.ts.map +1 -1
- package/lib/types/live-runtime.js +73 -3
- package/lib/types/live-runtime.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 +7 -6
- package/lib/types/rpc.d.ts.map +1 -1
- package/lib/types/rpc.js +139 -22
- package/lib/types/rpc.js.map +1 -1
- package/lib/types/runner.d.ts +1 -1
- package/lib/types/runner.d.ts.map +1 -1
- package/lib/types/runner.js +2 -2
- package/lib/types/runner.js.map +1 -1
- package/lib/types/service.d.ts +18 -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 +2 -3
- package/lib/types/settings.js.map +1 -1
- package/lib/types/subagent.d.ts +11 -2
- package/lib/types/subagent.d.ts.map +1 -1
- package/lib/types/subagent.js +34 -29
- package/lib/types/subagent.js.map +1 -1
- package/lib/types/tools.d.ts +11 -1
- package/lib/types/tools.d.ts.map +1 -1
- package/lib/types/tools.js +27 -16
- package/lib/types/tools.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
|
@@ -1,247 +1,133 @@
|
|
|
1
1
|
# Project Overview: Local Three-Tier Memory for DSH
|
|
2
2
|
|
|
3
|
-
[简体中文](../zh-CN/project-overview.md) | **English** | [Documentation
|
|
3
|
+
[简体中文](../zh-CN/project-overview.md) | **English** | [Documentation hub](./README.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`dsh-mnemon` integrates [Mnemon](https://github.com/mnemon-dev/mnemon) Memory Spaces with DeepSeek Harness, then adds Runtime hot memory, Project Documents, lifecycle routing, bounded subagents, a deterministic control layer, and native DSH interfaces.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Its goal is not to store more text. It balances long-term continuity, current-fact priority, context cost, and recoverable writes.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
[](../assets/screenshots/overview-memory-graph.png)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Why three tiers
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
One memory tier cannot serve frequent injection, full-document reading, and cross-session recall equally well:
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
With only the current conversation, an Agent cannot reliably carry forward user preferences, project conventions, and historical decisions. Injecting the entire history into every prompt causes context growth, stale-information interference, and additional cost. One memory tier also cannot satisfy all of these needs well:
|
|
18
|
-
|
|
19
|
-
| Need | Limit of one memory tier | dsh-mnemon approach |
|
|
15
|
+
| Need | With one memory tier | dsh-mnemon's choice |
|
|
20
16
|
|---|---|---|
|
|
21
|
-
|
|
|
22
|
-
| Read a complete design, investigation, or procedure
|
|
23
|
-
| Find cross-session facts, decisions, and
|
|
24
|
-
|
|
|
25
|
-
| Let a model judge value without
|
|
26
|
-
|
|
27
|
-
Whichever tier produces a hit, current user instructions, live tool results, and repository facts always take precedence over historical memory. The plugin supplies reviewable evidence and continuity; it does not let old content override current facts.
|
|
28
|
-
|
|
29
|
-
To satisfy immediate visibility, complete reading, and durable recall together, the plugin establishes a layered, supervised memory architecture between DSH and local persistence.
|
|
30
|
-
|
|
31
|
-
## Architecture at a Glance
|
|
32
|
-
|
|
33
|
-
DSH provides the root Agent and extension surfaces, `dsh-mnemon` owns three-tier control, routing, and safety boundaries, and [Mnemon](https://github.com/mnemon-dev/mnemon) supplies the Memory Space capabilities for the durable tier. The plugin manages Runtime projections and Document originals; durable Memory Spaces and archive references are stored and retrieved through Mnemon.
|
|
17
|
+
| Know stable preferences and rules on the next turn | Retrieval adds latency and may miss | Inject compact Runtime projections every turn |
|
|
18
|
+
| Read a complete design, investigation, or procedure | Fragmentation loses narrative and provenance | Keep managed Markdown Documents |
|
|
19
|
+
| Find cross-session facts, decisions, and relations | Full loading pollutes context | Recall bounded graph-enhanced evidence on demand |
|
|
20
|
+
| Preserve traceability for cold long-form material | Keeping it hot consumes capacity forever | Create a cold reference before moving the original |
|
|
21
|
+
| Let a model judge value without owning system safety | An LLM cannot guarantee paths, locks, or transactions | Workers own semantics; the Host owns hard boundaries |
|
|
34
22
|
|
|
35
|
-
|
|
23
|
+
Priority always remains: **current user instructions → live tools and repository facts → historical memory**.
|
|
36
24
|
|
|
37
|
-
The
|
|
25
|
+
## The three-tier model
|
|
38
26
|
|
|
39
|
-
1.
|
|
40
|
-
2. **Supervision boundary**: lifecycle hooks provide only short cues; durable recall, semantic writes, and maintenance run in bounded subagents.
|
|
41
|
-
3. **Deterministic control boundary**: the Host validates inputs, paths, permissions, revisions, UTF-8 capacity, locks, timeouts, and process arguments.
|
|
42
|
-
4. **Local data boundary**: Runtime, Documents, and Memory Spaces share the selected `storageRoot`; memory persistence does not depend on a remote memory service.
|
|
27
|
+
### 1. Runtime Memory
|
|
43
28
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Architecture boundaries determine who may execute an operation, the built-in prompt determines when the LLM should use a capability proactively, and the three-tier model determines the granularity of retained information and when it reaches context.
|
|
47
|
-
|
|
48
|
-
## Built-in Prompt and Proactive Memory
|
|
49
|
-
|
|
50
|
-
Through the system prompt, dynamically injected `USER.md` / `MEMORY.md`, lifecycle cues, and tool descriptions, the plugin presents every read and write capability across Runtime Memory, Documents, Memory Spaces, relationships, and directory maintenance. This encourages the LLM to invoke the relevant capability whenever the current task may benefit instead of waiting for the user to name individual tools.
|
|
51
|
-
|
|
52
|
-
“Proactive” does not mean unconditional reads and writes on every turn. The current task remains authoritative, work continues without a memory call when none is useful, and a write is complete only with a valid tool receipt. When the user states an explicit intent, the LLM selects a path by information granularity and goal:
|
|
53
|
-
|
|
54
|
-
| User intent or task signal | Preferred capability |
|
|
55
|
-
|---|---|
|
|
56
|
-
| Revisit earlier work, find historical evidence, or recover an exact old detail | Search active Documents first, then use `mnemon_recall` / `mnemon_related` when needed |
|
|
57
|
-
| Remember a preference or stable convention, or correct old information | `mnemon_runtime_memory` with `add` / `replace` / `remove` |
|
|
58
|
-
| Preserve a complete design, investigation, procedure, or handoff | Search Documents, then create or update a managed Document; archive when needed |
|
|
59
|
-
| Retain durable facts or decisions, create relations, forget content, or adjust a Memory Space | Let a bounded worker deduplicate and route before using Memory Space write or maintenance capabilities |
|
|
29
|
+
Runtime retains compact, high-frequency information useful on many turns:
|
|
60
30
|
|
|
61
|
-
|
|
31
|
+
- `USER.md`: identity, roles, preferences, habits, and explicit collaboration requirements;
|
|
32
|
+
- `MEMORY.md`: project conventions, environment facts, decisions, tool behavior, and reusable lessons.
|
|
62
33
|
|
|
63
|
-
|
|
34
|
+
`runtime/memories.json` is the source of truth; both Markdown files are deterministic projections. USER is capped at 4 KiB and MEMORY at 10 KiB, measured in UTF-8 bytes. Regular mutations are deterministic; only capacity maintenance may start a worker.
|
|
64
35
|
|
|
65
|
-
###
|
|
36
|
+
### 2. Project Documents
|
|
66
37
|
|
|
67
|
-
|
|
38
|
+
Documents preserve complete designs, investigations, procedures, postmortems, and handoffs. Title, retrieval description, and body participate in deterministic search; the body keeps Markdown structure.
|
|
68
39
|
|
|
69
|
-
|
|
70
|
-
- `target=memory`: project conventions, environment facts, decisions, tool behavior, and reusable lessons.
|
|
40
|
+
One body may be up to 2 MiB and active rendered content up to 10 MiB. Before manual or capacity archiving, a bounded worker writes a Mnemon cold reference containing a summary and SHA-256. The original moves only if its revision is unchanged. Failure or conflict preserves active content.
|
|
71
41
|
|
|
72
|
-
|
|
42
|
+
### 3. Memory Spaces
|
|
73
43
|
|
|
74
|
-
|
|
44
|
+
Each Memory Space maps to an independent Mnemon Store and `mnemon.db`, with a stable ID, name, routing description, and activation state.
|
|
75
45
|
|
|
76
|
-
|
|
46
|
+
- Reads cover active spaces only.
|
|
47
|
+
- Writes may target any registered space and activate it after success.
|
|
48
|
+
- Durable memory preserves temporal, semantic, causal, and entity relations.
|
|
49
|
+
- Recall retains Memory Space provenance and memory IDs for related traversal.
|
|
77
50
|
|
|
78
|
-
|
|
51
|
+
See [Storage and the three-tier model](./storage-model.md) for authoritative files, capacities, and directories.
|
|
79
52
|
|
|
80
|
-
|
|
53
|
+
## Architecture
|
|
81
54
|
|
|
82
|
-
|
|
55
|
+
[](../assets/diagrams/en/project-architecture.svg)
|
|
83
56
|
|
|
84
|
-
|
|
57
|
+
Four boundaries shape the system:
|
|
85
58
|
|
|
86
|
-
|
|
59
|
+
1. **Interaction**: conversation, Sidebar / Buildin workbench, `/mnemon` commands, and model tools.
|
|
60
|
+
2. **Supervision**: durable recall, semantic writes, and archiving run in bounded workers; lifecycle hooks provide short cues and scheduling signals.
|
|
61
|
+
3. **Deterministic control**: the Host enforces schema, paths, permissions, capacity, locks, revisions, CLI arguments, timeouts, and cancellation.
|
|
62
|
+
4. **Local data**: Runtime, Documents, and Memory Spaces share the effective `storageRoot` and require no remote memory service.
|
|
87
63
|
|
|
88
|
-
|
|
64
|
+
### Memory System flow
|
|
89
65
|
|
|
90
|
-
|
|
66
|
+
This diagram describes stable execution boundaries, not a live status dashboard. Solid lines are deterministic Host paths; dashed lines require supervised LLM judgment.
|
|
91
67
|
|
|
92
|
-
|
|
68
|
+
[](../assets/diagrams/en/memory-system-flow.png)
|
|
93
69
|
|
|
94
|
-
|
|
70
|
+
The three major flows are:
|
|
95
71
|
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
- When creating a space, the model proposes the semantic name and boundary while the Host generates its stable ID.
|
|
100
|
-
- Merge uses non-destructive import; source databases remain and are inactive by default afterward.
|
|
72
|
+
- **Per-turn context**: Runtime projections enter the prompt; the Root Agent searches active Documents deterministically when needed.
|
|
73
|
+
- **On-demand semantics**: the Root Agent dispatches a `spawn` worker through the Host Bridge to active Memory Spaces; only bounded evidence or receipts return.
|
|
74
|
+
- **Maintenance and archive**: the Host applies ordinary mutations atomically; idle review uses `fork` from a completed checkpoint; Document archive verifies a cold index before moving the original across a revision fence.
|
|
101
75
|
|
|
102
|
-
|
|
76
|
+
See [Lifecycle and workflows](./workflows.md) for thresholds, cancellation, and failure semantics.
|
|
103
77
|
|
|
104
|
-
|
|
78
|
+
## Read path: near to far
|
|
105
79
|
|
|
106
|
-
|
|
80
|
+
A history-dependent request expands in this order:
|
|
107
81
|
|
|
108
|
-
|
|
82
|
+
1. current request, live tool results, and repository files;
|
|
83
|
+
2. Runtime Memory already in the prompt;
|
|
84
|
+
3. deterministic search and on-demand full text from active Documents;
|
|
85
|
+
4. supervised recall from active Memory Spaces;
|
|
86
|
+
5. archived originals only after following a cold-reference hit.
|
|
109
87
|
|
|
110
|
-
|
|
88
|
+
`mnemon_recall` starts an isolated worker. It selects the narrowest spaces from names and descriptions and can use only allowed recall/related tools. The complete catalog and routing trace do not fill the root conversation.
|
|
111
89
|
|
|
112
|
-
|
|
90
|
+
Direct recall in the Web returns raw evidence. Agent query retrieves the same evidence, then gives it to an evidence-only worker with no Mnemon tools.
|
|
113
91
|
|
|
114
|
-
|
|
115
|
-
2. The root Agent can already see Runtime Memory injected for the turn.
|
|
116
|
-
3. Search active Documents deterministically when complete project knowledge is needed.
|
|
117
|
-
4. Use supervised recall for historical decisions, cross-session facts, or relationships.
|
|
118
|
-
5. Follow a cold reference to an archived Document only when the complete original is required.
|
|
92
|
+
## Write path: semantics versus guarantees
|
|
119
93
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Direct Web search uses the deterministic service. “Agent search” performs the same retrieval first, then starts a no-Mnemon-tool evidence-only worker that can answer solely from the supplied hits and return only valid citations.
|
|
123
|
-
|
|
124
|
-
[](../zh-CN/assets/screenshots/recall-agent-answer.png)
|
|
125
|
-
|
|
126
|
-
*Agent search restricts evidence to the current hits while retaining source memory IDs and raw recall entries so the answer remains reviewable.*
|
|
127
|
-
|
|
128
|
-
In a real conversation, the root Agent can inspect the Memory Space catalog and project Documents before recalling from active spaces. If the current task genuinely needs an inactive space, a controlled workflow can activate it temporarily and restore its prior state after reading. The tool trace keeps lookup order, space selection, and provenance observable.
|
|
129
|
-
|
|
130
|
-
[](../zh-CN/assets/screenshots/conversation-recall.png)
|
|
131
|
-
|
|
132
|
-
### Write: Separate Semantic Judgment from System Guarantees
|
|
133
|
-
|
|
134
|
-
The read path determines when memory is useful. The write path must also define who judges value, who persists data, and how original data is protected when an operation fails.
|
|
135
|
-
|
|
136
|
-
The plugin separates semantic judgment from system guarantees:
|
|
137
|
-
|
|
138
|
-
| LLM / worker responsibility | Hard Host guarantee |
|
|
94
|
+
| Memory worker | Host guarantees |
|
|
139
95
|
|---|---|
|
|
140
|
-
| Decide whether
|
|
141
|
-
| Select the narrowest
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
| Perform conservative maintenance within its persona | UTF-8 capacity accounting and preservation on failure |
|
|
146
|
-
|
|
147
|
-
Durable recall, semantic writes, and capacity maintenance use isolated `spawn` workers. Background review uses a checkpoint-inheriting `fork` worker only after a completed turn crosses the activity-score gate and the root Agent remains idle. A new turn cancels pending or active review. Worker context, tools, and output remain bounded while the Host retains deterministic validation; see the workflow guide for complete provider requirements and review boundaries.
|
|
148
|
-
|
|
149
|
-
See [Lifecycle and Core Workflows](./workflows.md) for recall, writes, capacity maintenance, archiving, and the scoring formula.
|
|
150
|
-
|
|
151
|
-
When the user explicitly asks to retain stable information, the root Agent selects structured tools by content type and writes individual items while the Host continues to validate the target, capacity, and revision. The final response reports what was actually stored instead of treating internal reasoning as persistence.
|
|
152
|
-
|
|
153
|
-
[](../zh-CN/assets/screenshots/conversation-writeback.png)
|
|
154
|
-
|
|
155
|
-
### Three-Tier Example: Retaining an Architecture Decision
|
|
156
|
-
|
|
157
|
-
Suppose a substantial task establishes that “every external CLI must be launched with an argument array and without a shell,” and also produces a complete threat analysis and migration guide:
|
|
158
|
-
|
|
159
|
-
1. The frequently used operating rule can enter `MEMORY.md` as a compact fact and become visible from the next turn.
|
|
160
|
-
2. The complete analysis and migration procedure belong in an active Document, preserving headings, code excerpts, and source files.
|
|
161
|
-
3. If the decision should remain recallable across projects, a bounded worker selects a suitable Memory Space, checks for duplicates, writes a self-contained decision, and may link it to related security principles.
|
|
162
|
-
4. When someone later asks why shell command concatenation is forbidden, the Agent sees the hot rule first, searches the Document for rationale, and recalls Mnemon evidence only when cross-session relationships matter.
|
|
163
|
-
5. If the Document becomes infrequently used and active capacity is needed, the plugin writes a cold reference with its summary and hash before moving the original. The full analysis remains traceable through that reference.
|
|
164
|
-
|
|
165
|
-
The same knowledge can therefore retain complementary expressions at different frequencies and narrative granularity, without copying the entire Document into every prompt or stretching one short rule into a long record.
|
|
166
|
-
|
|
167
|
-
These workflows can be initiated proactively through Agent tools and can also be inspected, verified, and maintained in DSH's Memory workspace.
|
|
168
|
-
|
|
169
|
-
## User and Integration Surfaces
|
|
170
|
-
|
|
171
|
-
### Web Workspace
|
|
172
|
-
|
|
173
|
-
The conversation's “Memory System” tab contains eight 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:
|
|
174
|
-
|
|
175
|
-
| Page | Primary purpose |
|
|
176
|
-
|---|---|
|
|
177
|
-
| Status | CLI, runtime hot memory, storage scope, lifecycle, and subagent diagnostics |
|
|
178
|
-
| Runtime | USER / MEMORY hot context, capacity, and deterministic maintenance |
|
|
179
|
-
| Memory Spaces | Memory Space catalog, activation controls, metadata editing, and a live multi-space graph |
|
|
180
|
-
| Documents | Search, read, edit, and archive managed Documents |
|
|
181
|
-
| Distill | Give a candidate to a bounded worker for deduplication, routing, and writing |
|
|
182
|
-
| Recall | Direct recall, related traversal, and evidence-only Agent search |
|
|
183
|
-
| Entities | Frequent entities and their cross-graph context |
|
|
184
|
-
| Content | Browse, copy, clone, or soft-delete durable memories |
|
|
185
|
-
|
|
186
|
-
The primary Web workspace and settings card support Chinese and English and follow DSH's global light/dark theme. Commands, tool cards, and some backend diagnostics are not yet fully internationalized.
|
|
187
|
-
|
|
188
|
-
[](../zh-CN/assets/screenshots/entities-context.png)
|
|
189
|
-
|
|
190
|
-
*The Entities page ranks names by hit count and retains related memories, category, importance, score, and Memory Space provenance on the right.*
|
|
191
|
-
|
|
192
|
-
[](../zh-CN/assets/screenshots/memory-content.png)
|
|
193
|
-
|
|
194
|
-
*The Content page supports filtering and inspection, then exposes relationship lookup, create-from-current, ID copy, and soft-delete actions.*
|
|
195
|
-
|
|
196
|
-
### Model Tools and Commands
|
|
197
|
-
|
|
198
|
-
The plugin registers read and write groups of `mnemon_*` model tools and provides:
|
|
199
|
-
|
|
200
|
-
```text
|
|
201
|
-
/mnemon status
|
|
202
|
-
/mnemon recall <query>
|
|
203
|
-
/mnemon related <full memory ID>
|
|
204
|
-
/mnemon remember <stable, self-contained durable insight>
|
|
205
|
-
/mnemon forget <full memory ID>
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
Web RPC is an internal bridge between the DSH Host and the plugin client: reads require `trusted-host`, while memory writes and settings require `loopback`. These channels are not a stable external HTTP SDK. See [WebUI, Tools, Commands, and RPC](./interfaces.md) for the complete interface matrix.
|
|
209
|
-
|
|
210
|
-
## Local-First Reliability Design
|
|
96
|
+
| Decide whether a candidate is durable | Input schema and operation permissions |
|
|
97
|
+
| Select the narrowest space and deduplicate | Workspace and path confinement |
|
|
98
|
+
| Distill self-contained content and relation rationale | Shell-free CLI, bounded output, timeout, and cancellation |
|
|
99
|
+
| Decide when long-form work belongs in Documents | Locks, temporary files, rename, and revision fences |
|
|
100
|
+
| Maintain conservatively within its persona | UTF-8 capacity and original-data preservation on failure |
|
|
211
101
|
|
|
212
|
-
|
|
102
|
+
Durable recall and writes prefer isolated `spawn`. Score-based background review uses `fork` only after a completed turn crosses its threshold and remains idle. A new turn cancels pending or running review.
|
|
213
103
|
|
|
214
|
-
|
|
215
|
-
- **No-shell execution**: the Mnemon CLI uses `spawn(command, args, { shell: false })`.
|
|
216
|
-
- **Bounded processes**: each call has a timeout, cancellation, and a 2 MiB combined stdout + stderr limit.
|
|
217
|
-
- **Concurrency control**: Runtime and Documents use in-process queues and cross-instance lock files; CLI calls are serialized within one Runner.
|
|
218
|
-
- **Original-first protection**: revision conflicts, worker failures, and invalid receipts never use stale results to overwrite current hot memory or move an active Document.
|
|
219
|
-
- **Recoverable projections**: a valid `memories.json` can rebuild `USER.md` and `MEMORY.md`.
|
|
220
|
-
- **Least-privilege workers**: every worker has a fixed persona, tool allowlist, structured output, and `maxDepth: 1`.
|
|
104
|
+
## What users see
|
|
221
105
|
|
|
222
|
-
|
|
106
|
+
The default Sidebar has four primary pages: Status, Runtime, Memory Spaces, and Documents. Memory Spaces adds Overview, Recall, Content, and Entities. Add, edit, and Remember use consistent dialogs; long collections use filters and progressive loading.
|
|
223
107
|
|
|
224
|
-
|
|
108
|
+
Two additive entries surface memory in conversations:
|
|
225
109
|
|
|
226
|
-
|
|
110
|
+
- **Turn memory** summarizes this turn's memory tools and links to matching pages.
|
|
111
|
+
- **Save to memory** loads a finalized reply into an editable confirmation; supervised writing starts only after confirmation.
|
|
227
112
|
|
|
228
|
-
|
|
113
|
+
See the [Sidebar and conversation UI guide](./ui-guide.md) for screenshots and workspace inspection/execution semantics. See [Interfaces](./interfaces.md) for tools, commands, and RPC.
|
|
229
114
|
|
|
230
|
-
|
|
231
|
-
- a large project needs design rationale, investigation records, and handoff knowledge;
|
|
232
|
-
- several knowledge domains need isolated storage, selective activation, and cross-space recall;
|
|
233
|
-
- data should remain local while an LLM handles semantic judgment;
|
|
234
|
-
- users need a visible, editable, diagnosable memory experience native to DSH.
|
|
115
|
+
## Local-first reliability
|
|
235
116
|
|
|
236
|
-
|
|
117
|
+
- CLI calls use argument arrays with `shell=false`, bounded output, timeout, and cancellation.
|
|
118
|
+
- Runtime and Documents use in-process queues, cross-instance locks, temporary files, and rename.
|
|
119
|
+
- Runtime revisions block stale compaction; Document revisions block movement of updated originals.
|
|
120
|
+
- Subagents use persona, tool allowlists, structured output, and depth limits.
|
|
121
|
+
- The WebUI never reads SQLite directly or supplies arbitrary update commands.
|
|
122
|
+
- The plugin stores no model credentials, but it does not yet include a deterministic secret scanner.
|
|
237
123
|
|
|
238
|
-
|
|
124
|
+
These guarantees are not a rollback-capable distributed transaction across Mnemon SQLite and the filesystem. When uncertain, the system preserves original data. See [Operations](./operations.md) for complete boundaries and limitations.
|
|
239
125
|
|
|
240
|
-
## Continue
|
|
126
|
+
## Continue reading
|
|
241
127
|
|
|
242
|
-
-
|
|
243
|
-
-
|
|
244
|
-
-
|
|
245
|
-
-
|
|
246
|
-
-
|
|
247
|
-
-
|
|
128
|
+
- [Getting Started](./getting-started.md): installation and first verification.
|
|
129
|
+
- [Sidebar and conversation UI guide](./ui-guide.md): complete visual workflow.
|
|
130
|
+
- [Architecture](./architecture.md): modules, workers, and trust boundaries.
|
|
131
|
+
- [Storage model](./storage-model.md): directories, capacity, and authority.
|
|
132
|
+
- [Lifecycle and workflows](./workflows.md): injection, recall, writing, review, and archive.
|
|
133
|
+
- [Configuration](./configuration.md): display, storage, and advanced switches.
|
package/docs/en/roadmap.md
CHANGED
|
@@ -11,7 +11,6 @@ The Roadmap records work beyond the current implementation; it is not a commitme
|
|
|
11
11
|
- [ ] **Backoff, circuit breaking, and manual retry**: apply bounded backoff after consecutive failures, show the reason on the Status page, and allow explicit recovery.
|
|
12
12
|
- [ ] **Deterministic sensitive-data defenses**: add secret/credential pattern detection, size limits, and audit receipts beyond LLM admission.
|
|
13
13
|
- [ ] **Automated real-WebUI E2E**: isolate DSH_HOME, storageRoot, workspace, and the port; cover light tasks, score-based review, cancellation, and failures without partial writes.
|
|
14
|
-
- [ ] **Correct `tabEnabled` semantics**: have the Host and client use the same switch so the complete Tab capability is actually registered or removed.
|
|
15
14
|
- [ ] **Correct cold-reference paths**: under every storage scope, write resolvable references that match the actual managed path.
|
|
16
15
|
|
|
17
16
|
## P1: Long-Term Maintenance and Data Operations
|
|
@@ -27,6 +26,7 @@ The Roadmap records work beyond the current implementation; it is not a commitme
|
|
|
27
26
|
## P2: Observability, Experience, and Release Engineering
|
|
28
27
|
|
|
29
28
|
- [ ] **Background-review history**: show recent scores, checkpoints, waiting/running/failed states, worker receipts, and resulting changes.
|
|
29
|
+
- [ ] **Switch to DSH's shared directory picker** (blocked on [dsh-external/issues#603](https://github.com/dsh-external/issues/issues/603)): custom storage temporarily uses a manually entered Host path because remote `browse` deployments cannot invoke the `native` picker; once DSH exposes a reusable directory-picker service for plugins, move to the provider-selected native / browse flow and retain manual entry only as a fallback if needed.
|
|
30
30
|
- [ ] **Complete internationalization**: cover commands, tool cards, Host errors, compatibility default metadata, and confirmation copy.
|
|
31
31
|
- [ ] **Multi-Memory-Space E2E**: cover automatic space creation, cross-space recall, one-pass migration routing, multiple relationship types, merge, and controlled forget.
|
|
32
32
|
- [ ] **Capacity and fault injection**: exercise real USER/MEMORY boundaries, Document LRU, revision conflicts, CLI timeouts, and mid-operation Host restarts.
|
package/docs/en/storage-model.md
CHANGED
|
@@ -50,7 +50,7 @@ follow an exact cold reference when full text is required
|
|
|
50
50
|
+-- state/ # reserved; no persistent reviewer yet
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
`storageScope` determines the entire root, not just the Mnemon databases. `state/` is currently recognized only by the status inspector; scored review watermarks remain in the running Host's memory.
|
|
53
|
+
`storageScope` determines the entire root, not just the Mnemon databases. The `workspace` scope resolves an independent `<workspace>/.mnemon` for every registered DSH workspace. The Web inspection target and current-session execution target are independent; only the latter drives agents, tools, and lifecycle hooks. `state/` is currently recognized only by the status inspector; scored review watermarks remain in the running Host's memory.
|
|
54
54
|
|
|
55
55
|
## Runtime Memory
|
|
56
56
|
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Sidebar and Conversation UI Guide
|
|
2
|
+
|
|
3
|
+
[简体中文](../zh-CN/ui-guide.md) | **English** | [Documentation hub](./README.md)
|
|
4
|
+
|
|
5
|
+
This guide follows the default `sidebar` presentation and a real user path through Memory System. Screenshots come from the v0.1.3 interface and use the Chinese locale; names, counts, and content vary with your data.
|
|
6
|
+
|
|
7
|
+
## Start with the two display modes
|
|
8
|
+
|
|
9
|
+
Choose the entry point and storage location under **Settings → Memory System**:
|
|
10
|
+
|
|
11
|
+
[](../assets/screenshots/settings-memory-system.png)
|
|
12
|
+
|
|
13
|
+
| Mode | Best suited for |
|
|
14
|
+
|---|---|
|
|
15
|
+
| **Sidebar** (default) | A dedicated workbench opened from the DSH sidebar, visually aligned with official panels such as Task Board and SSH |
|
|
16
|
+
| **Buildin** | The original conversation-area tab, preserving the previous layout and visuals for established workflows |
|
|
17
|
+
|
|
18
|
+
Both modes share functionality, data, and Host services. Only entry and appearance differ. Saving switches live without a browser refresh or duplicate mounts.
|
|
19
|
+
|
|
20
|
+
## Workbench anatomy
|
|
21
|
+
|
|
22
|
+
The Sidebar header always answers three questions: which system is open, which storage-location mode is effective, and whether the Host is connected.
|
|
23
|
+
|
|
24
|
+
The body has four primary tabs: **Status, Runtime, Memory Spaces, and Documents**. Memory Spaces adds **Overview, Recall, Content, and Entities** as secondary tabs, with **Remember** as its primary action.
|
|
25
|
+
|
|
26
|
+
## 1. Status: establish that the system is ready
|
|
27
|
+
|
|
28
|
+
[](../assets/screenshots/status-overview.png)
|
|
29
|
+
|
|
30
|
+
Status aggregates:
|
|
31
|
+
|
|
32
|
+
- installed Mnemon CLI and dsh-mnemon versions;
|
|
33
|
+
- USER / MEMORY Runtime counts;
|
|
34
|
+
- active Memory Spaces and durable-memory counts;
|
|
35
|
+
- active / archived Document counts;
|
|
36
|
+
- the current storage root and concrete Runtime, Documents, and Memory Spaces directories.
|
|
37
|
+
|
|
38
|
+
If this page reports a failure, avoid Remember or Archive until you follow [Troubleshooting](./operations.md#troubleshooting).
|
|
39
|
+
|
|
40
|
+
### Check and update versions
|
|
41
|
+
|
|
42
|
+
Open the version area for a read-only check:
|
|
43
|
+
|
|
44
|
+
[](../assets/screenshots/version-check.png)
|
|
45
|
+
|
|
46
|
+
Checking never installs automatically. Update appears only when a newer release exists and the installation source is supported. After an update, the interface rechecks both components and refreshes Status automatically. Restart `dsh web` after a dsh-mnemon update to load new plugin code.
|
|
47
|
+
|
|
48
|
+
## 2. Runtime: maintain hot memory used every turn
|
|
49
|
+
|
|
50
|
+
[](../assets/screenshots/runtime-memory.png)
|
|
51
|
+
|
|
52
|
+
The top summarizes User Profile (`USER.md`) and Working Memory (`MEMORY.md`); one list below holds both.
|
|
53
|
+
|
|
54
|
+
- Filter by All / User Profile / Working Memory.
|
|
55
|
+
- Filter by content with the input on the right.
|
|
56
|
+
- Chips identify source and importance.
|
|
57
|
+
- Edit opens a dialog; Remove enters a destructive flow.
|
|
58
|
+
- Long lists expand progressively through “Show N more.”
|
|
59
|
+
|
|
60
|
+
### Add Runtime Memory
|
|
61
|
+
|
|
62
|
+
[](../assets/screenshots/runtime-memory-add.png)
|
|
63
|
+
|
|
64
|
+
A Runtime item should be compact, independent, and repeatedly useful. Put identity, preferences, and explicit collaboration requirements in User Profile; put project, environment, decision, and tool lessons in Working Memory. Temporary progress and raw logs do not belong here.
|
|
65
|
+
|
|
66
|
+
## 3. Memory Spaces: durable memory and relationships
|
|
67
|
+
|
|
68
|
+
### Overview
|
|
69
|
+
|
|
70
|
+
[](../assets/screenshots/overview-memory-graph.png)
|
|
71
|
+
|
|
72
|
+
Each card leads with its name and routing description, pins read activation at the top right, and keeps statistics plus Edit / Delete in the footer. Activation controls reads only. A write may target an inactive registered space and activates it after success.
|
|
73
|
+
|
|
74
|
+
The graph aggregates all active spaces. Layout, dragging, and reset affect browser presentation only and never mutate Mnemon data.
|
|
75
|
+
|
|
76
|
+
### Remember
|
|
77
|
+
|
|
78
|
+
[](../assets/screenshots/remember-dialog.png)
|
|
79
|
+
|
|
80
|
+
Normally, provide only a candidate. On confirmation, an isolated memory subagent decides whether it qualifies, chooses the narrowest space, deduplicates, distills, and writes. Expand advanced options only when a target space, category, or importance must be constrained explicitly.
|
|
81
|
+
|
|
82
|
+
### Recall
|
|
83
|
+
|
|
84
|
+
[](../assets/screenshots/recall-agent-answer.png)
|
|
85
|
+
|
|
86
|
+
- **Direct recall** returns raw evidence without an answer Agent.
|
|
87
|
+
- **Agent query** retrieves the same evidence, then gives it to an evidence-only worker with no Mnemon tools.
|
|
88
|
+
- Category and strategy narrow the search.
|
|
89
|
+
- Results retain space, category, importance, score, and ID.
|
|
90
|
+
- Related traverses the graph; Forget is a destructive semantic action.
|
|
91
|
+
|
|
92
|
+
Focused questions are more reliable than broad keywords.
|
|
93
|
+
|
|
94
|
+
### Content and Entities
|
|
95
|
+
|
|
96
|
+
| Content | Entities |
|
|
97
|
+
|---|---|
|
|
98
|
+
| [](../assets/screenshots/memory-content.png) | [](../assets/screenshots/entities-context.png) |
|
|
99
|
+
|
|
100
|
+
- **Content** browses durable memory without recall side effects and supports text/category filtering, Related, clone-from-item, Copy ID, and Forget.
|
|
101
|
+
- **Entities** starts with frequent names, then aggregates related facts, decisions, and context for a selected or entered entity.
|
|
102
|
+
|
|
103
|
+
Both expose visible / total counts and progressive loading.
|
|
104
|
+
|
|
105
|
+
## 4. Documents: preserve complete project narratives
|
|
106
|
+
|
|
107
|
+
[](../assets/screenshots/documents-markdown.png)
|
|
108
|
+
|
|
109
|
+
Documents are for designs, investigations, procedures, postmortems, and handoffs. The directory loads progressively; the reader keeps title, retrieval description, source, revision, hash, size, and full Markdown. Selecting a Document resets the reader to the top.
|
|
110
|
+
|
|
111
|
+
Before active capacity is exhausted, least-recently-used Documents are cold-indexed in Mnemon and then moved to archived storage. A failure or revision conflict preserves the active original.
|
|
112
|
+
|
|
113
|
+
### Create a Document
|
|
114
|
+
|
|
115
|
+
[](../assets/screenshots/document-create-dialog.png)
|
|
116
|
+
|
|
117
|
+
Title and retrieval description determine future discoverability; source paths preserve provenance; the body retains Markdown structure. Source project files remain read-only—the workbench creates a managed copy.
|
|
118
|
+
|
|
119
|
+
## 5. In-conversation interaction
|
|
120
|
+
|
|
121
|
+
### Turn memory
|
|
122
|
+
|
|
123
|
+
[](../assets/screenshots/conversation-turn-memory.png)
|
|
124
|
+
|
|
125
|
+
The bar appears only on completed turns with memory activity. Expanding lists exact tools; clicking one opens its matching page while retaining the conversation context.
|
|
126
|
+
|
|
127
|
+
[](../assets/screenshots/conversation-memory-jump.png)
|
|
128
|
+
|
|
129
|
+
### Save to memory
|
|
130
|
+
|
|
131
|
+
[](../assets/screenshots/conversation-save-dialog.png)
|
|
132
|
+
|
|
133
|
+
Save to memory sits in the native action strip for finalized assistant replies. Clicking only opens confirmation and reads that reply. Edit or cancel freely; writing starts only after **Confirm and send to memory subagent**.
|
|
134
|
+
|
|
135
|
+
## Workspace mode: separating inspection from execution
|
|
136
|
+
|
|
137
|
+
Under `storageScope=workspace`, keep two concepts separate:
|
|
138
|
+
|
|
139
|
+
| Concept | Selected by | Affects |
|
|
140
|
+
|---|---|---|
|
|
141
|
+
| **Inspected workspace** | Workbench header selector | Which `<workspace>/.mnemon` the UI displays and maintains manually |
|
|
142
|
+
| **Effective workspace** | Current conversation / Agent cwd | Which root tools, commands, lifecycle hooks, and subagents actually use |
|
|
143
|
+
|
|
144
|
+
You may inspect project B while staying in project A's conversation; the Agent still uses A. When they differ, the header explains the mismatch and offers one-click alignment. Agent-backed actions are rejected while misaligned to prevent writes to the wrong project. Switching inspection target unmounts old page state before loading the new root.
|
|
145
|
+
|
|
146
|
+
`global` and `custom` resolve to one explicit root and need no alignment layer.
|
|
147
|
+
|
|
148
|
+
## Common interaction rules
|
|
149
|
+
|
|
150
|
+
- Solid blue is the primary action; blue outline usually means Edit; red is Remove, Delete, Archive, or Forget; neutral actions are View, Copy, and Cancel.
|
|
151
|
+
- Physical destructive operations such as deleting a Memory Space require a dedicated confirmation. Forget is semantic soft deletion and should still be deliberate.
|
|
152
|
+
- Saving settings clears stale page state and reloads automatically; no browser refresh is needed.
|
|
153
|
+
- Sidebar primary headings remain stable; secondary headings within Memory Spaces scroll naturally.
|
|
154
|
+
- Buildin preserves its established layout and visuals. Functional concepts still apply, though control positions differ.
|
|
155
|
+
|
|
156
|
+
Next: [Getting Started](./getting-started.md) · [Storage model](./storage-model.md) · [Configuration](./configuration.md) · [Operations](./operations.md)
|