GET /memory

列出记忆条目。支持按层过滤、分页。

GET /cells/{cellID}/memory

认证

Authorization: Bearer $TOKEN

查询参数

参数类型必填默认值说明
layerstring否—按层过滤:environment / consensus / about_me / agent_memory / session / working / unknown
namespacestring否—按命名空间过滤
kindstring否—按类别过滤:preference / fact / constraint 等
limitint否20每页条数
offsetint否0分页偏移量
actorstring否—指定 actor 过滤。仅 admin token 有效,非 admin 一律取 token 中的 actor

请求示例

列出 about_me 层的前 20 条记忆:

curl "http://localhost:9091/cells/dept-legal/memory?layer=about_me&limit=20&offset=0" \
  -H "Authorization: Bearer $TOKEN"

列出 agent_memory 层中指定命名空间的条目:

curl "http://localhost:9091/cells/dept-legal/memory?layer=agent_memory&namespace=agent-coder&limit=50" \
  -H "Authorization: Bearer $TOKEN"

响应

成功(200 OK)

[
  {
    "id": "mem-abc123",
    "layer": "about_me",
    "kind": "preference",
    "content": "我喜欢使用 Vim 键位的编辑器",
    "namespace": "",
    "actor": "alice",
    "created_at": "2026-09-20T10:30:00Z",
    "accessed_at": "2026-09-21T08:15:00Z"
  },
  {
    "id": "mem-def456",
    "layer": "about_me",
    "kind": "fact",
    "content": "我负责法务合同审查工作",
    "namespace": "",
    "actor": "alice",
    "created_at": "2026-09-19T14:00:00Z",
    "accessed_at": "2026-09-20T16:45:00Z"
  }
]

条目字段

字段类型说明
idstring条目唯一 ID
layerstring所属层
kindstring记忆类别
contentstring记忆内容
namespacestring命名空间
actorstring归属 actor
created_atstring创建时间(RFC 3339)
accessed_atstring最近访问时间(RFC 3339)

注意事项

错误码

HTTP错误说明
400ErrMemoryLayerScopeConflictlayer 和 scope 同时给出
400ErrUnknownLayer不认识的层名
401—Token 缺失或无效
403—Token 权限不足

相关端点