将 Memory Store 挂载到指定的 Identity 和 Template。
把一个已存在的 Memory Store 挂载到指定
Identity 级 Service Account Token 只能操作自己所属的 identity,操作其他 identity 返回
HTTP 200 OK
返回 Memory Store 挂载对象。
挂载多个 Store 后,Agent 看到的记忆是所有 Store 按
(identity, template)。挂载后,该 identity 用此 template 创建的 Session 会自动获得这个 Store 的记忆内容。
显式挂载的 Store 一律为 read_only。同一 (identity, template) 最多挂载 10 个显式 Store(不含系统默认库槽位)。
重复挂载幂等:对同一 Store 重复调用返回已存在的挂载记录,created_at 保持首次挂载时间不变。
路径
POST /api/v1/forward/identities/{identity_id}/templates/{template_id}/memory_stores
请求头
| 头部 | 必选 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <PAT、admin SAT 或该 identity 的 SAT> |
Content-Type | 是 | application/json |
403。
路径参数
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
identity_id | string | 是 | Identity ID(idn_...)。 |
template_id | string | 是 | Template ID(tmpl_...)。 |
请求体
| 字段 | 类型 | 必选 | 说明 |
|---|---|---|---|
memory_store_id | string | 是 | 要挂载的 Memory Store ID(memstore_...)。必须是当前调用方可见的 active Store。 |
示例请求
示例响应
HTTP 200 OK
响应字段解释
返回 Memory Store 挂载对象。
注意事项
挂载多个 Store 后,Agent 看到的记忆是所有 Store 按 path 合并的扁平命名空间,相同 path 会相互遮蔽。详见 在 Session 中的可见形态。
错误码
| HTTP | type | 触发条件 |
|---|---|---|
| 400 | invalid_request_error | memory_store_id 缺失、Store 已归档,或该 (identity, template) 显式挂载数已达上限 10。 |
| 401 | authentication_error | 缺少或无效的认证令牌。 |
| 403 | permission_error | Identity 级 SAT 试图操作其他 identity。 |
| 404 | not_found_error | Identity、Template 或 Memory Store 不存在或不可见。 |
| 500/502/503 | api_error | Forward 或依赖服务失败。 |