AivexaNewsSearch
AI news for builders and product teamsChecked every hour

Build self-improving document processing using Amazon Bedrock AgentCore

Collected Oct 14, 2026

AWS published a technical walkthrough for building a self-improving intelligent document processing (IDP) system on Amazon Bedrock AgentCore, its platform for building, connecting and optimizing agents with any framework or model. The solution targets business documents such as supplier invoices, purchase orders, insurance claims and loan applications, and is distributed as a deployable sample through the aws-samples/agenticidp-guidance repository.

The stated motivation is operational rather than experimental. Amazon cites IDC research putting document-related challenges at $19,732 per information worker annually and a 21.3 percent productivity reduction, with staff spending up to 30 percent of their time on document tasks and manual data entry error rates between 1 and 4 percent. Conventional IDP pipelines address some of this, but require templates, extraction rules and validation logic defined upfront for every format. Three failure modes follow: template rigidity, where even minor layout changes break extraction; no learning, where the same errors repeat because corrections are not retained; and a scaling burden, where each new vendor or document variant adds maintenance work.

The reference architecture uses eight specialized agents spread across two graph-based workflows running on AgentCore, orchestrated with the open source Strands Agents SDK. One identification workflow has an Analyzer agent pull text via Amazon Textract and determine document type and sender, after which a Matcher agent looks for similar documents using vector similarity in Amazon S3 Vectors. If no match is found, a training workflow runs: an Instructions agent generates extraction prompts, an Extractor agent produces structured data, and a Validator agent checks the output against schemas and business rules held in Amazon Aurora DSQL. Failed validation sends the job to an Instructions Fixer agent, which refines the prompts and retries; on success a Save Instructions agent persists them for reuse. If the Matcher does find a match, an automation workflow instead has the Extractor apply stored instructions, and any validation failure is handled by a Troubleshooter agent that corrects the extracted data without touching the instructions.

On the infrastructure side, documents arrive through Amazon Simple Email Service or direct upload to Amazon S3. Amazon EventBridge triggers a Lambda function that records a tracking job in Amazon DynamoDB and invokes AgentCore Runtime, which orchestrates processing through Strands Agents. Agents reach AWS resources using machine-to-machine credentials from AgentCore Identity and Amazon Cognito, and existing Lambda functions are exposed as agent-compatible tools through the Model Context Protocol interface of AgentCore Gateway. A chat-enabled dashboard on Amazon Elastic Container Service handles monitoring and troubleshooting, with AgentCore Observability and Amazon CloudWatch providing telemetry.

Deployment requires an AWS account with Amazon Nova and Anthropic Claude models enabled in Amazon Bedrock, access to AgentCore Runtime, Gateway and Identity plus S3 Vectors and Aurora DSQL in a supported region, AWS CDK v2, Docker, Python 3.11+ and Node.js 18+, and IAM permissions for the resources involved. Cloning the repository, installing dependencies and running the deploy script with an admin email creates six CloudFormation stacks (Core, Gateway, Aurora, Agent, UI Orchestrator and Modern UI) in roughly 15 to 20 minutes. Credentials for the CloudFront-hosted web UI arrive by email.

The walkthrough includes a worked example on a synthetic bike company dataset. A first purchase order from a new retailer, Two Wheel Store, matches nothing in the vector store, so it takes the training path. The Analyzer pulls the raw text, the Instructions agent builds prompts from the schema, and the Extractor returns JSON capturing the order number PO-2026-0102-2584, the retailer, the date, line items and a total of $14,931.54. Validation then fails because a vendor SKU, SB-004, does not match the internal pattern requiring an AB- prefix. The Instructions Fixer diagnoses the mismatch and adds an explicit transformation rule; on the second pass the seven line items validate and the refined prompt is saved. End-to-end time for that first run was 3 minutes 49 seconds.

A second purchase order from the same retailer behaves differently. The Matcher finds the stored instructions with a confidence score of 3.946 against a threshold of 3.7 and routes the job through automation. Prompt generation is skipped, the learned SKU prefix rule applies automatically to several line items, and the three line items validate on the first pass with a total of $5,979.19. Processing took 1 minute 30 seconds, down from 3 minutes 49 seconds.

Cost is framed around pay-per-use serverless and on-demand resources with no idle charges. For 10 training documents and 1,000 processed documents per month in US East (N. Virginia), AWS estimates roughly $58 per month, with foundation model inference accounting for about 85 percent of that, or around $0.055 per document. Model assignments are centralized in a config file, allowing cheaper models for simple tasks and stronger ones where needed.

Customization is expected rather than optional. The sample ships a purchase order schema, a validation Lambda that checks extracted data against product and vendor records in a mock ERP database, and prompts written around purchase order terminology. Teams processing their own documents must supply their own JSON schemas, validation logic and adapted prompts, then register validators as tools in AgentCore Gateway. AWS recommends training with 5–10 representative documents per type including edge cases, connecting validators to reference data, monitoring accuracy through Observability and CloudWatch, adding document types incrementally, and applying Amazon Bedrock Guardrails for sensitive categories such as claims or loan applications. Cleanup uses a destroy script that permanently deletes documents, job history, validation data and learned instructions, so data must be exported first.

In practice, the interesting design choice is treating extraction prompts as durable artifacts rather than runtime context. The system converges on a per-format prompt and reuses it, which is what produces the 3m49s to 1m30s improvement between first and second documents, and why the first document of any new format is the expensive one. That also concentrates risk: a subtly wrong instruction saved to the vector store will be reused for every future document of that format until a validation rule catches it. A likely trade-off for production teams is therefore the quality of validators and reference data, not the agents themselves. Matching behaviour matters too, since a similarity threshold is the only thing standing between a known and unknown format.

The example's confidence numbers and SKU-prefix rule also suggest the approach generalizes best where extraction errors are checkable against authoritative internal records, which is exactly the setup the guidance assumes. AWS directs readers to OWASP guidance for LLM applications for security considerations and notes AgentCore Evaluations for confirming extraction quality when models change.

Why it matters: Teams dealing with high-volume, format-varied documents get a concrete, deployable pattern that replaces upfront template authoring with agents that learn per-format instructions and reuse them. The sample is a starting point rather than a finished product, since schemas, validators and prompts must be replaced for real workloads. The practical work shifts toward maintaining accurate reference data and validation rules, which is the main inference a reader should draw about where effort moves.

Read at AWS Machine Learning Blog

Based on reporting from the original publisher. Visit the source for full context and later updates.

Publisher excerpt

Learn how to build an agentic intelligent document processing (IDP) system using Amazon Bedrock AgentCore that classifies, extracts, validates, and learns from business documents with minimal human intervention, automatically handling new document formats without manual template configuration.