Skip to main content

CreateMemoryNode

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 Resources is 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.
ActionAccess levelResource typeCondition keyDependent action
sfm:CreateMemoryNodecreate
*All Resources
*
    None
None

Request syntax

POST /{workspaceId}/memories/{memoryId}/memoryNodes HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
workspaceIdstringNo

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
memoryIdstringYes

The long-term memory ID, that is, the memoryId returned by the CreateMemory operation.

6bff4f317a14442fbc9f73d29dbd5fc3
contentstringYes

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

ElementTypeDescriptionExample
object

Schema of Response

memoryNodeIdstring

The memory node ID.

68de06c95368463a8be4a84efcxxxxxx
requestIdstring

The request ID.

8C56C7AF-xxxx-19CE-B018-E05E1EDCF4C5

Examples

Success response JSON format
{
  "memoryNodeId": "68de06c95368463a8be4a84efcxxxxxx",
  "requestId": "8C56C7AF-xxxx-19CE-B018-E05E1EDCF4C5"
}

Error codes

HTTP status codeError codeError messageDescription
400Memory.MemoryNodeContentInvalidMemory node content is invalid.The memory node content is invalid.
404Memory.MemoryIdNotFoundMemory Id not exist or is not authorized.memoryId not found
404Memory.MemoryNodeNotFoundMemoryNode not found.Memory node not found
500Memory.InternalErrorMemory service inner exception.Internal error of the long-term memory service.
See the Error Center for more error codes.