Intelligent Document Processing (IDP) transforms the way organizations handle unstructured document data, helping to automatically extract valuable information from invoices, contracts and reports. Today, we’ll explore how to programmatically build an IdP solution that uses the Strands SDK, Amazon Bedrock AgentCore, Amazon Bedrock Knowledge Base, and Bedrock Data Automation (BDA). This solution is provided through Jupyter Notebooks that enable users to upload multi-model business documents and extract insights using BDA as a parser to retrieve relevant parts and extend a signal to a fundamental model (FM). In this use case, our solution retrieves relevant context for public school districts from the Nation’s Report Card from the US Department of Education.
Amazon Bedrock Data Automation can be used as a standalone feature or parser when setting up a knowledge base for Retrieval-Augmented Generation (RAG) workflows. BDA can be used to generate valuable insights from unstructured, multi-modal content such as documents, images, video, and audio. With BDA, you can quickly and cost-effectively create automated IDP and RAG workflows. In building your RAG workflow, you can use the Amazon OpenSearch service to store the vector embeddings of the required documents. In this post, Bedrock AgentCore uses BDA through tools to perform multi-modal RAG for an IDP solution.
Amazon Bedrock AgentCore Is A fully managed service that allows you to create and configure autonomous agents. Developers can build and deploy agents using a suite of popular frameworks and models, including Amazon Bedrock, Anthropic, Google, and OpenAI, 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 through a model-driven approach. Developers can create a Strands agent with a prompt (defining agent behavior) and a list of tools. A large language model (LLM) performs reasoning, autonomously deciding when to use optimal actions and tools based on the context and task. This workflow supports complex systems, reducing the code typically required to orchestrate multi-agent collaboration. The Strands SDK is used to define the tools needed to create agents and perform intelligent document processing.
Follow the following prerequisites and step-by-step implementation to deploy the solution in your own AWS environment.
Prerequisites
To follow the example use cases, set the following prerequisites:
architecture
The solution uses the following AWS services:
- Amazon S3 for document storage and upload capabilities
- Bedrock Knowledge Base for converting objects stored in S3 into RAG-ready workflows
- Amazon Open Search for vector embeddings
- Amazon Bedrock AgentCore for IDP Workflow
- Strands Agent SDK for open source framework of tools defined to execute IDP
- Bedrock Data Automation (BDA) to extract structured insights from your documents.
Follow these steps to get started:
- Upload relevant documents to Amazon S3
- Create an Amazon Bedrock knowledge base and parse the S3 data source using Amazon Bedrock Data Automation.
- Document fragments stored as vector embeddings in Amazon OpenSearch
- Amazon Bedrock AgentCore deploys Strands agent RAGs at runtime to respond to user queries.
- End user receives feedback
Configure AWS CLI
Use the following commands 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 region availability and pricing:
Clone and create a GitHub repository locally
Open Jupyter Notebook called:
Bedrock Data Automation with AgentCore Notebook Instructions:
This notebook demonstrates how to create an IdP solution using BDA with the Amazon Bedrock AgentCore runtime. Instead of traditional Bedrock agents, we will deploy a Strands agent through AgentCore, providing enterprise-grade capabilities with framework flexibility. Jupyter Notebooks include more specific instructions. Here’s an overview of how you can setup a Bedrock Knowledge Base with data automation with Bedrock AgentCore as a parser.
step:
- Import libraries and setup AgentCore capabilities
- Create a knowledge base for Amazon Bedrock with BDA
- Upload Academic Reports dataset to Amazon S3
- Deploy Strands Agent using AgentCore Runtime
- Test AgentCore-Hosted Agent
- clear all resources
security considerations
The implementation uses several safety guardrails such as:
- Secure file upload handling
- Identity and Access Management (IAM) Role-based access control
- Input Validation and Error Handling
Note: This implementation is for demonstration purposes. Additional security controls, testing, and architectural review are required before deploying to a production environment.
Benefits and Use Cases
This solution is especially valuable:
- Automated Document Processing Workflow
- Intelligent document analysis on large scale datasets
- Question-answering systems based on document content
- Multi-Model Content Processing
conclusion
This solution demonstrates how to use the capabilities of Amazon Bedrock AgentCore 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 multi-modal document content using the tool. With Amazon Bedrock Data Automation, we can extend the RAG experience to more complex data formats, including visual rich documents, images, audio, and video.
additional resources
Visit Amazon Bedrock for more information.
Service User Guides:
Relevant Samples:
About the authors
Ryan Osman Is a Technical Account Manager at AWS and works closely with education technology customers located in North America. He has been with AWS for over 3 years and started his journey working as a Solution Architect. Ryan works closely with organizations to optimize and secure workloads on AWS, exploring innovative use cases for generative AI.
andy orlowski is a Strategic Pursuit Solutions Architect at Amazon Web Services (AWS), based in Austin, Texas. He has been with AWS for about 2 years but has worked closely with public sector education customers. As a leader in the AI/ML technology space community, Andy continues to work deeply with his customers to design and scale generic 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 use cloud technology to focus on business outcomes. He is passionate about using technology to improve processes and workflow. Spencer’s interests outside of work include reading, pickleball, and personal finance.