retrieve_memory_records
async
¶
retrieve_memory_records(
memory_id: MemoryId,
search_criteria: SearchCriteria,
*,
config_overrides: Optional[AsyncBedrockAgentCoreClientConfig] = None,
namespace: Optional[Namespace] = None,
namespace_path: Optional[Namespace] = None,
next_token: Optional[PaginationToken] = None,
max_results: Optional[MaxResults] = None,
) -> 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:
-
memory_id(MemoryId) –The identifier of the AgentCore Memory resource from which to retrieve memory records.
-
namespace(Optional[Namespace], default:None) –The namespace prefix to filter memory records by. Searches for memory records in namespaces that start with the provided prefix. Either
namespaceornamespacePathis required. -
namespace_path(Optional[Namespace], default:None) –Use namespacePath for hierarchical retrievals. Return all memory records where namespace falls under the same parent hierarchy. Either
namespaceornamespacePathis required. -
search_criteria(SearchCriteria) –The search criteria to use for finding relevant memory records. This includes the search query, memory strategy ID, and other search parameters.
-
next_token(Optional[PaginationToken], default: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.
-
max_results(Optional[MaxResults], default:None) –The maximum number of results to return in a single call. The default value is 20.
Raises:
-
AccessDeniedException–The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.
-
InvalidInputException–The input fails to satisfy the constraints specified by AgentCore. Check your input values and try again.
-
ResourceNotFoundException–The exception that occurs when the specified resource does not exist. This can happen when using an invalid identifier or when trying to access a resource that has been deleted.
-
ServiceException–The service encountered an internal error. Try your request again later.
-
ServiceQuotaExceededException–The exception that occurs when the request would cause a service quota to be exceeded. Review your service quotas and either reduce your request rate or request a quota increase.
-
ThrottledException–The request was denied due to request throttling. Reduce the frequency of requests and try again.
-
ValidationException–The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agentcore/_services/async_bedrock_agent_core.py
4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 | |