dsh-layered-memory 0.8.2 → 0.8.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 +7 -4
- package/README.md +12 -3
- package/dist/client.js +368 -104
- package/dist/config.d.ts +4 -4
- package/dist/config.js +4 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -2
- package/dist/llm.d.ts +20 -0
- package/dist/llm.js +82 -6
- package/dist/pipeline/runner.js +6 -2
- package/dist/settings.d.ts +2 -1
- package/dist/settings.js +2 -2
- package/dist/stats.js +46 -12
- package/dist/store/download-queue.d.ts +3 -0
- package/dist/store/download-queue.js +22 -2
- package/dist/store/embedding-source.d.ts +1 -1
- package/dist/store/embedding-source.js +3 -3
- package/dist/store/io.d.ts +10 -2
- package/dist/store/io.js +28 -6
- package/dist/store/l0.js +7 -2
- package/dist/store/l1.js +17 -7
- package/dist/store/local-embedding.d.ts +3 -1
- package/dist/store/local-embedding.js +5 -2
- package/dist/store/runtime-installer.d.ts +8 -1
- package/dist/store/runtime-installer.js +34 -5
- package/dist/store/scenes.d.ts +2 -1
- package/dist/store/scenes.js +10 -1
- package/dist/store/sqlite.js +3 -3
- package/dist/tools/index.js +12 -2
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -21,7 +21,7 @@ Requires Node ≥ 22.16. Two invocation styles — the `npx` prefix can replace
|
|
|
21
21
|
any command below:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
# Option 1: run the official CLI directly via npx (no pre-installed dsh; version can be pinned, e.g. dsh-layered-memory@0.8.
|
|
24
|
+
# Option 1: run the official CLI directly via npx (no pre-installed dsh; version can be pinned, e.g. dsh-layered-memory@0.8.2)
|
|
25
25
|
npx -y @deepseek-ai/dsh plugin --profile web add dsh-layered-memory
|
|
26
26
|
|
|
27
27
|
# Option 2: with the dsh CLI installed (dsh is a pnpm forwarder; npm i -g pnpm first if missing)
|
|
@@ -234,8 +234,8 @@ the bundle layer appends and causes `duplicate loader entry id` startup failure)
|
|
|
234
234
|
| `embedding.mirror` | `https://hf-mirror.com` | Download mirror root for local models (can be changed back to `https://huggingface.co`) |
|
|
235
235
|
| `embedding.proxy` | `''` | Three-state download proxy: `''` (default) = auto-detect proxy env vars (`HTTPS_PROXY`/`ALL_PROXY` etc., honoring `NO_PROXY`); `none` = disable, always direct; any other value = proxy URL (e.g. `http://127.0.0.1:7890`). Direct connections to the mirror are intermittently unreachable on some networks (connect timeouts and poisoned bytes have both been observed) — keep the default auto-detection on machines with a proxy |
|
|
236
236
|
| `llm.provider/model` | empty | Static distillation route (deployment pin): when **both** fields are set the route is locked, outranking the settings-page selection and the default model (deployments can force distillation onto a specific route); when empty the route follows "settings-page selection → default model". At runtime, switch among **configured providers** (including custom ones added in dsh Settings → Models) via the "distillation model" picker in Settings → Memory → Overview — effective immediately, no restart needed |
|
|
237
|
-
| `llm.maxTokens` | `65536` | Fallback output cap for non-layered calls. Each distillation stage has its own budget (extraction 16k / dedup 8k / L2 32k / L3 16k; auto ×4 when reasoning effort is high/max, so thinking can't starve the text budget); the per-layer budgets are runtime-adjustable in Settings → Memory → Overview → distillation parameters (empty/0 = built-in defaults) |
|
|
238
|
-
| `llm.reasoningEffort` |
|
|
237
|
+
| `llm.maxTokens` | `65536` | Fallback output cap for non-layered calls. Each distillation stage has its own budget (extraction 16k / dedup 8k / L2 32k / L3 16k; auto ×4 when the reasoning effort is high/xhigh/max, so thinking can't starve the text budget); the per-layer budgets are runtime-adjustable in Settings → Memory → Overview → distillation parameters (empty/0 = built-in defaults) |
|
|
238
|
+
| `llm.reasoningEffort` | empty | Distillation reasoning effort: empty = **auto** (resolved from model capability: the model's default tier, else `high`); an explicit value (`off`/`none`/`low`/`medium`/`high`/`xhigh`/`max`) is only sent when the model declares support — effort vocabularies differ across providers (deepseek accepts `off`, OpenAI-style APIs use `none`, models that declare no tiers get nothing), and unsupported tiers degrade to not-sending with a one-time warning; output budgets auto-×4 at high/xhigh/max. Switchable at runtime in Settings → Memory → Overview; the selectable tiers follow the current model live |
|
|
239
239
|
| `llm.temperature` | `0.3` | Distillation temperature |
|
|
240
240
|
| `llm.maxInputChars` | `700000` | Input character budget per distillation call (over-budget L1 inputs are chunked automatically); runtime-adjustable in Settings → distillation parameters → input budget (empty/0 = follow this value) |
|
|
241
241
|
| `llm.timeoutMs` | `120000` | Per-call distillation timeout (ms) |
|
|
@@ -297,7 +297,10 @@ The dsh host prints plugin logs to the console; the plugin mirrors info and abov
|
|
|
297
297
|
chars, duration)` → `L1 extraction done` → `pipeline end`; the next turn shows
|
|
298
298
|
`recall hit N L1 records`. Empty LLM output carries full diagnostics (finish reason /
|
|
299
299
|
token counts / reasoning excerpt); JSON parse failures include the first 400 characters
|
|
300
|
-
of the raw model output; all failure warns carry the first stack frame.
|
|
300
|
+
of the raw model output; all failure warns carry the first stack frame. The JSONL
|
|
301
|
+
fact source is appended per turn and relies on OS write-back (no per-line fsync);
|
|
302
|
+
an extreme crash (power loss) loses at most a small tail, and the index DB can be
|
|
303
|
+
fully re-derived from the fact source via "Rebuild memories".
|
|
301
304
|
|
|
302
305
|
## Differences from MemoryCore
|
|
303
306
|
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
需要 Node ≥ 22.16。两种调用方式任选(`npx` 前缀可替换下面任何 `dsh` 命令):
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
# 方式一:npx 直接跑官方 CLI(无需预装 dsh;可 pin 版本,如 dsh-layered-memory@0.8.
|
|
23
|
+
# 方式一:npx 直接跑官方 CLI(无需预装 dsh;可 pin 版本,如 dsh-layered-memory@0.8.2)
|
|
24
24
|
npx -y @deepseek-ai/dsh plugin --profile web add dsh-layered-memory
|
|
25
25
|
|
|
26
26
|
# 方式二:已装 dsh CLI(dsh 是 pnpm 转发器,未装 pnpm 时先 npm i -g pnpm)
|
|
@@ -251,13 +251,22 @@ ONNX 量化 **CPU 推理**——无需 API Key,数据不出本机)。本地
|
|
|
251
251
|
| `embedding.mirror` | `https://hf-mirror.com` | 本地模型下载镜像根地址(可改回官方 `https://huggingface.co`) |
|
|
252
252
|
| `embedding.proxy` | `''` | 模型下载代理三态:`''`(默认)= 自动探测代理环境变量(`HTTPS_PROXY`/`ALL_PROXY` 等,尊重 `NO_PROXY`);`none` = 禁用强制直连;其他值 = 代理 URL(如 `http://127.0.0.1:7890`)。镜像直连在国内网络间歇不可达(直连超时与污染字节交替出现过),开代理的机器建议保持默认自动探测 |
|
|
253
253
|
| `llm.provider/model` | 空 | 蒸馏模型静态路由(部署 pin):provider 与 model **双字段齐**时锁定蒸馏路由,优先于设置页的运行时选择与默认模型(部署可强制蒸馏走指定路由);留空则跟随"设置页选择 → 默认模型"。运行时可在设置页 → 记忆 → 概览的"蒸馏模型"选择器从**已配置的供应商**(含 dsh 设置 → 模型里添加的自定义供应商)中切换,即时生效无需重启 |
|
|
254
|
-
| `llm.maxTokens` | `65536` | 未分层调用的兜底输出总闸。各蒸馏层有独立预算(抽取 16k / 去重 8k / L2 32k / L3 16k;思考档 high/max 时自动 ×4,防 reasoning 吃光预算),分层预算可在设置页 → 记忆 → 概览 → 蒸馏参数运行时调整(留空/0 = 跟随内置默认) |
|
|
255
|
-
| `llm.reasoningEffort` |
|
|
254
|
+
| `llm.maxTokens` | `65536` | 未分层调用的兜底输出总闸。各蒸馏层有独立预算(抽取 16k / 去重 8k / L2 32k / L3 16k;思考档 high/xhigh/max 时自动 ×4,防 reasoning 吃光预算),分层预算可在设置页 → 记忆 → 概览 → 蒸馏参数运行时调整(留空/0 = 跟随内置默认) |
|
|
255
|
+
| `llm.reasoningEffort` | 空 | 蒸馏思考档位:空串 = **自动**(按模型能力解析:模型默认档 → `high`);显式值(`off`/`none`/`low`/`medium`/`high`/`xhigh`/`max`)仅在该模型声明支持时发送——跨供应商 effort 词汇表不同(deepseek 认 `off`,OpenAI 系是 `none`,未声明档位的模型不传),不支持的档位自动降级为不传并告警一次;思考档 high/xhigh/max 时输出预算自动 ×4。运行时在设置页 → 记忆 → 概览切换,可选档位表跟随当前模型实时显示 |
|
|
256
256
|
| `llm.temperature` | `0.3` | 蒸馏温度 |
|
|
257
257
|
| `llm.maxInputChars` | `700000` | 单次蒸馏输入字符预算(超限的 L1 输入自动分块抽取);运行时可在设置页 → 蒸馏参数 → 输入预算调整(留空/0 = 跟随本值) |
|
|
258
258
|
| `llm.timeoutMs` | `120000` | 单次蒸馏调用超时(ms) |
|
|
259
259
|
| `tools` | `true` | 是否注册模型可调用的记忆工具 |
|
|
260
260
|
|
|
261
|
+
## 日志与故障排查
|
|
262
|
+
|
|
263
|
+
dsh 宿主把插件日志打到控制台;插件另把 info 级以上镜像到数据目录的 `memory.log`。
|
|
264
|
+
一轮对话的典型日志路径:`L0 捕获` → `L0 落盘` → `蒸馏管线开始` → `LLM 调用(输入/输出
|
|
265
|
+
字符数、耗时)` → `L1 阶段完成` → `管线结束`;下一轮开头是 `召回注入 N 条 L1`。LLM 空输出
|
|
266
|
+
带完整诊断(finish reason / token 计数 / reasoning 摘录);JSON 解析失败记录模型原始输出
|
|
267
|
+
前 400 字符;所有失败告警带堆栈首帧。JSONL 事实源按轮次追加、依赖操作系统写回(不做逐条
|
|
268
|
+
fsync),断电等极端崩溃最多丢最后一小段尾部,检索库可用「重建记忆」从事实源全量重导。
|
|
269
|
+
|
|
261
270
|
## 与 MemoryCore 的差异
|
|
262
271
|
|
|
263
272
|
- 内嵌完整管线(不依赖外部 Gateway),蒸馏复用 DSH 自己的 LLM;
|