事件 API(Events API)
POST /v1/users/:user_id/streams/:stream_id/events
将原始事件存入 L0 事件流(Event Stream)。
此路由的用途
当你需要在 Memorose 将源材料转化为持久记忆之前,先将其追加写入时,使用此路由。 典型用途:- 对话轮次
- 工具输出
- 结构化 JSON 载荷
- 图像、音频或视频引用
- 任务相关的执行事件
请求
请求字段
| Field | Type | Required | 描述 |
|---|---|---|---|
content | string | Yes | 事件载荷 |
content_type | string | No | text、image、audio、video 或 json |
org_id | string | No | 组织范围 |
level | number | No | 存储在元数据中的目标层级提示 |
parent_id | string | No | 存储在元数据中的父对象引用 |
task_status | string | No | 存储在元数据中的任务状态提示 |
task_progress | number | No | 存储在元数据中的任务进度提示 |
响应
实用说明
stream_id是 UUID 路径参数。- 当
content_type为"json"时,content必须是 JSON 字符串载荷。 - 此路由追加写入
L0;持久化的L1或L2记忆将在后续的整合(Consolidation)和反思(Reflection)过程中生成。 - 写入请求发送到当前 Leader 节点。非 Leader 节点会在可能时转发写入。