Build self-improving document processing using Amazon Bedrock AgentCore

IDC research shows that document-related challenges cost organizations $19,732 for each information worker annually and reduce productivity by 21.3 percent. Organizations receiving invoices from hundreds of suppliers often face layouts that vary by issuer and change without notice. Template-based systems require constant maintenance at this scale. Staff can spend up to 30 percent of their time on document-related tasks, and manual data entry error rates range from 1–4 percent . Conventional intelligent document processing (IDP) solutions address some of this burden, but they require extensive upfront configuration for each document format and break when layouts vary across vendors. In this post, you learn how to build an agentic IDP system using Amazon Bedrock AgentCore that classifies, extracts, validates, and learns from business documents with minimal human intervention. Amazon Bedrock AgentCore is a platform to build, connect, and optimize agents at scale, with any framework or model. Your agents automatically handle new document formats, such as supplier invoices, purchase orders, insurance claims, and loan applications. By the end of this post, you can: Deploy a multi-agent IDP system, often in under 20 minutes. Process new document types without manual template configuration. Let agents train themselves on each new document format and reuse what they learn, so later documents of that type go straight to extraction without retraining. Challenges with rule-based document processing Many IDP pipelines require you to define templates, extraction rules, and validation logic for every document format upfront. When a new vendor sends a purchase order with a different layout, the pipeline breaks. This creates three core challenges: Template rigidity: Each new document format requires manual configuration, and even minor layout changes can cause extraction failures. No learning: The same extraction errors repeat across similar documents because the system doesn’t retain knowledge from previous corrections. Scaling burden: Each new vendor or document variant multiplies the maintenance effort, and organizations processing documents from hundreds of sources face ongoing operational costs. An agentic approach addresses these challenges. Instead of static templates, AI agents analyze each document, generate extraction instructions, validate results, and learn from corrections automatically. Over time, your system builds a knowledge base of document formats, so you process similar documents with minimal additional configuration. Solution overview In this solution, eight specialized agents collaborate across two graph-based workflows running on Amazon Bedrock AgentCore. The following diagram shows the multi-agent workflow graph built using Strands Agents , an open source SDK for building AI agents. Figure 1: Multi-agent orchestration workflow graph Identification workflow : The Analyzer agent extracts text using Amazon Textract and identifies the document type and sender. The Matcher agent searches for similar documents using vector similarity in Amazon S3 Vectors , a capability of Amazon Simple Storage Service (Amazon S3). Training workflow (new document types): When no match is found, the Instructions agent generates extraction prompts, the Extractor agent extracts structured data, and the Validator agent checks results against schemas and business rules in Amazon Aurora DSQL . If validation fails, the Instructions Fixer agent refines the prompts and retries. On success, the Save Instructions agent persists the instructions for reuse. Automation workflow (known document types): When a match is found, the Extractor agent uses existing instructions. If validation fails, the Troubleshooter agent fixes the extracted data directly without modifying instructions. How it works The following diagram shows the infrastructure architecture for the solution. Figure 2: Agentic IDP infrastructure architecture on AWS Business documents arrive in Amazon Simple Email Service (Amazon SES) or direct upload to Amazon S3. Amazon EventBridge triggers an AWS Lambda function that creates a tracking job in Amazon DynamoDB and invokes AgentCore runtime, a capability of Amazon Bedrock AgentCore. AgentCore runtime orchestrates document processing through Strands Agents. Your agents securely access AWS resources through machine-to-machine credentials managed by AgentCore Identity, a capability of Amazon Bedrock AgentCore, and Amazon Cognito . Your Lambda functions become agent-compatible tools through the Model Context Protocol (MCP) interface of AgentCore Gateway, a capability of Amazon Bedrock AgentCore. Agents extract text using Amazon Textract, classify documents using vector embeddings in S3 Vectors, and validate data against business rules in Aurora DSQL. Agents access enterprise data through MCP servers to validate extracted content against business rules. You monitor status and troubleshoot issues through a chat-enabled dashboard hosted on Amazon Elastic Container Service (Amazon ECS). You gain visibility into agent performance through AgentCore Observability, a capability of Amazon Bedrock AgentCore, and Amazon CloudWatch telemetry. Deploy the solution Follow these steps to deploy the solution infrastructure and web UI to your AWS account. Prerequisites To deploy this solution, you must have: An AWS account . Access to Amazon Bedrock with Amazon Nova and Anthropic (Claude) models enabled. For model availability by AWS Region, refer to Supported models by AWS Region in Amazon Bedrock . Access to Amazon Bedrock AgentCore (Runtime, Gateway, Identity), S3 Vectors, and Amazon Aurora DSQL in a supported Region . AWS Cloud Development Kit (AWS CDK) v2 installed. Docker installed and running (required for building and deploying container images). Python 3.11+ and Node.js 18+. AWS Identity and Access Management (IAM) permissions to create S3 buckets, Lambda functions, DynamoDB tables, Cognito user pools, Amazon Elastic Container Registry (Amazon ECR) repositories, and Amazon ECS services. Clone the repository and set up the environment: git clone https://github.com/aws-samples/agenticidp-guidance.git cd agenticidp-guidance uv venv source .venv/bin/activate uv pip install -r requirements.txt cd ui/orchestrator npm install cd ../.. Deploy the stacks: uv run deploy.py --admin-email your-email@example.com This deploys six AWS CloudFormation stacks: Core (S3, Cognito, DynamoDB), Gateway (Lambda tools, AgentCore Gateway), Aurora (Amazon Aurora DSQL), Agent (AgentCore runtime, containers), UI Orchestrator (API endpoints), and Modern UI (React app on Amazon CloudFront ). Deployment takes approximately 15–20 minutes. Verify deployment by checking that each stack shows CREATE_COMPLETE in the CloudFormation console. Process files and review results After deployment, you receive an email with the CloudFront URL, username, and temporary password. Process a document Sign in to the web UI and choose Process Document . Upload a sample purchase order from infrastructure/sample_data/purchase_orders/training/ . The document enters the agent workflow: The Analyzer agent extracts text and identifies the sender and document type. The Matcher agent searches for similar documents in the vector store. For a new document type, the training workflow generates extraction instructions, extracts data, validates it, and saves the instructions for future use. For a known document type, the automation workflow extracts data using existing instructions and validates it. Review results in the Review Jobs and Instructions tab to verify extracted data, validation results, and generated instructions. Example: A new document type (training workflow) Suppose you upload the first purchase order from a new retailer, Two Wheel Store. The Matcher agent searches the vector store, finds no similar document, and routes the job through the training workflow. The Analyzer agent uses Amazon Textract to extract the raw document text: