retrieve_memory_records
¶
retrieve_memory_records(
memory_id: MemoryId,
search_criteria: SearchCriteria,
*,
config_overrides: Optional[BedrockAgentCoreClientConfig] = 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/bedrock_agent_core.py
4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 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 | |