@devflow-tools/memory-engine 0.17.5 → 0.17.6

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.
Files changed (2) hide show
  1. package/README.md +26 -47
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,65 +1,44 @@
1
1
  # @devflow-tools/memory-engine
2
2
 
3
- DevFlow 记忆引擎存储 session tool events、结构化 observations 和已审核记忆,并为宿主模型驱动的 MCP 提炼流程提供持久化与搜索能力。
3
+ > 持久化 session events、结构化 observations 和审核记忆,并提供混合搜索与 embedding 实现。(v0.17.6)
4
4
 
5
- ## Installation
5
+ [![npm version](https://img.shields.io/npm/v/%40devflow-tools%2Fmemory-engine.svg)](https://www.npmjs.com/package/@devflow-tools/memory-engine)
6
+
7
+ ## 安装
6
8
 
7
9
  ```bash
8
10
  npm install @devflow-tools/memory-engine
9
11
  ```
10
12
 
11
- ## Usage
13
+ ## 快速开始
12
14
 
13
15
  ```typescript
14
16
  import { MemoryGate } from '@devflow-tools/memory-engine';
15
17
 
16
- const memory = new MemoryGate('/path/to/project');
18
+ const memory = new MemoryGate(process.cwd());
17
19
  await memory.forceWarmUp();
18
-
19
- // Hook producers record events for next-session MCP distillation.
20
- await memory.recordEvent({
21
- id: 'event-1',
22
- sessionId: 'session-1',
23
- tool: 'Bash',
24
- command: 'npm test',
25
- exitCode: 1,
26
- stderr: 'Tests: 1 failed',
27
- durationMs: 3200,
28
- createdAt: Date.now(),
29
- });
30
-
31
- // On the next session, the host calls the MCP tool memory_request_distill.
32
- // The host model summarizes the leased events and saves observations through
33
- // memory_save_distilled. No local model service is required.
20
+ console.log(await memory.getProjectContext());
34
21
  ```
35
22
 
36
- ## Features
37
-
38
- - **Session event storage** — 持久化 hook tool events,供下一会话按批次租约读取
39
- - **Host-model distillation** — `memory_request_distill` 返回待处理事件,宿主模型生成 observations
40
- - **Signal analysis** — 规则评分用于缓冲和分组,不生成 LLM 记忆
41
- - **候选审核** — 结构化记忆支持 approve/reject 生命周期
42
- - **分层管理** — 项目层(技术栈、约定)、用户层(偏好)、全局层(最佳实践)
43
- - **BM25 搜索** — 按内容和类型搜索已审核记忆
44
-
45
- ## API
46
-
47
- - `new MemoryGate(projectRoot)` — 创建项目记忆入口
48
- - `.forceWarmUp()` — 初始化项目存储
49
- - `.getAll()` — 获取所有已审核记忆
50
- - `.getCandidates()` — 获取待审核的候选记忆
51
- - `.approveCandidate(id)` — 批准候选记忆
52
- - `.rejectCandidate(id)` — 拒绝候选记忆(标记为 rejected)
53
- - `.recordEvent(event)` — 将 hook event 写入 `session_events`
54
- - `.getPendingDistillData()` — 为 MCP `memory_request_distill` 租约并返回待处理事件
55
- - `.saveDistilledObservationsByBatch(batchId, observations)` — 保存宿主模型提炼结果
56
- - `.search(query, options?)` — 搜索记忆(支持 category/source 过滤)
57
- - `.listMemories(filter?)` — 按条件列出记忆
58
- - `.getUserPreferences()` — 获取用户偏好
59
- - `.updateUserPreference(key, value)` — 更新用户偏好
60
- - `.getProjectContext()` — 获取项目上下文(技术栈、约定)
61
- - `.searchGlobal(query)` — 搜索全局知识库
62
- - `.upsertGlobal(entries)` — 批量更新全局知识条目
23
+ ## 公共 API / 命令
24
+
25
+ `MemoryEngine`、`MemoryGate`、`MemoryStore`、`HybridSearch`、`EmbeddingProvider`、`runMemoryMaintenance`、`consolidate` 和 memory capsule/semantic helpers。
26
+
27
+
28
+ ## 配置与运行时
29
+
30
+ memory-engine 依赖 SDK 的 embedding contract,并提供具体 provider;宿主模型通过 MCP 提炼事件,不要求本地 LLM 服务。
31
+
32
+ ## 版本与兼容性
33
+
34
+ - 当前包版本:`0.17.6`
35
+ - Node.js:未在 package manifest 声明更高版本时,使用 Node.js 18+;原生 SQLite/Playwright 能力请按对应依赖安装
36
+ - workspace 内部包应使用同一 DevFlow minor/patch 版本,避免类型和数据库 schema 不一致
37
+
38
+ ## 相关链接
39
+
40
+ - [DevFlow 仓库](https://github.com/shilongfeicool/dev-flow)
41
+ - [问题反馈](https://github.com/shilongfeicool/dev-flow/issues)
63
42
 
64
43
  ## License
65
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/memory-engine",
3
- "version": "0.17.5",
3
+ "version": "0.17.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -17,8 +17,8 @@
17
17
  "clean": "rm -rf dist"
18
18
  },
19
19
  "dependencies": {
20
- "@devflow-tools/sdk": "0.17.5",
21
- "@devflow-tools/telemetry": "0.17.5",
20
+ "@devflow-tools/sdk": "0.17.6",
21
+ "@devflow-tools/telemetry": "0.17.6",
22
22
  "@xenova/transformers": "^2.17.0",
23
23
  "better-sqlite3": "^12.0.0",
24
24
  "sqlite-vec": "^0.1.9",
@@ -31,5 +31,5 @@
31
31
  "files": [
32
32
  "dist"
33
33
  ],
34
- "gitHead": "817b0286c249eed9c2bd27d3974ee3b3d6ded4bb"
34
+ "gitHead": "669fea3aa72aa3fde14ed50d24c1fec4dfac088f"
35
35
  }