Intelligent Automation
Build Intelligent Document Processing Workflow
This lab guides you in creating an Intelligent Document Processing (IDP) system that automates document extraction and data processing using webhooks. You will integrate OCR, NLP, and real-time webhook triggers to enable seamless document handling and workflow automation.
Use case:
Build Intelligent Document processing powered by Amazon Textract and Amazon Bedrock.
Pre-requisites
S3 bucket with Purchase order sample.
Step 1 - Build Prompts in Prompt Playground.
Using Prompt Playground, create a PO (Purchase Order) extraction prompt to extract metadata from the purchase order using the prompt template “PO Extractor”
Rename and Save the prompt.
In the Test & Compare tab, choose the preferred models, assess their outputs, and identify the most optimal model. Subsequently, click "Select as Best Answer" to designate it as the Primary Model. Additionally, if necessary, you may assign an alternative model as the Fallback Model. However, selecting a Primary Model is mandatory.
Click "Save prompt run" button provided at the right corner.
Save and Publish the prompt.
Next create an agent prompt using prompt playground with the Webhook Notify Agent template.
Refer "Webhook Notify Agent" prompt to enter Agent input.
Save the prompt. After saving the prompt, the Tool tab becomes visible within the prompt.
Add Message Tool with Email with the credentials.
In the Test & Compare tab, choose the preferred models, assess their outputs, and identify the most optimal model. Subsequently, click "Select as Best Answer" to designate it as the Primary Model. Additionally, if necessary, you may assign an alternative model as the Fallback Model. However, selecting a Primary Model is mandatory.
Click "Save prompt run" button provided at the right corner.
Save and publish the prompt
Step 2: Build Agent 2.0 Recipe.
Create a new Recipe with the type “Agent 2.0.”
Use the following nodes to create the recipe.
Webhook (Copy Token in your notepad to be used later).
Connector (Use Amazon S3).
Processing (Select Amazon Textract with Extract Layouts,Extract Tables settings).
Start
Prompt (Select the Extract PO prompt created in Step 1).
Enter the label as PO Extractor.
Select the Document cache setting as “Ephemeral.”
Select the “Messages” setting as “Last Message”.
Agent(Select the Webhook Notify Agent).
Enter the label as Webhook Notify Agent.
Select the Document cache setting as “Ephemeral.”
Select the “Messages” setting as “Last Message”
End
Save and Publish the recipe.
Step 3: Send an API request to initiate the workflow.
To initiate the processing of a purchase order
Retrieve a webhook request by ID.
3. Retrieve webhooks by recipe and filters.
Go to https://app.karini.ai/recipe , Click “Actions” next to your recipe, and click “Webhook History.”
Observe the Webhook history messages and observe Traces
Sample resources
Prompt:
PO Extractor
Webhook Notify Agent
Recipe: IDP
Refer following video to create recipe.
Last updated