SearchMemories

Updated at:

Searches memories based on query conditions and filters.

Operation description

This topic provides an example on how to configure the Settings for a threshold-based alert rule for the cpu_total metric of the i-uf6j91r34rnwawoo**** instance in the acs_ecs_dashboard namespace of Elastic Computing Service (ECS) server. The alert contact group for the alert rule is ECS_Group, the alert rule name is test123, the alert rule ID is a151cd6023eacee2f0978e03863cc1697c89508****, the statistical method for the Critical level is Average, the comparison operator for the Critical level is GreaterThanOrEqualToThreshold, the threshold for the Critical level is 90, and the number of alert retry attempts for the Critical level is 3.

Note

On August 15, 2024, Statistics validation is increased. The statistical value can only be the Statistics corresponding to the metric. For more information about how to obtain the value of this parameter, see Alibaba Cloud service monitoring metrics.

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:SearchMemories

list

*MemoryStore

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

None None

Request syntax

POST /workspace/{workspace}/memorystore/{memoryStoreName}/memory/search 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.

qianyi_test_1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

query

string

No

The query content.

What I like

userId

string

No

The user ID.

test_session_001

topK

integer

No

The top-K entries to return.

1

agentId

string

No

The agent ID.

972772996913709056

appId

string

No

The AppKey of the project assigned to the merchant.

mm_480d961a1b5e4efe84603f4cbc0f

runId

string

No

The run ID.

test_session_001

rerank

boolean

No

Specifies whether to rerank.

true

filters

object

No

The filter conditions.

any

No

The filter conditions.

{"__strategy_type__":"Fact"}

threshold

number

No

The similarity threshold.

0.3

retrievalOption

string

No

The retrieval options.

reranker,llm_rank

searchType

string

No

The query type.

experience

Response elements

Element

Type

Description

Example

object

The response data.

results

array<object>

The returned results.

array<object>

The returned results.

actorId

string

The actor ID.

test_session_001

agentId

string

The agent ID of the application.

972772996913709056

createdAt

string

The creation time.

1762773128968

hash

string

The memory hash value.

d791bf27236c5532056a13279baad3517042bb8d5b1bdb02e7871fa632debffe

id

string

The memory ID.

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

memory

string

The memory.

My name is Zhang San and I live in Hangzhou.

metadata

object

The metadata.

{"__strategy_type__":"Fact"}

any

The metadata.

{"__strategy_type__":"Fact"}

role

string

The role that initiated the message.

user

runId

string

The run ID.

test_session_001

score

number

The similarity score.

13.21

updatedAt

string

The update time.

1764902557784

userId

string

The user ID.

test_session_001

relations

array<object>

The relationships.

object

The relationships.

destination

string

The destination.

test

relationship

string

The relationships.

test

source

string

The source.

todo_open_dingoj06pvqfeayy3lkr

requestId

string

The request ID.

0CEC5375-C554-562B-A65F-9A629907C1F0

Examples

Success response

JSON format

{
  "results": [
    {
      "actorId": "test_session_001",
      "agentId": "972772996913709056",
      "createdAt": "1762773128968",
      "hash": "d791bf27236c5532056a13279baad3517042bb8d5b1bdb02e7871fa632debffe",
      "id": "019ca1e5-7307-7d50-b943-5e628326a8ed",
      "memory": "My name is Zhang San and I live in Hangzhou.",
      "metadata": {
        "key": "{\"__strategy_type__\":\"Fact\"}"
      },
      "role": "user",
      "runId": "test_session_001",
      "score": 13.21,
      "updatedAt": "1764902557784",
      "userId": "test_session_001"
    }
  ],
  "relations": [
    {
      "destination": "test",
      "relationship": "test",
      "source": "todo_open_dingoj06pvqfeayy3lkr"
    }
  ],
  "requestId": "0CEC5375-C554-562B-A65F-9A629907C1F0"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.