Skip to content

Commit c803ef7

Browse files
committed
feat(memory): enhance documentation and add new commands for memory management
- Added links to memory documentation in both English and Chinese in the README files. - Updated the memory capability matrix to reference the user guide and improved clarity in descriptions. - Introduced new commands for memory node display and skill export, enhancing the CLI's functionality. - Improved command descriptions and added new flags for better user experience in memory operations.
1 parent 47704d4 commit c803ef7

34 files changed

Lines changed: 1596 additions & 301 deletions

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ Scan the QR code to join the Aliyun Model Studio CLI DingTalk user group for usa
192192

193193
## Links
194194

195+
Memory documentation (Chinese): [capability matrix](docs/memory/cli-matrix.md) · [user guide](docs/memory/user-guide.md).
196+
195197
| Resource | URL |
196198
| :--------------------------- | :---------------------------------------------------------------------------------------- |
197199
| Aliyun Model Studio CLI Site | https://bailian.console.aliyun.com/cli?source_channel=cli_github& |

‎README.zh.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ bl update
191191

192192
## 相关链接
193193

194+
Memory 用户文档:[能力矩阵](docs/memory/cli-matrix.md) · [技术指南](docs/memory/user-guide.md)。
195+
194196
| 资源 | 地址 |
195197
| :---------------------- | :---------------------------------------------------------------------------------------- |
196198
| 阿里云百炼 CLI 官方主页 | https://bailian.console.aliyun.com/cli?source_channel=cli_github& |

‎docs/memory/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
Memory CLI 用于写入和检索长期记忆、维护记忆节点、管理画像模板并读取用户画像,以及导出 Skill 记忆。
44

55
- [能力矩阵](cli-matrix.md):13 个命令、适用对象、参数范围、API 映射及尚未开放的能力。
6+
- [详细能力矩阵](memory-cli-matrix.md):面向维护者的参数、约束、输出与风险清单。
67
- [用户技术指南](user-guide.md):从配置到写入、检索、画像、Skill 和脚本集成的完整流程。
78
- [完整参数参考](../../skills/bailian-cli/reference/memory.md):根据命令元数据自动生成。
89

9-
本文档按 **2026-09-22 当前工作区源码**整理,包版本字段为 `1.23.0`,包含尚未提交的 Memory 改动;不代表同版本 npm 包已包含全部能力。使用前以本机 `bl memory --help` 及子命令 `--help` 核对。
10+
本文档按 **2026-09-22 当前工作区源码**整理,包版本字段为 `2.0.0`,包含尚未提交的 Memory 改动;不代表同版本 npm 包已包含全部能力。使用前以本机 `bl memory --help` 及子命令 `--help` 核对。
1011

1112
维护者可参阅 [后端接口对齐稿](2026-09-20-memory-backend-api.md) 和 [2026-09-21 后端实测记录](2026-09-21-memory-live-verify.md)。历史实测针对 HTTP API,不等同于本次 CLI 端到端验证;内部接口也不构成 CLI 对外承诺。

‎docs/memory/memory-cli-matrix.md‎

Lines changed: 27 additions & 28 deletions
Large diffs are not rendered by default.

‎docs/memory/user-guide.md‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,15 @@ bl memory add --user-id demo_user \
9797

9898
默认 `--wait 120`,轮询间隔为 3 秒;这是轮询预算,不是整个进程的严格时间上限。
9999

100-
| 状态 | 含义与处理 |
101-
| ------------------- | --------------------------------------------- |
102-
| PENDING / RUNNING | 尚未结束,继续轮询 |
103-
| SUCCEEDED / SUCCESS | 成功终态,检查 result;空数组可能表示没有变化 |
104-
| UNRECORDED | 终态,CLI 展示状态;不能当作已写入成功 |
105-
| FAILED | 失败终态;CLI 输出结果并以非零状态退出 |
100+
| 状态 | 含义与处理 |
101+
| ---------- | ----------------------------------------------------- |
102+
| PENDING | 等待处理,继续轮询 |
103+
| RUNNING | 正在执行,继续轮询 |
104+
| SUCCEEDED | 已实测的成功终态;检查 result,空数组可能表示没有变化 |
105+
| UNRECORDED | 终态,CLI 展示状态;不能当作已写入成功 |
106+
| FAILED | 失败终态;CLI 输出结果并以非零状态退出 |
107+
108+
通常的状态变化为 `PENDING → RUNNING → SUCCEEDED`,轮询时不一定能观察到每个阶段。CLI 还兼容 `SUCCESS` 作为成功状态的拼写;这不是另一个执行阶段,也不表示它是当前后端已验证的标准返回值。
106109

107110
提交的 `event_id` 不是节点 ID。一个事件可以包含多项任务;轮询等待全部任务到达终态。存在部分失败时,成功部分可能已经落地,应逐项检查。
108111

@@ -223,6 +226,8 @@ bl memory profile update --schema-id '<profile-schema-id>' \
223226
--plan-version pro --extract-scene intelligent --output json
224227
```
225228

229+
这里的 attribute 是模板字段(如“城市”),value 是用户的具体值(如“杭州”)。当前更新模板仍使用 `--attributes-operations`,创建模板使用 `--attributes`;两者分别接收操作数组和定义数组。
230+
226231
属性 op 使用小写 `add` / `update` / `delete`。add 必须有 name;update/delete 必须有从 `profile show` 获取的 attribute_id。`profile update` 修改模板,不是直接编辑某个用户的画像值。模板更新也不应被当作历史数据自动重抽取的保证。
227232

228233
删除整个模板前确认依赖范围;它会影响使用该模板的用户画像访问,不是清空单个用户画像:

‎packages/cli/src/commands.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import {
2828
memoryList,
2929
memoryUpdate,
3030
memoryDelete,
31+
memoryNodeShow,
32+
memorySkillExport,
3133
memoryProfileCreate,
3234
memoryProfileList,
3335
memoryProfileShow,
@@ -306,6 +308,8 @@ export const commands: Record<string, AnyCommand> = {
306308
"memory list": memoryList,
307309
"memory update": memoryUpdate,
308310
"memory delete": memoryDelete,
311+
"memory node show": memoryNodeShow,
312+
"memory skill export": memorySkillExport,
309313
"memory profile create": memoryProfileCreate,
310314
"memory profile list": memoryProfileList,
311315
"memory profile show": memoryProfileShow,

0 commit comments

Comments
 (0)