Skip to content

start_memory_extraction_job

start_memory_extraction_job(
    memory_id: MemoryId,
    extraction_job: ExtractionJob,
    *,
    config_overrides: Optional[BedrockAgentCoreClientConfig] = None,
    client_token: Optional[str] = None,
) -> StartMemoryExtractionJobOutput

Starts a memory extraction job that processes events that failed extraction previously in an AgentCore Memory resource and produces structured memory records. When earlier extraction attempts have left events unprocessed, this job will pick up and extract those as well.

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

Parameters:

  • memory_id (MemoryId) –

    The unique identifier of the memory for which to start extraction jobs.

  • extraction_job (ExtractionJob) –

    Extraction job to start in this operation.

  • client_token (Optional[str], default: None ) –

    A unique, case-sensitive identifier to ensure idempotent processing of the request.

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.

  • 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
def start_memory_extraction_job(
    self,
    memory_id: "capo_bedrock_agentcore.types.memory_id.MemoryId",
    extraction_job: "capo_bedrock_agentcore.types.extraction_job.ExtractionJob",
    *,
    config_overrides: Optional[BedrockAgentCoreClientConfig] = None,
    client_token: Optional[str] = None,
) -> "capo_bedrock_agentcore.types.start_memory_extraction_job_output.StartMemoryExtractionJobOutput":
    """<p> Starts a memory extraction job that processes events that failed extraction previously in an AgentCore Memory resource and produces structured memory records. When earlier extraction attempts have left events unprocessed, this job will pick up and extract those as well. </p> <p>To use this operation, you must have the <code>bedrock-agentcore:StartMemoryExtractionJob</code> permission.</p>

    Args:
        memory_id: <p>The unique identifier of the memory for which to start extraction jobs.</p>
        extraction_job: <p>Extraction job to start in this operation.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure idempotent processing of the request.</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_bedrock_agentcore.types.start_memory_extraction_job_input.StartMemoryExtractionJobInput]",
    ) -> OperationResponse[
        "capo_bedrock_agentcore.types.start_memory_extraction_job_output.StartMemoryExtractionJobOutput"
    ]:
        import capo_bedrock_agentcore._operations.amazon_bedrock_agent_core.start_memory_extraction_job

        output, http_response = (
            capo_bedrock_agentcore._operations.amazon_bedrock_agent_core.start_memory_extraction_job.start_memory_extraction_job(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartMemoryExtractionJob")
    )
    input_: capo_bedrock_agentcore.types.start_memory_extraction_job_input.StartMemoryExtractionJobInput = {
        "memory_id": memory_id,
        "extraction_job": extraction_job,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output