GetMemoryHistory

Updated at:

Retrieves the memory history.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cms:GetMemoryHistory

get

*MemoryStore

acs:cms:{#regionId}:{#accountId}:workspace/{#WorkspaceName}/memorystore/{#MemoryStoreName}

None None

Request syntax

GET /workspace/{workspace}/memorystore/{memoryStoreName}/memory/{memoryId}/history HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

workspace

string

Yes

The workspace name.

workspace-test

memoryStoreName

string

Yes

The memory store name.

test-memory-store

memoryId

string

Yes

The memory ID.

019ca1e5-7307-7d50-b943-5e628326a8ed

Request parameters

Parameter

Type

Required

Description

Example

No parameters required.

Response elements

Element

Type

Description

Example

object

The response data.

requestId

string

The request ID.

3B311FD9-A60B-55E0-A896-A0C73*********

results

array<object>

The results.

array<object>

The results.

id

string

The memory ID.

b25d6ad7-306f-4040-9890-4dddd2505a2e

memoryId

string

The memory ID.

019cacf6-7b39-7f61-8314-548f07ca449a

input

array<object>

The original message.

object

The message.

role

string

The role of the message sender.

user

content

string

The message content.

My name is Zhang San and I live in Hangzhou.

newMemory

string

The new memory.

I really like Python.

userId

string

The user ID.

test_session_001

event

string

The event type.

ADD

createdAt

string

The creation time.

1764556182850

updatedAt

string

The update time.

1771036123785

oldMemory

string

The old memory.

I really don't like Python at all.

metadata

object

The metadata.

{"sessionId":"test_session_001"}

Examples

Success response

JSON format

{
  "requestId": "3B311FD9-A60B-55E0-A896-A0C73*********",
  "results": [
    {
      "id": "b25d6ad7-306f-4040-9890-4dddd2505a2e",
      "memoryId": "019cacf6-7b39-7f61-8314-548f07ca449a",
      "input": [
        {
          "role": "user",
          "content": "My name is Zhang San and I live in Hangzhou."
        }
      ],
      "newMemory": "I really like Python.",
      "userId": "test_session_001",
      "event": "ADD",
      "createdAt": "1764556182850",
      "updatedAt": "1771036123785",
      "oldMemory": "I really don't like Python at all.",
      "metadata": {
        "sessionId": "test_session_001"
      }
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.