Skip to content

Retrieve Memory Records

bedrockagentcore_retrieve_memory_records R Documentation

Searches for and retrieves memory records from an AgentCore Memory resource based on specified search criteria

Description

Searches for and retrieves memory records from an AgentCore Memory resource based on specified search criteria. We recommend using pagination to ensure that the operation returns quickly and successfully.

To use this operation, you must have the bedrock-agentcore:RetrieveMemoryRecords permission.

Usage

bedrockagentcore_retrieve_memory_records(memoryId, namespace,
  namespacePath, searchCriteria, nextToken, maxResults)

Arguments

memoryId

[required] The identifier of the AgentCore Memory resource from which to retrieve memory records.

namespace

The namespace prefix to filter memory records by. Searches for memory records in namespaces that start with the provided prefix. Either namespace or namespacePath is required.

namespacePath

Use namespacePath for hierarchical retrievals. Return all memory records where namespace falls under the same parent hierarchy. Either namespace or namespacePath is required.

searchCriteria

[required] The search criteria to use for finding relevant memory records. This includes the search query, memory strategy ID, and other search parameters.

nextToken

The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

maxResults

The maximum number of results to return in a single call. The default value is 20.

Value

A list with the following syntax:

list(
  memoryRecordSummaries = list(
    list(
      memoryRecordId = "string",
      content = list(
        text = "string"
      ),
      memoryStrategyId = "string",
      namespaces = list(
        "string"
      ),
      createdAt = as.POSIXct(
        "2015-01-01"
      ),
      score = 123.0,
      metadata = list(
        list(
          stringValue = "string",
          stringListValue = list(
            "string"
          ),
          numberValue = 123.0,
          dateTimeValue = as.POSIXct(
            "2015-01-01"
          )
        )
      )
    )
  ),
  nextToken = "string"
)

Request syntax

svc$retrieve_memory_records(
  memoryId = "string",
  namespace = "string",
  namespacePath = "string",
  searchCriteria = list(
    searchQuery = "string",
    memoryStrategyId = "string",
    topK = 123,
    metadataFilters = list(
      list(
        left = list(
          metadataKey = "string"
        ),
        operator = "EQUALS_TO"|"EXISTS"|"NOT_EXISTS"|"BEFORE"|"AFTER"|"CONTAINS"|"GREATER_THAN"|"GREATER_THAN_OR_EQUALS"|"LESS_THAN"|"LESS_THAN_OR_EQUALS",
        right = list(
          metadataValue = list(
            stringValue = "string",
            stringListValue = list(
              "string"
            ),
            numberValue = 123.0,
            dateTimeValue = as.POSIXct(
              "2015-01-01"
            )
          )
        )
      )
    )
  ),
  nextToken = "string",
  maxResults = 123
)