GET /memory/{id}
通过 ID 获取一条记忆条目的完整信息。
GET /cells/{cellID}/memory/{id}
认证
Authorization: Bearer $TOKEN
路径参数
| 参数 | 类型 | 必填 | 说明 |
|---|
cellID | string | ✅ | Cell ID |
id | string | ✅ | 记忆条目 ID |
查询参数
| 参数 | 类型 | 必填 | 说明 |
|---|
actor | string | 否 | 仅 admin token 有效,非 admin 一律取 token 中的 actor |
请求示例
curl "http://localhost:9091/cells/dept-legal/memory/mem-abc123" \
-H "Authorization: Bearer $TOKEN"
响应
成功(200 OK)
{
"id": "mem-abc123",
"layer": "about_me",
"kind": "preference",
"content": "我喜欢使用 Vim 键位的编辑器",
"namespace": "",
"actor": "alice",
"key": "",
"trust": 3,
"created_at": "2026-09-20T10:30:00Z",
"accessed_at": "2026-09-21T08:15:00Z",
"recall_count": 5
}
响应字段
| 字段 | 类型 | 说明 |
|---|
id | string | 条目唯一 ID |
layer | string | 所属层 |
kind | string | 记忆类别 |
content | string | 记忆内容 |
namespace | string | 命名空间 |
actor | string | 归属 actor |
key | string | 去重键 |
trust | int | 信任等级 |
created_at | string | 创建时间(RFC 3339) |
accessed_at | string | 最近访问时间(RFC 3339) |
recall_count | int | 被召回次数 |
未找到(404 Not Found)
{
"error": "not_found",
"message": "memory entry not found"
}
注意事项
- 不存在与不属于你同返 404。记忆 ID 会随导出与分享链接流出,一次读取不配得到"它确实存在"这个确认。这是刻意的安全设计,不是 bug。
- 与
DELETE /memory/{id} 对"不是你的"返回 403 故意不同——详见删除记忆。
错误码
| HTTP | 错误 | 说明 |
|---|
| 404 | — | 条目不存在,或不属于当前 actor(两者不区分) |
| 401 | — | Token 缺失或无效 |
| 403 | — | Token 权限不足 |
相关端点