Reactive Machines

Programmatically building an IDP solution with Amazon Bedrock Data Automation

Intelligent Document Processing (IDP) is revolutionizing the way organizations handle unstructured document data, enabling the automatic extraction of valuable information from invoices, contracts, and reports. Today, we explore how to systematically create an IDP solution that uses the Strands SDK, Amazon Bedrock AgentCore, Amazon Bedrock Knowledge Base, and Bedrock Data Automation (BDA). This solution is provided with a Jupyter manual that allows users to load multi-case business documents and extract information using BDA as a filter to find relevant pieces and add information to the base model (FM). In this use case, our solution retrieves relevant context for public school districts from the National Report Card from the US Department of Education.

Amazon Bedrock Data Automation can be used as a standalone feature or as an analyzer when setting up a database for a Retrieval-Augmented Generation (RAG) workflow. BDA can be used to generate valuable information about unstructured, multidimensional content such as documents, images, video, and audio. With BDA, you can create automated IDP and RAG workflows, quickly and cost-effectively. In building your RAG workflow, you can use the Amazon OpenSearch Service to store vector embeddings of the required documents. In this post, Bedrock AgentCore uses BDA with tools to create a multi-instance RAG for IDP solution.

Amazon Bedrock AgentCore is something a fully managed service that allows you to build and configure independent agents. Developers can build and deploy agents using popular frameworks and a range of models including those from Amazon Bedrock, Anthropic, Google, and OpenAI all without managing the underlying infrastructure or writing custom code.

Strands Agents SDK is a sophisticated open source toolkit that revolutionizes artificial intelligence (AI) agent development in a model-driven way. Developers can create a Strands Agent with a notification (which defines the behavior of the agent) and a list of tools. A large-scale language model (LLM) performs reasoning, automatically determining appropriate actions and when tools to use based on context and task. This workflow supports complex systems, reducing the code typically required to orchestrate multi-agent interactions. The Strands SDK is used to create an agent and define the tools needed to perform intelligent document processing.

Follow the following requirements and step-by-step implementation to deploy the solution in your AWS environment.

What is required

To comply with the usage conditions of the example, set the following requirements:

Buildings

The solution uses the following AWS services:

  • Amazon S3 for document storage and uploading capabilities
  • Bedrock Knowledge The basics of converting objects stored in S3 into a RAG-ready workflow
  • Amazon OpenSearch vector embedding
  • Amazon Bedrock AgentCore for IDP workflows
  • Strands Agent SDK is an open source framework for defining IDP tools
  • Bedrock Data Automation (BDA) to extract structured information from your documents

Follow these steps to get started:

  1. Upload the relevant documents to Amazon S3
  2. Create an Amazon Bedrock Knowledge Base and isolate an S3 data source using Amazon Bedrock Data Automation.
  3. Document fragments are stored as vector embeddings in Amazon OpenSearch
  4. The Strands Agent included in the Amazon Bedrock AgentCore Runtime performs RAG to answer user queries.
  5. The end user receives the answer

Configure the AWS CLI

Use the following command to configure the AWS Command Line Interface (AWS CLI) with AWS credentials for your Amazon account and AWS Region. Before you get started, check out AWS Bedrock Data Automation for regional availability and pricing:

Clone and build a GitHub repository locally

git clone 
cd sample-for-amazon-bda-agents

Open a Jupyter notebook named:

bedrock-data-automation-with-agents.ipynb

Bedrock Data Automation with AgentCore Notebook instructions:

This notebook shows how to create an IDP solution using BDA with the Amazon Bedrock AgentCore Runtime. Instead of traditional Bedrock agents, we will use Strands Agent with AgentCore, providing enterprise-grade capabilities with framework flexibility. More specific instructions are included in the Jupyter manual. Here's an overview of how to set up Bedrock Knowledge Bases for data automation as an analyst with Bedrock AgentCore.

Steps:

  1. Import the libraries and set the AgentCore capabilities
  2. Create an Amazon Bedrock Knowledge Base with BDA
  3. Upload the study reports dataset to Amazon S3
  4. Deploy the Strands Agent using the AgentCore Runtime
  5. Check out the agent managed by AgentCore
  6. Clean all resources

Security considerations

The implementation uses several lines of defense such as:

  • Secure file upload management
  • Identity and Access Management (IAM) for role-based access control
  • Input validation and error handling

Note: This is used for demonstration purposes. Additional safety controls, inspections, and property reviews are required before shipping to the manufacturing facility.

Benefits and use cases

This solution is very important for:

  • Automated document processing workflow
  • Document-wise analysis of large-scale data sets
  • Question answering programs based on document content
  • Multimodal content processing

The conclusion

This solution shows how to use Amazon Bedrock AgentCore capabilities to build intelligent document processing applications. By building Strands Agents to support Amazon Bedrock Data Automation, we can build powerful applications that understand and interact with document content of many types using tools. With Amazon Bedrock Data Automation, we can improve RAG's knowledge of complex data formats including rich visual documents, images, audio, and video.

Additional resources

For more information, visit Amazon Bedrock.

Guidelines for Users of the Service:

Important Samples:


About the authors

Ryan Osman He is a Technical Account Manager at AWS and works closely with education technology customers based in North America. He has been with AWS for over 3 years and started his journey working as a Solutions Architect. Raian works closely with organizations to configure and secure workloads on AWS, while exploring new use cases for productive AI.

Andy Orlosky is a Strategic Pursuit Solutions Architect at Amazon Web Services (AWS) based out of Austin, Texas. He has been with AWS for about 2 years but has worked closely with Education customers across the public sector. As a leader in the AI/ML Technical Field Community, Andy continues to dive deep with his clients to design and scale productive AI solutions. He holds 7 AWS certifications and enjoys spending time with his family, playing sports with friends, and cheering on his favorite sports teams in his free time.

Spencer Harrison is a partner solutions architect at Amazon Web Services (AWS), where he helps public sector organizations leverage cloud technologies to focus on business outcomes. He is interested in using technology to improve processes and workflows. Spencer's interests outside of work include reading, pickleball, and personal finance.

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button