跳转到主要内容

图 API(Graph API)

POST /v1/users/:user_id/graph/edges

在两个记忆对象之间创建图边(Graph Edge)。

请求

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
}

字段

FieldTypeRequired描述
source_idUUIDYes源记忆或任务节点
target_idUUIDYes目标记忆或任务节点
relationstringYes关系类型
weightnumberNo可选的边权重

响应

{
  "status": "accepted"
}

支持的关系类型

NextRelatedToContradictsSupportsAbstractsDerivedFromCausedByEvolvedToIsSubTaskOfBlocksAccomplishes