Skip to content

retrieve_memory_records

Operation

retrieve_memory_records

retrieve_memory_records(request: RetrieveMemoryRecordsInput | RetrieveMemoryRecordsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[RetrieveMemoryRecordsInputDict]) -> RetrieveMemoryRecordsOutput

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.

Parameters:

Name Type Description Default
request RetrieveMemoryRecordsInput | RetrieveMemoryRecordsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[RetrieveMemoryRecordsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
RetrieveMemoryRecordsOutput

An instance of RetrieveMemoryRecordsOutput.

retrieve_memory_records async

retrieve_memory_records(request: RetrieveMemoryRecordsInput | RetrieveMemoryRecordsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[RetrieveMemoryRecordsInputDict]) -> RetrieveMemoryRecordsOutput

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.

Parameters:

Name Type Description Default
request RetrieveMemoryRecordsInput | RetrieveMemoryRecordsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[RetrieveMemoryRecordsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
RetrieveMemoryRecordsOutput

An instance of RetrieveMemoryRecordsOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

RetrieveMemoryRecordsInputDict

Bases: TypedDict

Dictionary form of RetrieveMemoryRecordsInput.

Attributes

max_results instance-attribute
max_results: int | None

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

memory_id instance-attribute
memory_id: Required[str]

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

namespace instance-attribute
namespace: str | None

The exact namespace to filter memory records by. Searches for memory records that matches the provided namespace value. Either namespace or namespacePath is required.

namespace_path instance-attribute
namespace_path: str | None

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

next_token instance-attribute
next_token: str | None

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.

search_criteria instance-attribute

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

RetrieveMemoryRecordsInput dataclass

Bases: _SerdeShape

Dataclass for RetrieveMemoryRecordsInput structure.

Attributes

max_results class-attribute instance-attribute
max_results: int = ...

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

memory_id class-attribute instance-attribute
memory_id: str | None = ...

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

namespace class-attribute instance-attribute
namespace: str | None = ...

The exact namespace to filter memory records by. Searches for memory records that matches the provided namespace value. Either namespace or namespacePath is required.

namespace_path class-attribute instance-attribute
namespace_path: str | None = ...

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

next_token class-attribute instance-attribute
next_token: str | None = ...

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.

search_criteria class-attribute instance-attribute
search_criteria: SearchCriteria | None = ...

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

Output

RetrieveMemoryRecordsOutput dataclass

Bases: _SerdeShape

Dataclass for RetrieveMemoryRecordsOutput structure.

Attributes

memory_record_summaries instance-attribute
memory_record_summaries: list[MemoryRecordSummary]

The list of memory record summaries that match the search criteria, ordered by relevance.

next_token class-attribute instance-attribute
next_token: str | None = ...

The token to use in a subsequent request to get the next set of results. This value is null when there are no more results to return.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.