> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ariacompute.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 新增记忆边 - POST /v1/workspaces/:workspace_id/cubes/:cube_id/edges

> 通过 POST /v1/workspaces/:workspace_id/cubes/:cube_id/edges 在节点间连一条带关系的边。最小角色 contributor。

在记忆立方体的两个节点之间连一条带关系与权重的边，构建记忆图谱。

## 接口

```http theme={null}
POST /v1/workspaces/:workspace_id/cubes/:cube_id/edges
```

## 认证

`Authorization: Bearer <jwt>` 或 `X-API-Key <sk_...>`。最小角色：**contributor**。

## 路径参数

<ParamField path="workspace_id" type="string" required>
  工作空间 id。
</ParamField>

<ParamField path="cube_id" type="string" required>
  立方体 id。
</ParamField>

## 请求体

<ParamField body="from" type="string" required>
  起始节点 id。
</ParamField>

<ParamField body="to" type="string" required>
  目标节点 id。
</ParamField>

<ParamField body="relation" type="string">
  关系标签（如 `related_to`、`causes`）。
</ParamField>

<ParamField body="weight" type="number">
  边权重。
</ParamField>

## 响应

<ResponseField name="added" type="boolean">
  是否为 true（已添加）。
</ResponseField>

## 示例

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://memo.ariacompute.cn/v1/workspaces/ws_01a2b3c4d5e6/cubes/cube_01a2b3c4d5e6/edges \
    -H "Authorization: Bearer <jwt>" \
    -H "Content-Type: application/json" \
    -d '{"from":"node_aa","to":"node_bb","relation":"related_to","weight":0.9}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "added": true
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.