@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.
- package/README.md +26 -47
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,65 +1,44 @@
|
|
|
1
1
|
# @devflow-tools/memory-engine
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> 持久化 session events、结构化 observations 和审核记忆,并提供混合搜索与 embedding 实现。(v0.17.6)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](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
|
-
##
|
|
13
|
+
## 快速开始
|
|
12
14
|
|
|
13
15
|
```typescript
|
|
14
16
|
import { MemoryGate } from '@devflow-tools/memory-engine';
|
|
15
17
|
|
|
16
|
-
const memory = new MemoryGate(
|
|
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
|
-
##
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
##
|
|
46
|
-
|
|
47
|
-
- `
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
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.
|
|
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.
|
|
21
|
-
"@devflow-tools/telemetry": "0.17.
|
|
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": "
|
|
34
|
+
"gitHead": "669fea3aa72aa3fde14ed50d24c1fec4dfac088f"
|
|
35
35
|
}
|