Skip to content

delete_memory_record async

delete_memory_record(
    memory_id: MemoryId,
    memory_record_id: MemoryRecordId,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreClientConfig] = None,
    namespace: Optional[Namespace] = None,
) -> DeleteMemoryRecordOutput

Deletes a memory record from an AgentCore Memory resource. When you delete a memory record, it is permanently removed.

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

Parameters:

  • memory_id (MemoryId) –

    The identifier of the AgentCore Memory resource from which to delete the memory record.

  • memory_record_id (MemoryRecordId) –

    The identifier of the memory record to delete.

  • namespace (Optional[Namespace], default: None ) –

    The namespace of the memory record to delete. This value is used for IAM condition key authorization.

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
async def delete_memory_record(
    self,
    memory_id: "capo_bedrock_agentcore.types.memory_id.MemoryId",
    memory_record_id: "capo_bedrock_agentcore.types.memory_record_id.MemoryRecordId",
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreClientConfig] = None,
    namespace: Optional["capo_bedrock_agentcore.types.namespace.Namespace"] = None,
) -> "capo_bedrock_agentcore.types.delete_memory_record_output.DeleteMemoryRecordOutput":
    """<p>Deletes a memory record from an AgentCore Memory resource. When you delete a memory record, it is permanently removed.</p> <p>To use this operation, you must have the <code>bedrock-agentcore:DeleteMemoryRecord</code> permission.</p>

    Args:
        memory_id: <p>The identifier of the AgentCore Memory resource from which to delete the memory record.</p>
        memory_record_id: <p>The identifier of the memory record to delete.</p>
        namespace: <p>The namespace of the memory record to delete. This value is used for IAM condition key authorization.</p>

    Raises:
        capo_bedrock_agentcore.errors.access_denied_exception.AccessDeniedException: <p>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.</p>
        capo_bedrock_agentcore.errors.invalid_input_exception.InvalidInputException: <p>The input fails to satisfy the constraints specified by AgentCore. Check your input values and try again.</p>
        capo_bedrock_agentcore.errors.resource_not_found_exception.ResourceNotFoundException: <p>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.</p>
        capo_bedrock_agentcore.errors.service_exception.ServiceException: <p>The service encountered an internal error. Try your request again later.</p>
        capo_bedrock_agentcore.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>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.</p>
        capo_bedrock_agentcore.errors.throttled_exception.ThrottledException: <p>The request was denied due to request throttling. Reduce the frequency of requests and try again.</p>
        capo_bedrock_agentcore.errors.validation_exception.ValidationException: <p>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.</p>
        capo_bedrock_agentcore.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock_agentcore.types.delete_memory_record_input.DeleteMemoryRecordInput]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore.types.delete_memory_record_output.DeleteMemoryRecordOutput"
    ]:
        import capo_bedrock_agentcore._operations.amazon_bedrock_agent_core.delete_memory_record

        (
            output,
            http_response,
        ) = await capo_bedrock_agentcore._operations.amazon_bedrock_agent_core.delete_memory_record.async_delete_memory_record(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteMemoryRecord")
    )
    input_: capo_bedrock_agentcore.types.delete_memory_record_input.DeleteMemoryRecordInput = {
        "memory_id": memory_id,
        "memory_record_id": memory_record_id,
    }
    if namespace is not None:
        input_["namespace"] = namespace

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output