Use Amazon Bedrock AgentCore to build document processing that improves itself
Amazon Bedrock AgentCore supports agentic document processing that self-learns invoice formats, reducing manual work and maintenance costs.
Key Takeaways
- Amazon Bedrock AgentCore supports an agentic intelligent document processing system that can classify, extract, validate, and learn from business documents with minimal human intervention.
- Static template-based document processing is costly and brittle because layouts vary across suppliers, errors repeat, and each new format requires manual maintenance.
- The solution uses eight specialized agents in two graph-based workflows: an identification workflow to match known documents, and a training workflow to generate, validate, fix, and save extraction instructions for new formats.
- It integrates AWS services such as Amazon Textract, S3 Vectors, Aurora DSQL, Lambda, DynamoDB, EventBridge, AgentCore Identity, Gateway, and Observability to automate document intake, extraction, validation, and monitoring.
- When a new document type arrives, the system automatically attempts extraction, validates results against schemas and business rules, refines prompts or data as needed, and stores successful instructions for future reuse.
Meta description: Amazon Bedrock AgentCore supports a multi-agent IDP walkthrough that self-learns document formats, cuts invoice processing time, and estimates $58 monthly.
Tags: AWS, Amazon Bedrock AgentCore, intelligent document processing, invoices, AI agents
Featured image: An abstract, friendly illustration of business documents moving through connected agent nodes, with no real people, logos, or visible text.
For teams that process supplier invoices, purchase orders, insurance claims, and loan applications, Amazon Bedrock AgentCore appears in a technical walkthrough that shows how to build an agentic intelligent document processing system, often in under 20 minutes. The goal is to classify, extract, validate, and learn from business documents with minimal human intervention.
The cost of static document processing
IDC research cited in the source says document-related challenges cost organizations $19,732 for each information worker annually and reduce productivity by 21.3 percent. 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.
The problem becomes harder when organizations receive invoices from hundreds of suppliers. Layouts vary by issuer and can change without notice. Template-based systems require constant maintenance at that scale. Conventional intelligent document processing solutions address part of the burden, but they require extensive upfront configuration for each document format and break when layouts vary across vendors.
The walkthrough frames three 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 does not retain knowledge from previous corrections.
- Scaling burden: each new vendor or document variant multiplies maintenance effort, and organizations processing documents from hundreds of sources face ongoing operational costs.
An agentic approach replaces static templates with AI agents that analyze each document, generate extraction instructions, validate results, and learn from corrections automatically. Over time, the system builds a knowledge base of document formats, allowing similar documents to be processed with minimal additional configuration.
Eight agents across two graph-based workflows
The solution uses eight specialized agents in two graph-based workflows running on Amazon Bedrock AgentCore. Amazon Bedrock AgentCore is described as a platform to build, connect, and optimize agents at scale, with any framework or model. The workflow graph is built using Strands Agents, an open source SDK for building AI agents.
The identification workflow uses:
- Analyzer: extracts text using Amazon Textract and identifies the document type and sender.
- Matcher: searches for similar documents using vector similarity in Amazon S3 Vectors, a capability of Amazon Simple Storage Service.
The training workflow runs when no match is found and uses:
- Instructions: generates extraction prompts.
- Extractor: extracts structured data.
- Validator: checks results against schemas and business rules in Amazon Aurora DSQL.
- Instructions Fixer: refines prompts and retries if validation fails.
- Save Instructions: persists instructions for reuse after success.
The automation workflow runs when a match is found and uses the Extractor with existing instructions. If validation fails, the Troubleshooter agent fixes extracted data directly without modifying instructions.
Infrastructure and monitoring flow
Business documents arrive through Amazon Simple Email Service 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.
The agents access AWS resources through machine-to-machine credentials managed by AgentCore Identity, another capability of Amazon Bedrock AgentCore, and Amazon Cognito. Lambda functions become agent-compatible tools through the Model Context Protocol interface of AgentCore Gateway, also part of Amazon Bedrock AgentCore.
During processing, agents use Amazon Textract for text extraction, S3 Vectors for document classification through vector embeddings, and Amazon Aurora DSQL for validation against business rules. Agents can access enterprise data through MCP servers to validate extracted content.
Status and troubleshooting are available through a chat-enabled dashboard hosted on Amazon Elastic Container Service. Visibility into agent performance comes from AgentCore Observability and Amazon CloudWatch telemetry.
What happens with a new document type
The walkthrough includes a sample 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 raw text, including:
- FROM: Two Wheel Store
- Order #: PO-2026-0102-2584
- Date: 2026-01-02
- Line items such as AC-021 Advanced Computer, quantity 1, $75.61, color cr4321, and SB-004 Folding Classic, quantity 8, $9634.32, color cb8901, size S, unit price $1204.29
- TOTAL: $14931.54
The Instructions agent generates extraction prompts from the schema, and the Extractor agent produces structured JSON, including po_number "PO-2026-0102-2584", retailer_name "Two Wheel Store", order_date "2026-01-02T00:00:00Z", line items with SKU, product_name, quantity, unit_price, line_total, and order_total 14931.54.
The Validator agent then fails the result with validation_status INVALID and the error message:
`'SB-004' does not match '^AB-[A-Z]{2}-\d{3}$'`
The vendor SKU format SB-004 does not match Acme Bikes’ internal format AB-SB-004. The Instructions Fixer agent diagnoses the mismatch and adds an explicit SKU transformation rule: prefix vendor SKUs with AB-. On the second pass, the seven line items validate successfully, and the Save Instructions agent persists the refined prompt to the vector store. End-to-end time for this first run is 3 minutes 49 seconds.
What changes on the next document
When a second purchase order from Two Wheel Store arrives, the Matcher agent finds stored instructions from the first run with a confidence score of 3.946 against a threshold of 3.7. The job is routed through the automation workflow.
The Extractor agent applies the stored instructions directly, so the orchestrator skips prompt generation. The learned SKU transformation rule applies automatically, converting EL-002 to AB-EL-002, HB-071 to AB-HB-071, and PD-002 to AB-PD-002. The three line items validate on the first pass with an order total of $5,979.19. End-to-end processing completes in 1 minute 30 seconds, down from 3 minutes 49 seconds on the first run.
The dashboard includes a chat interface for troubleshooting. Users can ask what tools are available, list stored extraction instructions, check the status of a named job, or ask what went wrong with a failed job and how to update instructions.
How accuracy improves over time
The system uses two feedback loops. In the training loop, when the Instructions Fixer agent refines extraction prompts after validation failures, improved instructions are saved and reused for similar documents. In the processing loop, when the Troubleshooter agent fixes extraction errors, it provides detailed analysis that helps identify patterns in document format variations.
When changing models, the source recommends using AgentCore Evaluations, a capability of Amazon Bedrock AgentCore, to confirm that extraction quality remains acceptable. The solution already uses AgentCore Observability, so it has the required instrumentation.
Deployment steps and prerequisites
The walkthrough deploys the solution infrastructure and web UI to an AWS account. The repository is https://github.com/aws-samples/agenticidp-guidance.git.
Prerequisites include:
- An AWS account.
- Access to Amazon Bedrock with Amazon Nova and Anthropic (Claude) models enabled. Model availability by AWS Region is referenced through Supported models by AWS Region in Amazon Bedrock.
- Access to Amazon Bedrock AgentCore Runtime, Gateway, and Identity, plus S3 Vectors and Amazon Aurora DSQL in a supported Region.
- AWS Cloud Development Kit 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 permissions to create S3 buckets, Lambda functions, DynamoDB tables, Cognito user pools, Amazon Elastic Container Registry repositories, and Amazon ECS services.
Setup follows the repository commands: clone the repository, change into agenticidp-guidance, create a Python virtual environment with uv, activate it, install requirements.txt, then install packages in ui/orchestrator with npm.
The deployment command is:
`uv run deploy.py --admin-email [email protected]`
This deploys six AWS CloudFormation stacks: Core with S3, Cognito, and DynamoDB; Gateway with Lambda tools and AgentCore Gateway; Aurora with Amazon Aurora DSQL; Agent with AgentCore runtime and containers; UI Orchestrator with API endpoints; and Modern UI with a React app on Amazon CloudFront. Deployment takes approximately 15–20 minutes. Verification means checking that each stack shows CREATE_COMPLETE in the CloudFormation console.
After deployment, users receive an email with the CloudFront URL, username, and temporary password. In the web UI, they choose Process Document and can upload a sample purchase order from infrastructure/sample_data/purchase_orders/training/. The document then enters the agent workflow: Analyzer extracts text and identifies sender and type, Matcher searches the vector store, and either training or automation runs depending on whether a known document type is found. Results, validation, and generated instructions can be reviewed in the Review Jobs and Instructions tab.
Estimated cost and model choices
The solution runs on serverless and on-demand resources, so users pay only for what they use and there are no idle costs. For a workload of 10 training documents and 1,000 processed documents each month in US East (N. Virginia), the estimated cost is approximately $58 per month. Foundation model inference through Amazon Bedrock represents approximately 85 percent of the total cost, at roughly $0.055 per document.
Actual cost depends largely on the models assigned to each agent. Model choices are centralized in agents/orchestratorgraph/utils/config.py, allowing lower-cost models for simpler tasks and stronger models where needed. The source also references detailed pricing guidance.
Common mistakes
- Treating the system as a fixed template library instead of a learning workflow.
- Ignoring validation errors that reveal vendor-specific format differences.
- Changing models without using AgentCore Evaluations to check extraction quality.
- Forgetting that automation depends on stored instructions from successful training runs.

Comments (0)