stratagate-dsh 0.2.92 → 0.2.94
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/CHANGELOG.md +14 -0
- package/README.md +67 -199
- package/README.zh-CN.md +68 -209
- package/dist/client.js +1 -1
- package/dist/plugin.js +38 -21
- package/dist/plugin.js.map +1 -1
- package/docs/ARCHITECTURE.md +32 -0
- package/docs/DSH.md +7 -3
- package/docs/DSH.zh-CN.md +7 -3
- package/docs/EVALUATION.md +10 -0
- package/docs/EXTERNAL_MEMORY_IMPORT.zh-CN.md +45 -0
- package/package.json +28 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.94 - Unreleased
|
|
4
|
+
|
|
5
|
+
- Simplify the DSH main-agent memory protocol by removing tool-level batch, citation, and memory-merge details while retaining the six Block layers, evidence-gated use, adopted-evidence reinforcement, and Profile consent boundaries.
|
|
6
|
+
- Clarify when to search history outside the visible conversation, Event/Graph responsibilities, automatic memory versus explicit retrieval, evidence sufficiency, and targeted follow-up retrieval without repeating failed searches.
|
|
7
|
+
- Verify the complete approved protocol in assembled system prompts, including session-scoped and activated-memory contexts. Tool descriptions, runtime behavior, and WorkBuddy remain unchanged.
|
|
8
|
+
|
|
9
|
+
## 0.2.93 - Unreleased
|
|
10
|
+
|
|
11
|
+
- Support the complete DeepSeek Harness `0.2.0` version family: all Alpha, Beta, RC, and stable releases (`>=0.2.0-0 <0.2.1-0`), without listing individual prereleases as installation requirements. Preserve the previously supported DSH versions.
|
|
12
|
+
- Keep the startup guard aligned with the installation range, retaining checks for mixed DSH runtimes and incompatible Cordis/Schemastery patch lines. Use producer-owned message sources throughout DSH `0.2.0` so native V4 Session checkpoints and steering messages remain valid.
|
|
13
|
+
- Require the three host-owned Session Format peers to match the DSH `0.2.0` core version, rejecting mixed or missing codecs before migration; retain earlier hosts' compatibility rules. Fix the installation verifier's failure-probe host flag and directly pin its app-boot development dependency.
|
|
14
|
+
- Pin development dependencies to DSH `0.2.0-rc.2`, add rc.1 and rc.2 to the Linux/Windows compatibility matrix, and update installation verification and version-boundary/V4 persistence regressions.
|
|
15
|
+
- 支持整个 DeepSeek Harness `0.2.0` 版本族,包含全部 Alpha、Beta、RC 和正式版;安装声明与启动检查统一采用 `>=0.2.0-0 <0.2.1-0`,无需为同属 `0.2.0` 的新版本逐个发布插件更新。保留旧宿主支持,修正新版消息来源格式,并更新兼容性测试。
|
|
16
|
+
|
|
3
17
|
## 0.2.92 - Unreleased
|
|
4
18
|
|
|
5
19
|
- Make Event extraction atomic, self-contained, and source-grounded, with descriptions for all eight core fields; remove Event narrative and confidence from extraction, retrieval, projection input, and UI/API output.
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
### Recent conversations stay detailed. Older memories grow more concise.
|
|
8
8
|
|
|
9
|
-
StrataGate
|
|
9
|
+
StrataGate is a cross-session memory plugin for DeepSeek Harness. Recent conversations stay detailed, older conversations become concise, and original records remain available when needed. Important decisions, preferences, and plans become long-term memories for future sessions.
|
|
10
10
|
|
|
11
11
|
[](https://github.com/diqierjia/StrataGate-AgentMemory/actions/workflows/ci.yml)
|
|
12
12
|
[](https://www.npmjs.com/package/stratagate-dsh)
|
|
@@ -19,12 +19,10 @@ StrataGate gradually condenses an AI agent's short-term memory as the conversati
|
|
|
19
19
|
|
|
20
20
|
[中文说明](README.zh-CN.md) · [DeepSeek Harness guide](docs/DSH.md) · [Architecture](docs/ARCHITECTURE.md) · [Full evaluation](docs/EVALUATION.md)
|
|
21
21
|
|
|
22
|
-
<strong>
|
|
22
|
+
<strong>Published evaluation:</strong> on 152 questions from one LoCoMo conversation, `conv-26`, each answer received 10 independent evaluations. Mean judged accuracy was <strong>80.46%</strong>, versus <strong>63.22%</strong> for Mem0 base. [See evaluation scope](#experimental-results).
|
|
23
23
|
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
|
-
> **In plain words:** StrataGate keeps recent conversations detailed and gradually condenses older ones as the conversation progresses. Important information becomes Events and a knowledge graph for future sessions. Original records remain available to expand and verify when needed.
|
|
27
|
-
|
|
28
26
|
## Why StrataGate?
|
|
29
27
|
|
|
30
28
|
1. **Short-term memory: details fade as the conversation progresses and expand when needed.**
|
|
@@ -55,13 +53,6 @@ StrataGate gradually condenses an AI agent's short-term memory as the conversati
|
|
|
55
53
|
|
|
56
54
|
Get started: → [Quick start](#quick-start-deepseek-harness)
|
|
57
55
|
|
|
58
|
-
## Choose your path
|
|
59
|
-
|
|
60
|
-
| Path | Best for | Start here |
|
|
61
|
-
| --- | --- | --- |
|
|
62
|
-
| **DeepSeek Harness plugin** | Users who want automatic, local-first memory with a visual Memory UI | [Install `stratagate-dsh`](#quick-start-deepseek-harness) |
|
|
63
|
-
| **Core TypeScript library** | Developers building a custom agent or memory integration | [Library entry points](#code-entry-points) |
|
|
64
|
-
|
|
65
56
|
<a id="quick-start-deepseek-harness"></a>
|
|
66
57
|
|
|
67
58
|
## Quick start: DeepSeek Harness
|
|
@@ -72,6 +63,8 @@ If DeepSeek Harness is already installed, add StrataGate to the profile you use:
|
|
|
72
63
|
dsh plugin --profile web add stratagate-dsh
|
|
73
64
|
```
|
|
74
65
|
|
|
66
|
+
DSH compatibility includes the complete `0.2.0` version family: all Alpha, Beta, RC, and stable releases (`>=0.2.0-0 <0.2.1-0`), alongside the previously supported hosts. A new `0.2.0` prerelease does not require a plugin update just to declare its version.
|
|
67
|
+
|
|
75
68
|
Restart that profile, then keep using DSH normally. StrataGate will capture completed main-agent turns, build searchable memory in the background, and expose its Memory UI under **DSH Settings → StrataGate-AgentMemory**.
|
|
76
69
|
|
|
77
70
|
By default, the database is stored at:
|
|
@@ -82,20 +75,7 @@ DSH_HOME/stratagate/memory.db
|
|
|
82
75
|
|
|
83
76
|
Removing the plugin does not delete the database. For screenshots, configuration, memory tools, and the exact automatic-capture rules, see the [DeepSeek Harness plugin guide](docs/DSH.md).
|
|
84
77
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
As conversations accumulate, an AI agent has to fit the current task, earlier discussions, and lasting information into a limited context window.
|
|
88
|
-
|
|
89
|
-
Recent discussions often need their full detail. Older conversations can remain as concise summaries and expand when needed. Meanwhile, user preferences, project decisions, and task plans change, making it necessary to distinguish historical records from current state. StrataGate addresses these needs by managing short-term views, long-term updates, retrieval assessment, and usage feedback separately.
|
|
90
|
-
|
|
91
|
-
| Common problem | How StrataGate handles it |
|
|
92
|
-
| --- | --- |
|
|
93
|
-
| Conversations keep growing, and historical details continue to occupy context | Store each conversation block as L0–L5 views; as more conversation accumulates, older content defaults to a more concise view and expands when needed |
|
|
94
|
-
| Important information is scattered across conversations, and old decisions can be confused with current state | Extract Events with sources and timestamps, preserve history in an event timeline, and organize current state in a knowledge graph |
|
|
95
|
-
| Search finds related content but misses details needed to answer | Assess the evidence through the evidence gate; search again, expand memories, or inspect the source when necessary |
|
|
96
|
-
| A memory keeps gaining weight merely because it is frequently retrieved | Separate retrieval from adoption: long-term weights decay as conversations progress, and only memories recorded as actually used receive reinforcement |
|
|
97
|
-
|
|
98
|
-
Short-term decay gradually reduces the detail that older conversations contribute to current context. Long-term memory and its weighting mechanism help the agent recall information that remains useful in future sessions. Both retain sources so condensed information can still be traced and checked.
|
|
78
|
+
The command uses the `web` profile; replace `web` if you use another profile. Developers can go directly to [Development and documentation](#code-entry-points).
|
|
99
79
|
|
|
100
80
|
<a id="how-stratagate-works"></a>
|
|
101
81
|
|
|
@@ -103,53 +83,21 @@ Short-term decay gradually reduces the detail that older conversations contribut
|
|
|
103
83
|
|
|
104
84
|

|
|
105
85
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Each completed turn and its tool records are saved first. The DeepSeek Harness plugin seals a Block every **6 turns** by default. Users can configure this size; turns below the boundary remain in the current conversation.
|
|
111
|
-
|
|
112
|
-
Each Block stores six levels of detail, L0–L5, from title indexes and short summaries to complete source records. Decay begins only after background processing finishes: as more Blocks become ready in the same conversation, older Blocks default to shallower views.
|
|
113
|
-
|
|
114
|
-
This reduces the historical detail presented in context while preserving the complete L5 source records. → [Layered memory](#layered-memory)
|
|
115
|
-
|
|
116
|
-
### 2. Turn important information into Events and update the knowledge graph
|
|
117
|
-
|
|
118
|
-
Decisions, preferences, plans, and changes worth keeping become Events. Each Event records content, time, and provenance for future conversations to retrieve.
|
|
119
|
-
|
|
120
|
-
The knowledge graph then organizes current information and relationships about entities such as people, projects, and tools. New Events can supplement or supersede an earlier state while historical Events and their sources remain available. → [Event cards](#event-cards) · [Current-state graph](#current-state-graph)
|
|
121
|
-
|
|
122
|
-
### 3. Activate relevant memories before answering and retrieve more when needed
|
|
123
|
-
|
|
124
|
-
Before each main-model call, the plugin uses the current question and recent conversation to bring in a small set of relevant long-term Events and graph information as background.
|
|
125
|
-
|
|
126
|
-
The current DSH integration includes at most **4 Events and 4 graph nodes**, subject to a total budget of approximately **900 tokens**. The active conversation's history is supplied through layered Blocks and unsealed turns.
|
|
127
|
-
|
|
128
|
-
If the available context is sufficient, the agent can answer directly. Otherwise, it uses memory tools to search Events, the graph, or source messages, expanding details as needed.
|
|
129
|
-
|
|
130
|
-
### 4. Assess whether actively retrieved evidence answers the question
|
|
131
|
-
|
|
132
|
-
After finding relevant memories, the agent determines whether they answer the actual question: which evidence supports the answer, what is missing, and whether further retrieval is needed.
|
|
86
|
+
1. **Save conversations.** Several consecutive turns form a memory Block, stored as six views ranging from an index to the original records.
|
|
87
|
+
2. **Extract lasting information.** Decisions, preferences, plans, and changes become Events with time and source references. The graph builds a current-state view from these Events.
|
|
88
|
+
3. **Recall when answering.** The plugin brings in a small set of relevant memories. When more information is needed, the agent searches Events, the graph, or source messages and assesses whether the evidence is enough.
|
|
89
|
+
4. **Record actual use.** An Event selected as evidence for the final answer counts as a recorded use, called an “adoption” internally, and updates its long-term weight.
|
|
133
90
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
The evidence gate requires an explicit assessment, while code validates evidence references and protocol constraints. If evidence remains insufficient, the agent continues searching or states that it cannot confirm the answer. → [Evidence gate](#evidence-gate)
|
|
137
|
-
|
|
138
|
-
### 5. Record adopted evidence and update long-term weights
|
|
139
|
-
|
|
140
|
-
Search hits and automatic context injection do not reinforce memories.
|
|
141
|
-
|
|
142
|
-
When the agent determines which evidence supports its final answer, it submits a usage receipt. Events recorded as actually used update their adoption counts and decay anchors. More adoptions lead to slower future decay. Unused search results receive no reinforcement from that selection. → [Use-only reinforcement](#use-only-reinforcement)
|
|
143
|
-
|
|
144
|
-
For example, a user first decides to use npm, then switches the project to pnpm. StrataGate preserves both decisions and updates the graph's current state. A later question about what the project uses can be answered from that state; questions about when or why the change happened can follow the Event back to the original conversation.
|
|
145
|
-
|
|
146
|
-
[See a retrieval example that follows an event card back to source messages](#a-real-retrieval-path).
|
|
91
|
+
Automatic recall currently includes at most 4 Events and 4 graph nodes within approximately 900 tokens. Layered Blocks and unsealed turns supply the active conversation's history separately.
|
|
147
92
|
|
|
148
93
|
## Core design
|
|
149
94
|
|
|
150
|
-
|
|
95
|
+
| Mechanism | What changes | What remains |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| Short-term simplification | Which L0–L5 view an older Block displays by default | Original L5 conversations and tool records |
|
|
98
|
+
| Long-term weight decay | An Event's priority in later recall | Event history and its sources |
|
|
151
99
|
|
|
152
|
-
|
|
100
|
+
Both follow conversation progress: short-term decay uses ready-Block distance, while long-term decay uses turn distance. Elapsed days alone do not trigger either form of decay.
|
|
153
101
|
|
|
154
102
|
<a id="layered-memory"></a>
|
|
155
103
|
|
|
@@ -174,6 +122,11 @@ Each fully processed Block contains these views:
|
|
|
174
122
|
| L4 | Near-verbatim dialogue without internal messages | Remove system messages; only trim outer whitespace and add role labels to user and assistant text; retain names and summaries for recognized tool records |
|
|
175
123
|
| L5 | Source messages and tool records | Verify provenance and specific details |
|
|
176
124
|
|
|
125
|
+
The model summarizes L0–L2. Fixed rules generate L3/L4: L3 removes standalone fillers and repeated long content, while L4 stays near-verbatim; both compact recognized tool records. Short-term decay advances with subsequent ready Blocks, not elapsed days.
|
|
126
|
+
|
|
127
|
+
<details>
|
|
128
|
+
<summary>Exact pruning rules, decay formula, and level thresholds</summary>
|
|
129
|
+
|
|
177
130
|
The model produces L0–L2 summaries. L3 and L4 do not use model paraphrasing; code generates them with these fixed rules:
|
|
178
131
|
|
|
179
132
|
- **L4:** Remove system messages. User and assistant text is preserved except for trimming outer whitespace and adding `User`, `Assistant`, or other role labels. Recognized structured tool records retain the tool name and a result summary of at most 160 characters while omitting raw `arguments`, `params`, `input`, and `request` fields. Tool-role text that is not recognized as tool JSON remains unchanged.
|
|
@@ -205,6 +158,8 @@ For a Block that starts at L5 and is never expanded again, the default schedule
|
|
|
205
158
|
|
|
206
159
|
The figure illustrates the trend. Actual changes depend on both the decay coefficient and level thresholds; a new Block does not necessarily cause a one-level drop.
|
|
207
160
|
|
|
161
|
+
</details>
|
|
162
|
+
|
|
208
163
|
**Expand again when details are needed.**
|
|
209
164
|
|
|
210
165
|
Suppose an older conversation currently shows only:
|
|
@@ -223,7 +178,7 @@ Older conversations can therefore remain lightweight during ordinary use while r
|
|
|
223
178
|
|
|
224
179
|
Short-term memory retains a discussion's context. Long-term memory extracts information worth using in future sessions. StrataGate records decisions, preferences, plans, and changes as Events, then uses those Events to organize a knowledge graph.
|
|
225
180
|
|
|
226
|
-

|
|
227
182
|
|
|
228
183
|
**Event cards record what happened and retain their sources.**
|
|
229
184
|
|
|
@@ -304,27 +259,13 @@ These checks make retrieval traceable and auditable, but the model can still mis
|
|
|
304
259
|
|
|
305
260
|
<a id="use-only-reinforcement"></a>
|
|
306
261
|
|
|
307
|
-
### 4. Reinforce only memories actually used:
|
|
262
|
+
### 4. Reinforce only memories actually used: repeated use means slower future decay
|
|
308
263
|
|
|
309
264
|
Long-term memories also decay as conversations progress. Here, the changing quantity is an Event's weight, which participates in later recall and ranking. Unlike a short-term Block, an Event does not move through L0–L5 display levels as its weight decays.
|
|
310
265
|
|
|
311
|
-

|
|
326
267
|
|
|
327
|
-
|
|
268
|
+
An Event not used in answers gradually loses weight as conversation turns accumulate. This can lower its recall priority while its historical record remains available.
|
|
328
269
|
|
|
329
270
|
**Retrieval does not trigger reinforcement.**
|
|
330
271
|
|
|
@@ -353,49 +294,51 @@ Pinned memories have an effective weight of 1. Superseded Events normally receiv
|
|
|
353
294
|
|
|
354
295
|
These weights express a memory-management policy, not factual accuracy. Even high-weight information must be assessed against the current question, current state, and original source.
|
|
355
296
|
|
|
297
|
+
<details>
|
|
298
|
+
<summary>Long-term weight formula and counters</summary>
|
|
299
|
+
|
|
300
|
+
**New Events have an initial weight that decays when they are not adopted.**
|
|
301
|
+
|
|
302
|
+
The base Event-weight function is:
|
|
303
|
+
|
|
304
|
+
<p align="center"><strong>w(t,n) = max(floor, e<sup>−λ(n)t</sup>)</strong></p>
|
|
305
|
+
|
|
306
|
+
<p align="center"><strong>λ(n) = 0.15 / (1 + 1.5 ln(n))</strong></p>
|
|
307
|
+
|
|
308
|
+
Here:
|
|
309
|
+
|
|
310
|
+
- `t` is the difference between the current turn and the last adoption turn; new Events start counting from creation;
|
|
311
|
+
- `n` is the internal adoption count, initialized to 1 and incremented for each recorded adoption;
|
|
312
|
+
- `floor` is the minimum weight assigned according to the memory's criticality.
|
|
313
|
+
|
|
314
|
+
Long-term decay also uses conversation turns rather than elapsed wall-clock time. Lower weight may reduce a memory's priority in later recall, but decay does not delete its historical record.
|
|
315
|
+
|
|
316
|
+
</details>
|
|
317
|
+
|
|
356
318
|
<a id="external-memory-import"></a>
|
|
357
319
|
|
|
358
320
|
## Import memory from another AI
|
|
359
321
|
|
|
360
|
-
|
|
322
|
+
Import a memory summary exported by another AI. StrataGate turns lasting information into Events, compares it with existing memories, and keeps the imported text for source tracing.
|
|
361
323
|
|
|
362
|
-
The
|
|
324
|
+
The DSH UI previews the import. Duplicates can be ignored; changes can add, merge, or supersede information, and unresolved differences can be marked as conflicts. Low-confidence decisions allow manual selection, and committed batches can be undone. Earlier Events and their sources remain available.
|
|
363
325
|
|
|
364
|
-
|
|
326
|
+
See the [external-memory import guide](docs/EXTERNAL_MEMORY_IMPORT.zh-CN.md) for formats, prompts, and integration examples.
|
|
365
327
|
|
|
366
328
|
## A real retrieval path
|
|
367
329
|
|
|
368
|
-
One LoCoMo question asks when Caroline gave a speech at a school
|
|
330
|
+
One LoCoMo question asks when Caroline gave a speech at a school:
|
|
369
331
|
|
|
370
|
-
|
|
332
|
+
1. Event search finds the “school speech” card, but it lacks the date.
|
|
333
|
+
2. The agent judges the evidence partial, identifies the missing date, and searches source messages.
|
|
334
|
+
3. It finds a message dated 2023-06-09 containing “last week.”
|
|
335
|
+
4. The message timestamp gives context for “last week,” providing enough temporal evidence to answer.
|
|
371
336
|
|
|
372
|
-
|
|
373
|
-
search_events
|
|
374
|
-
↓
|
|
375
|
-
Match the “school speech” event card
|
|
376
|
-
↓
|
|
377
|
-
The event is relevant, but has no exact date
|
|
378
|
-
verdict = partial
|
|
379
|
-
missing = occurrence date
|
|
380
|
-
↓
|
|
381
|
-
search_raw_memory
|
|
382
|
-
↓
|
|
383
|
-
Find the source message dated 2023-06-09
|
|
384
|
-
It says “last week”
|
|
385
|
-
↓
|
|
386
|
-
Resolve the relative date against the message timestamp
|
|
387
|
-
verdict = sufficient
|
|
388
|
-
↓
|
|
389
|
-
Answer
|
|
390
|
-
```
|
|
337
|
+
The Event helps locate the discussion, and the original message and timestamp support verification. The evidence gate requires the agent to identify the gap and keep checking.
|
|
391
338
|
|
|
392
|
-
|
|
339
|
+
<a id="experimental-results"></a>
|
|
393
340
|
|
|
394
|
-
|
|
395
|
-
- the source timestamp and original message provide final verification;
|
|
396
|
-
- the evidence gate requires the agent to identify missing information and keep checking when evidence is insufficient.
|
|
397
|
-
|
|
398
|
-
## Experimental results
|
|
341
|
+
## Evaluation results and limits
|
|
399
342
|
|
|
400
343
|
The repository's published R8 comparison uses the LoCoMo conversation sample `conv-26`, containing **419 messages, 35 sessions, and 152 questions** across categories 1–4.
|
|
401
344
|
|
|
@@ -416,18 +359,6 @@ These results cover only `conv-26`, not the full LoCoMo dataset. They do not iso
|
|
|
416
359
|
|
|
417
360
|
See the [evaluation document](docs/EVALUATION.md) for the full protocol, per-question results, and Judge variation, and the [machine-readable results](benchmarks/locomo-conv26-r8-final.json) for summary data.
|
|
418
361
|
|
|
419
|
-
## How these designs emerged
|
|
420
|
-
|
|
421
|
-
Failures observed across several experimental rounds helped StrataGate refine its memory processing and retrieval strategies:
|
|
422
|
-
|
|
423
|
-
- **Store temporal information explicitly.** Summaries alone make event dates hard to recover, so event cards distinguish mention time from occurrence time and retain the original temporal wording and source.
|
|
424
|
-
- **Keep evidence assessment short and explicit.** Five fields require the agent to state its evidence, gaps, and next action while allowing code to validate references.
|
|
425
|
-
- **Change retrieval strategy when repeated searches add no information.** When an event card lacks key details, expanding its source or searching original messages is more useful than repeatedly searching the same cards.
|
|
426
|
-
|
|
427
|
-
The [evaluation document](docs/EVALUATION.md) retains the full R1–R8 history, version differences, and per-question analysis. Multiple changes occurred between rounds; these observations explain design choices but do not independently establish the effect of any single component.
|
|
428
|
-
|
|
429
|
-
## Current limitations and next steps
|
|
430
|
-
|
|
431
362
|
In the R8 evaluation above, **31 questions were judged incorrect by a majority of evaluators**. Grouped by the observable failure stage:
|
|
432
363
|
|
|
433
364
|
| Failure stage | Questions | What it indicates |
|
|
@@ -438,44 +369,19 @@ In the R8 evaluation above, **31 questions were judged incorrect by a majority o
|
|
|
438
369
|
|
|
439
370
|
Within this evaluation, the results point to a need to improve when retrieval starts and whether retrieved evidence actually answers the question. The evidence gate constrains references and assessment procedures, but cannot guarantee the model's semantic judgment or final answer.
|
|
440
371
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
1. Holding the model and memory state fixed while ablating short-term decay and key retrieval mechanisms, comparing accuracy, context use, and call costs.
|
|
444
|
-
2. Supplying known-correct source evidence directly to distinguish retrieval failures from reasoning errors that persist despite correct evidence.
|
|
445
|
-
3. Repeating the same protocol on more conversation samples before extending it to the full LoCoMo dataset.
|
|
446
|
-
|
|
447
|
-
## Current status
|
|
448
|
-
|
|
449
|
-
StrataGate provides an installable DeepSeek Harness plugin, with memory management implemented through a shared TypeScript core engine.
|
|
450
|
-
|
|
451
|
-
Current functionality includes:
|
|
452
|
-
|
|
453
|
-
- automatic capture of completed conversations and tool records;
|
|
454
|
-
- L0–L5 short-term memory views, display decay, and on-demand expansion;
|
|
455
|
-
- Events with provenance and time, plus a knowledge graph updated from those Events;
|
|
456
|
-
- automatic activation of relevant long-term memories, active search, and source lookup;
|
|
457
|
-
- retrieval-batch management, evidence assessment, and usage receipts;
|
|
458
|
-
- long-term weight decay, adoption-based reinforcement, and memory import from other AIs.
|
|
372
|
+
See the [full evaluation](docs/EVALUATION.md) for R1–R8 design history, per-question analysis, and further validation.
|
|
459
373
|
|
|
460
|
-
|
|
374
|
+
## Scope and costs
|
|
461
375
|
|
|
462
|
-
|
|
376
|
+
Memory can be scoped to a project, session, or globally. The graph UI supports inspecting information, relationships, and sources; collaborative editing and cross-product cloud synchronization are not its primary functions.
|
|
463
377
|
|
|
464
|
-
|
|
378
|
+
Layered views reduce historical context supplied when answering. Background summarization, Event extraction, and graph updates still call models, so smaller answer context does not automatically mean fewer total tokens or lower costs. Evaluate background usage especially in sessions with extensive tool records.
|
|
465
379
|
|
|
466
|
-
|
|
380
|
+
Public APIs, model integration, and evaluation coverage are evolving. Custom integrations should pin a version and validate their use cases. The evidence gate requires explicit support but cannot guarantee correct judgments or answers.
|
|
467
381
|
|
|
468
|
-
-
|
|
469
|
-
- **Continuing work across sessions.** Retrieve project decisions, user preferences, plans, and unfinished work in a new conversation.
|
|
470
|
-
- **Tracking changes.** Understand both current project state and historical changes without mistaking an earlier decision for the current one.
|
|
471
|
-
- **Verifying memory sources.** Trace Events and graph information back to original records when an answer depends on dates, exact wording, or tool results.
|
|
472
|
-
- **Migrating existing memories.** Turn information exported by another AI into Events while retaining the imported source text.
|
|
382
|
+
<a id="code-entry-points"></a>
|
|
473
383
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
DeepSeek Harness users can install the plugin through the [quick start](#quick-start-deepseek-harness). See the [plugin guide](docs/DSH.md) for configuration, memory tools, and recovery behavior.
|
|
477
|
-
|
|
478
|
-
## Code entry points
|
|
384
|
+
## Development and documentation
|
|
479
385
|
|
|
480
386
|
This section is for developers. DeepSeek Harness users can follow the [quick start](#quick-start-deepseek-harness) without building the repository themselves.
|
|
481
387
|
|
|
@@ -493,36 +399,6 @@ npm test
|
|
|
493
399
|
npm run build
|
|
494
400
|
```
|
|
495
401
|
|
|
496
|
-
The main code entry points are:
|
|
497
|
-
|
|
498
|
-
| Entry point | Contents |
|
|
499
|
-
| --- | --- |
|
|
500
|
-
| [Core-engine example](packages/core/examples/basic.ts) | Minimal integration example |
|
|
501
|
-
| [Core state and lifecycle](packages/core/src/store.ts) | Blocks, Events, graph, import, retrieval, and adoption records |
|
|
502
|
-
| [Layering and decay](packages/core/src/blocks.ts) | L0–L5 levels, display decay, and deterministic pruning |
|
|
503
|
-
| [Long-term weights](packages/core/src/weights.ts) | Event decay and minimum-weight calculation |
|
|
504
|
-
| [Event types](packages/core/src/events.ts) | Event-type normalization |
|
|
505
|
-
| [Knowledge graph](packages/core/src/graph.ts) | Provenance checks, graph updates, and state maintenance |
|
|
506
|
-
| [Retrieval ranking](packages/core/src/search.ts) | BM25 ranking and RRF fusion |
|
|
507
|
-
| [Evidence assessment](packages/core/src/retrieval.ts) | Assessment structure and reference constraints |
|
|
508
|
-
| [External-memory import](packages/core/src/external-memory.ts) | Import formats, prompts, and parsing |
|
|
509
|
-
| [Legacy Element-card support](packages/core/src/elements.ts) | Element projection and historical time views |
|
|
510
|
-
|
|
511
|
-
In persistent mode, `recordMemoryUse()` requires a nonempty, stable `receiptId`. Reuse that ID when retrying the same adoption operation to avoid duplicate reinforcement. For example:
|
|
512
|
-
|
|
513
|
-
```ts
|
|
514
|
-
await memory.recordMemoryUse(
|
|
515
|
-
{ eventIds: usedEventIds },
|
|
516
|
-
{ receiptId: usageReceiptId },
|
|
517
|
-
);
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
Here, `usedEventIds` contains the Events the application selected for the answer, and `usageReceiptId` identifies that adoption operation. The DSH plugin handles this through memory tools and its batch protocol; plugin users do not call this API manually.
|
|
521
|
-
|
|
522
|
-
The core example demonstrates API integration. See the [evaluation document](docs/EVALUATION.md) for the model calls, tool loop, and Judge protocol used in the full evaluation.
|
|
523
|
-
|
|
524
|
-
## Documentation and reproduction
|
|
525
|
-
|
|
526
402
|
| Resource | Contents |
|
|
527
403
|
| --- | --- |
|
|
528
404
|
| [DeepSeek Harness guide](docs/DSH.md) | Installation, configuration, UI, memory tools, and recovery |
|
|
@@ -532,17 +408,9 @@ The core example demonstrates API integration. See the [evaluation document](doc
|
|
|
532
408
|
| [Evaluation summary data](benchmarks/locomo-conv26-r8-final.json) | Published results, statistics, and artifact information |
|
|
533
409
|
| [Core-engine example](packages/core/examples/basic.ts) | Minimal API integration example |
|
|
534
410
|
|
|
535
|
-
|
|
411
|
+
The core implementation is in `packages/core/`; the DSH adapter is in `src/`. See [blocks.ts](packages/core/src/blocks.ts) for layered views and [weights.ts](packages/core/src/weights.ts) for long-term weights.
|
|
536
412
|
|
|
537
|
-
|
|
538
|
-
src/ DeepSeek Harness Host and Web client adapter
|
|
539
|
-
tests/ DeepSeek Harness integration tests
|
|
540
|
-
cordis.patch.yml Root-level DSH bundle manifest
|
|
541
|
-
packages/core/ Shared memory engine, core tests, and example
|
|
542
|
-
integrations/workbuddy/ WorkBuddy Host Adapter and MCP integration
|
|
543
|
-
docs/ DSH usage, architecture, and evaluation
|
|
544
|
-
benchmarks/ Machine-readable experiment results
|
|
545
|
-
```
|
|
413
|
+
`StrataGate.open()` uses SQLite; `StrataGate.inMemory()` is for temporary runs and tests. In persistent mode, `recordMemoryUse()` requires a stable `receiptId`. Reuse it when retrying the same recorded use to prevent duplicate reinforcement. See the [architecture guide](docs/ARCHITECTURE.md).
|
|
546
414
|
|
|
547
415
|
## Contributing
|
|
548
416
|
|