Skip to main content

ListMemoryNodes

Retrieves a list of memory nodes.

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

Authorization information

The following table describes the authorization information for this API. You can use it in the Action element of a RAM policy statement to grant RAM users or RAM roles the permission to call this API. 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. Details are as follows:
    • Required resource types are marked with a leading asterisk (*).
    • 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 also have the permissions of the dependent actions for the operation to succeed.
ActionAccess levelResource typeCondition keyDependent action
sfm:ListMemoryNodeslist
*All Resources
*
    None
None

Request syntax

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

Request parameters

NameTypeRequiredDescriptionExample value
workspaceIdstringYes

The workspace ID.

llm-us9hjmt32nysdm5v
memoryIdstringYes

The long-term memory ID.

6bff4f317a14442fbc9f73d29dbd5fc3
maxResultsintegerNo

The maximum number of results to return.

20
nextTokenstringNo

Returned by a previous request. If specified, the results of this request are paginated based on the previous request's results.

dc270401186b433f975d7e1faaa34e0e

Response parameters

NameTypeDescriptionExample value
object

Schema of Response

maxResultsinteger

The maximum number of results requested.

20
memoryNodesarray<object>

The array of memory nodes.

NodeListobject
contentstring

The content of the memory node.

The user likes to eat tomato and egg stir-fry
memoryNodeIdstring

The memory node ID.

68de06c95368463a8be4a84efc872cc5
nextTokenstring

The token used for token-based pagination.

dc270401186b433f975d7e1faaa34e0e
requestIdstring

The request ID.

6a71f2d9-f1c9-913b-818b-114029103cad
totalCountinteger

The total number of memory nodes.

100

Examples

Success response JSON format
{
  "maxResults": 20,
  "memoryNodes": [
    {
      "content": "用户喜欢吃西红柿炒鸡蛋\n",
      "memoryNodeId": "68de06c95368463a8be4a84efc872cc5"
    }
  ],
  "nextToken": "dc270401186b433f975d7e1faaa34e0e\n",
  "requestId": "6a71f2d9-f1c9-913b-818b-114029103cad\n",
  "totalCount": 100
}

Error codes

HTTP status codeError codeError messageDescription
400Memory.MaxResultsInvalidInput parameter maxResults is invalid.The input parameter maxResults is invalid.
400Memory.MemoryNodeContentInvalidMemory node content is invalid.The content of the long-term memory node is invalid.
400Memory.NextTokenInvalidInput parameter nextToken is invalid.The input parameter nextToken is invalid.
404Memory.MemoryIdNotFoundMemory Id not exist or is not authorized.memoryId not found.
404Memory.MemoryNodeNotFoundMemoryNode not found.Long-term memory node not found.
500Memory.InternalErrorMemory service inner exception.Internal exception of the long-term memory service.
For more error codes, visit the Error Center.