Creates a memory node.
Debug
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
Debug
RAM authorization
The following table describes the authorization information of the API. You can use it in the Action element of a RAM permission policy statement to grant RAM users or RAM roles the permission to call this API. The details are as follows:
- Action: the specific permission point.
- Access level: the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: the resource types that support authorization for the operation. The details are as follows:
- For required resource types, an asterisk (*) is prefixed.
- For operations that do not support resource-level authorization,
All Resourcesis used.
- Condition key: the condition keys defined by the cloud service itself.
- Dependent action: other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions before the operation can succeed.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| sfm:CreateMemoryNode | create | *All Resources * |
| None |
Request syntax
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| workspaceId | string | No | The ID of the workspace to which the long-term memory belongs. For information about how to obtain the workspace ID, see How to use workspaces. | llm-us9hjmt32nysdm5v |
| memoryId | string | Yes | The long-term memory ID, that is, the | 6bff4f317a14442fbc9f73d29dbd5fc3 |
| content | string | Yes | The memory node content. The length is 1~200 characters. Chinese, English, digits, underscores (_), hyphens (-), periods (.), and colons (:) are supported. | The user likes to eat tomato and egg stir-fry |
Response parameters
| Element | Type | Description | Example |
|---|---|---|---|
| object | Schema of Response | ||
| memoryNodeId | string | The memory node ID. | 68de06c95368463a8be4a84efcxxxxxx |
| requestId | string | The request ID. | 8C56C7AF-xxxx-19CE-B018-E05E1EDCF4C5 |
Examples
Success response
JSON format
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | Memory.MemoryNodeContentInvalid | Memory node content is invalid. | The memory node content is invalid. |
| 404 | Memory.MemoryIdNotFound | Memory Id not exist or is not authorized. | memoryId not found |
| 404 | Memory.MemoryNodeNotFound | MemoryNode not found. | Memory node not found |
| 500 | Memory.InternalError | Memory service inner exception. | Internal error of the long-term memory service. |