Graph API
POST /v1/users/:user_id/graph/edges
在两个记忆对象之间创建一条图谱边。
请求
POST /v1/users/user_123/graph/edges
Authorization: Bearer <token>
Content-Type: application/json
{
"source_id": "11111111-1111-1111-1111-111111111111",
"target_id": "22222222-2222-2222-2222-222222222222",
"relation": "RelatedTo",
"weight": 0.8
}
字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
source_id | UUID | 是 | 源记忆或任务节点 |
target_id | UUID | 是 | 目标记忆或任务节点 |
relation | string | 是 | 关系类型 |
weight | number | 否 | 可选权重 |
返回
{
"status": "accepted"
}
支持的关系类型
Next、RelatedTo、Contradicts、Supports、Abstracts、DerivedFrom、CausedBy、EvolvedTo、IsSubTaskOf、Blocks、Accomplishes