@kenz1117/dsh-engram 0.9.3 → 0.9.4
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 +6 -6
- package/README.md +6 -6
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -84,7 +84,7 @@ Sensory and emotional dimensions (smell, temperature, emotional weight) are deli
|
|
|
84
84
|
- **History backfill** (v0.7.3+): distils dsh's persisted past sessions into the palace, turn by turn — each session is written into the project store matching **its own cwd** (no cross-project bleed), reusing the live-capture throttling, redaction, and echo suppression, with a `(session, turn)` idempotency key so an interrupted run resumes. Backfilled entries never enter the due-today queue. **You choose the import rules** (time window / turns per session / total turn budget / auxiliary model / include subagent·seeded·no-cwd sessions) and see a zero-cost estimate (no LLM calls) before running; staging happens in a dedicated **"Backfill" tab** with progress (including a **breakdown of skip reasons**) and pause. Auxiliary calls **reuse the model you are currently using** by default (a past session's log records the provider/model of that time, which may no longer be available here), or you can pick one explicitly from the host's registered providers/models in the tab's "Auxiliary model" dropdown.
|
|
85
85
|
- **Knowledge flywheel**: capture/save → contradiction candidates (high-similarity neighbors create `contradicts` edges on write, for the model/user to adjudicate) → hit reinforcement (confidence +0.05) → distillation (topic clusters merge into higher-level rules, supersedes chains, confidence inheritance) → decay (low-importance, long-unaccessed entries archive; restorable).
|
|
86
86
|
- **Automatic belief consolidation** (v0.7.14+, off by default; yml `reflect: suggest|auto`): after a session ends, raw memories that have not yet served as evidence for any belief are consolidated by an auxiliary LLM into one-sentence **observations**. Unlike distillation, the raw memories are all kept — the observation is an **additional abstraction layer**: each belief carries its evidence-id list plus a proof count, and same-topic beliefs merge automatically by vector proximity (cosine ≥0.9), so one belief is **continuously refined** instead of duplicated. When new evidence lands near an existing belief (≥0.86) the belief turns `stale`, and the next consolidation feeds its raw evidence back to the model for a freshness review with four outcomes — `form` (new), `refine`, `still` (holds), `refute` (kept with its evidence chain for audit). In `auto` mode consolidation runs in the background after the session (5s timeout; failures never affect the conversation); in `suggest` mode it only enqueues a pending-consolidation task that the `engram_reflect` tool drains (the tool can also be invoked manually in any mode). The top 3 active beliefs by proof count are injected with the profile packet; stale/refuted beliefs are never injected. Schema upgraded to v12 (the observations table; incremental migration, zero data movement).
|
|
87
|
-
- **Jev System-One adjudication** (v0.7.12+, off by default, the `jev` block in yml): the DEFER fuzzy-band three-way ruling (merge / accept / defer) and contradiction-edge confirmation can be delegated to an external Jev model; when Jev is unavailable (network failure / timeout /
|
|
87
|
+
- **Jev System-One adjudication** (v0.7.12+, off by default, the `jev` block in yml): the DEFER fuzzy-band three-way ruling (merge / accept / defer) and contradiction-edge confirmation can be delegated to an external Jev model; when Jev is unavailable (network failure / timeout / no provider or model resolved) it silently falls back to the pure-rule four-way behavior, **never blocking writes**. Every adjudication leaves a side observation (verdict, whether Jev took part, elapsed time, fallback reason; up to 50 in-process, cleared on restart), so the panel's "Jev" view answers "why was this one deferred" at a glance. Five yml fields — the switch / provider / model / endpoint / timeout — can be overridden from the panel (stored at `<dbDir>/jev-config.json`, 0600 file inside a 0700 directory) and take effect on save without a restart; the endpoint defaults to `{baseURL}/systemone`; a "Test connection" button verifies it with the current input (unsaved values are tested as typed, never written to the override file); the token is never a plugin setting — it is resolved at call time from the named provider's credential store, so there is no second copy to mask, sync or rotate. The three thresholds stay yml-only advanced settings, shown read-only.
|
|
88
88
|
- **Entity lexicon** (v0.7.10+): the auxiliary LLM output of automatic capture and `engram_save` also extracts entity mentions (people/projects/tools/concepts, with optional aliases), resolved by normalized name against existing entities' names/aliases — a hit reuses the entity and refreshes its "last mentioned" stamp, a miss creates one; memories and entities link many-to-many, stored in the same store as the source memory. `engram_search` rows carry entity tags of the hits; entity-resolution failures silently skip the links and never block the memory write itself. The panel's "Entities" view filters by kind, searches names/aliases, and opens one entity to see every memory it pulls in.
|
|
89
89
|
- **Automatic capture** (when `ingest` is enabled): each new turn's first step extracts candidate facts from the previous turn out of the session log, and session end captures the final turn too (failures leave a pending key that the next session replays; capture is idempotent per session+turn), written with low confidence and, when embeddings are available, disposed by the four-state rule toward near neighbors (merge-and-reinforce restatements / edge-and-defer suspected contradictions / write fresh) — memories accumulate without you saying "remember this".
|
|
90
90
|
- **Provenance audit**: every memory records its source session, turn, and event seq; `engram_review` traces the full source chain, supersede chain, contradictions, and operation log; all writes/edits/forgets/distills/decays land in the operation log table.
|
|
@@ -160,19 +160,19 @@ Optional configuration (cordis.yml):
|
|
|
160
160
|
historyBackfillIncludeSubagents: false # exclude subagent sessions by default
|
|
161
161
|
historyBackfillIncludeSeeded: false # exclude seeded sessions by default
|
|
162
162
|
historyBackfillIncludeNoCwd: false # exclude sessions without cwd by default (they can only go to the user store)
|
|
163
|
-
# Jev System-One adjudication (off by default;
|
|
163
|
+
# Jev System-One adjudication (off by default; provider and model come from DSH and the plugin stores no key; failures silently degrade to the pure-rule four-way behavior)
|
|
164
164
|
# DEFER fuzzy-band three-way ruling: probability ≥ deferMergeAbove → same memory (merge), ≤ deferAcceptBelow → different (accept), in between stays defer;
|
|
165
165
|
# before a defer lands, contradiction edges are confirmed by Jev first (an edge is created only at probability ≥ contradictMinProbability).
|
|
166
166
|
jev:
|
|
167
167
|
enabled: false # switch
|
|
168
|
-
#
|
|
169
|
-
#
|
|
170
|
-
#
|
|
168
|
+
# provider: '' # DSH provider Jev is taken from (its baseURL and credential store are used); empty = the provider this session already runs on
|
|
169
|
+
# model: 'jev-latest' # adjudication model name; empty = that provider's first Jev model
|
|
170
|
+
# endpoint: '' # full System One endpoint (POST /v1/systemone); empty = derived from the provider as {baseURL}/systemone
|
|
171
171
|
# timeoutMs: 3000 # per-request timeout in ms (1000-60000)
|
|
172
172
|
# deferMergeAbove: 0.85 # fuzzy-band probability ≥ this → same memory (merge)
|
|
173
173
|
# deferAcceptBelow: 0.15 # fuzzy-band probability ≤ this → different (accept)
|
|
174
174
|
# contradictMinProbability: 0.8 # contradiction confirmation probability ≥ this → create the contradicts edge
|
|
175
|
-
# The five fields above (enabled/
|
|
175
|
+
# The five fields above (enabled/provider/model/endpoint/timeoutMs) can be overridden from the panel's "Jev" tab (stored at <dbDir>/jev-config.json, field-level override, effective immediately on save); the three thresholds are configurable only here. The token is not a plugin setting: it is resolved at call time from the named provider's credential store, so the plugin holds no secret to mask, sync or rotate. A legacy apiKey/baseUrl left in this block or in the override is ignored, with a one-time warning naming the field and telling you where the key moved
|
|
176
176
|
```
|
|
177
177
|
|
|
178
178
|
## How It Works
|
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ dsh plugin --profile web add @kenz1117/dsh-engram
|
|
|
84
84
|
- **历史会话回填**(v0.7.3+):把 dsh 已持久化的历史会话逐轮提炼进宫殿——默认按**每个会话自己的 cwd** 写进对应项目库(不串库),同样逐条判作用域(跨项目通用的个人偏好落私人库),复用实时摄取的节流/脱敏/防回声,靠 (会话, 轮次) 幂等键支持中断续跑(键固定在私人库,与实时路径共用);回填条目不进今日复习队列(避免一次性回填淹没「今日待回忆」)。**导入规则由你选**(时间窗 / 单会话轮数 / 总轮数上限 / 辅助模型 / 是否含子代理·种子·无 cwd 会话),先估算(零成本、不调 LLM)再执行;设置页有独立的**「回填」tab**,可看进度(含**跳过原因分布**)与暂停续做。辅助调用默认**复用你当前在用的模型**(历史日志里记的是当年的 provider/model,在当前环境可能已不可用),也可在面板「辅助模型」下拉里从宿主已注册的 provider/model 中直接指定。
|
|
85
85
|
- **知识飞轮**:摄取/保存 → 矛盾候选(写入时高相似近邻建 `contradicts` 边并报告,模型/用户裁决)→ 命中强化(confidence +0.05)→ 蒸馏(同主题簇合并为高层规律、supersedes 取代链、置信度继承)→ 衰减(低重要性且长期未访问归档,可恢复)。
|
|
86
86
|
- **自动信念巩固**(v0.7.14+,默认关闭,yml `reflect: suggest|auto`):会话结束后把「尚未成为任何信念证据」的原始记忆交辅助 LLM 巩固为一句话**信念(observation)**——与蒸馏的关键区别是原始记忆全部保留,信念是**叠加的抽象层**:每条信念带证据 id 列表与证据数(proof count),同主题经向量近邻(余弦 ≥0.9)自动归并、**持续细化同一条**而非反复新增。新证据与既有信念近邻(≥0.86)时信念先转 `stale`,下次巩固把原始证据一并喂给模型复核,结果四选一——`form` 新建、`refine` 细化、`still` 维持、`refute` 否定(保留证据链供审计)。`auto` 档会话结束后台巩固(5 秒超时、异常不影响对话);`suggest` 档只登记待巩固任务,由 `engram_reflect` 工具一键执行(任何档位都可手动调)。active 信念按证据数取前 3 条随画像包注入会话,stale/refuted 不注入。schema 升级到 v12(observations 表,增量迁移、存量数据零搬运)。
|
|
87
|
-
- **Jev 系统一裁决**(v0.7.12+,默认关闭,yml `jev` 子配置):DEFER 模糊带的三路判定(并入 / 放行 / 搁置)与矛盾边确认可交外部 Jev 模型判决;Jev 不可用(网络失败 / 超时 /
|
|
87
|
+
- **Jev 系统一裁决**(v0.7.12+,默认关闭,yml `jev` 子配置):DEFER 模糊带的三路判定(并入 / 放行 / 搁置)与矛盾边确认可交外部 Jev 模型判决;Jev 不可用(网络失败 / 超时 / 未解析出提供商或模型)时静默回落纯规则四态,**不阻断写入**。每次裁决旁路留观测(判定结果、Jev 是否参与、耗时、回落原因,进程内最多 50 条、重启清空),面板「裁决」视图一眼排查「为什么这条被搁置」。yml 的开关 / 提供商 / 模型 / 端点 / 超时五项可在面板覆盖(存 `<dbDir>/jev-config.json`,0600 文件 + 0700 目录),保存即时生效无需重启;端点留空时按提供商推导为 `{baseURL}/systemone`;「测试连接」按钮用当前输入即时验证(未保存也按当前值测、不落覆盖文件);令牌不是插件设置,调用时从所选提供商的密钥库解析,因此插件手里没有第二份可掩码、可同步、可轮换的副本。三阈值保持 yml 高级配置,面板只读展示。
|
|
88
88
|
- **实体词典**(v0.7.10+):自动摄取与 `engram_save` 的辅助 LLM 输出同时抽取实体提及(人物/项目/工具/概念,可带别名),按归一化名与既有实体的 name/aliases 精确匹配消解——命中复用并刷新「最近提及」,未命中新建;记忆与实体多对多关联,随来源记忆所在 scope 分库。`engram_search` 命中行附关联实体标签;实体消解故障只静默跳过关联,不影响记忆落库。面板「实体」视图按类别筛选、按名称/别名搜索,点开单实体看它牵出的所有记忆。
|
|
89
89
|
- **自动摄取**(`ingest` 配置开启时):新一轮第一步从会话日志提取上一轮的候选事实,会话结束时补摄取最后一轮(失败留 pending 键,下次会话自动补做,幂等不重复),低 confidence 写入,嵌入可用时按四态处置近邻(复述并入强化 / 疑似矛盾建边待裁决 / 全新写入)——不说"记住"也能攒记忆。**逐条判宫殿**:提炼时同步判定作用域,只跟当前项目/仓库有关的(技术选型、项目约定、架构决策)进当前会话 cwd 对应的项目库,跨项目通用的(个人偏好、习惯、本人经历)进私人库——偏好跟人走、约定跟仓库走。
|
|
90
90
|
- **来源审计**:每条记忆记录来源会话、轮次与事件 seq,`engram_review` 完整回查来源链、取代链、矛盾与操作日志;全部写入/修改/遗忘/蒸馏/衰减入操作日志表。
|
|
@@ -160,19 +160,19 @@ dsh plugin --profile web add @kenz1117/dsh-engram
|
|
|
160
160
|
historyBackfillIncludeSubagents: false # 默认排除子代理会话
|
|
161
161
|
historyBackfillIncludeSeeded: false # 默认排除种子会话
|
|
162
162
|
historyBackfillIncludeNoCwd: false # 默认排除无 cwd 会话(这类只能进 user 库)
|
|
163
|
-
# Jev
|
|
163
|
+
# Jev 系统一裁决(默认关闭;提供商与模型取自 DSH,插件不保存密钥;Jev 不可用时静默降级回纯规则四态)
|
|
164
164
|
# DEFER 模糊带三路裁决:概率≥deferMergeAbove 判同一条(merge),概率≤deferAcceptBelow 判不同条(accept),中间保持 defer;
|
|
165
165
|
# defer 落库前矛盾边先经 Jev 确认(概率≥contradictMinProbability 才建 contradicts 边)。
|
|
166
166
|
jev:
|
|
167
167
|
enabled: false # 开关
|
|
168
|
-
#
|
|
169
|
-
#
|
|
170
|
-
#
|
|
168
|
+
# provider: '' # Jev 取自哪个 DSH 提供商(用它的 baseURL 与密钥库);留空 = 本会话正在用的那个
|
|
169
|
+
# model: 'jev-latest' # 判决模型名;留空 = 该提供商的第一个 Jev 模型
|
|
170
|
+
# endpoint: '' # System One 完整端点(POST /v1/systemone);留空 = 按提供商推导 {baseURL}/systemone
|
|
171
171
|
# timeoutMs: 3000 # 单次请求超时(毫秒,1000-60000)
|
|
172
172
|
# deferMergeAbove: 0.85 # 模糊带概率≥此值判同一条(merge)
|
|
173
173
|
# deferAcceptBelow: 0.15 # 模糊带概率≤此值判不同条(accept)
|
|
174
174
|
# contradictMinProbability: 0.8 # 矛盾确认概率≥此值才建 contradicts 边
|
|
175
|
-
# 以上 enabled/
|
|
175
|
+
# 以上 enabled/provider/model/endpoint/timeoutMs 五项可在管理面板「裁决」tab 覆盖(存 <dbDir>/jev-config.json,字段级覆盖,保存即时生效);三阈值仅此处可配。令牌不是插件设置:调用时从所选提供商的密钥库解析,插件手里没有可掩码、可同步、可轮换的副本。此处或覆盖文件中遗留的 apiKey/baseUrl 会被忽略,并给出一次性告警,指明字段与密钥的去处
|
|
176
176
|
```
|
|
177
177
|
|
|
178
178
|
## 工作原理
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenz1117/dsh-engram",
|
|
3
3
|
"description": "Cross-session long-term memory for DeepSeek Harness (memory palace · AGI Architecture Exploration on dsh-market): dual-scope SQLite memory graph, hybrid retrieval, provenance audit, and a knowledge flywheel.",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.4",
|
|
5
5
|
"icon": "icon.svg",
|
|
6
6
|
"logo": "icon-256.svg",
|
|
7
7
|
"publishConfig": {
|