Imagine processing purchase orders from hundreds of suppliers.
The problem shape
Every supplier has a different layout
→ each format needs templates, extraction rules, validation logic
→ one supplier tweaks a layout and the template breaks
→ the same errors repeat, and the system never learns
The numbers AWS cites from IDC paint the cost of that burden: document-related challenges run about $19,732 per information worker per year and cut productivity by 21.3%. Staff spend up to 30% of their time on document tasks, and manual entry error rates land between 1 and 4%.
An October 14 post from AWS attacks this with learning loops instead of templates: a self-improving agentic intelligent document processing (IDP) system running on Amazon Bedrock AgentCore.
The shape: eight agents, three flows
[Document arrives] SES email or S3 upload
│
▼
EventBridge → Lambda → AgentCore runtime (Strands Agents graph)
│
├─ 1. Identification
│ Analyzer: Textract extracts text, identifies type and sender
│ Matcher : vector similarity search in S3 Vectors
│
├─ 2. Training (unknown format)
│ Instructions : generate extraction prompts
│ Extractor : pull structured data per schema
│ Validator : check against schema and business rules (Aurora DSQL)
│ Instructions Fixer: refine prompts on validation failure, retry
│ Save Instructions : persist the working prompt for reuse
│
└─ 3. Automation (known format)
Extractor reuses saved instructions
Troubleshooter fixes extraction errors directly (prompts untouched)
The interesting part is the division of labor. Unknown formats go through rule creation; known formats reuse the rules already made. When the rules are wrong, the fix targets the rules; when the data is wrong, the fix targets the data.
The example: a supplier with a different SKU format
From the AWS post. The first purchase order from a new supplier, Two Wheel Store, arrives.
Step 1 — Analyzer extracts text with Textract
PURCHASE ORDER
FROM: Two Wheel Store
Order #: PO-2026-0102-2584
AC-021 Advanced Computer Qty: 1 $75.61
SB-004 Folding Classic Qty: 8 $9634.32
...
Step 2 — Matcher finds no similar document → training workflow
Step 3 — Instructions writes extraction prompts, Extractor outputs JSON
Step 4 — Validator checks → FAILS
The failure reason is instructive: the supplier's SKU format (SB-004) does not match the company's internal pattern (^AB-[A-Z]{2}-\d{3}$).
validation_status: INVALID
error: 'SB-004' does not match '^AB-[A-Z]{2}-\d{3}$'
The Instructions Fixer diagnoses it: this supplier's SKUs need an AB- prefix. It adds a transformation rule to the prompt and retries. On the second pass, all seven line items validate, and Save Instructions persists the refined prompt to the vector store.
First run (training): 3m 49s
Second order (automation): 1m 30s
— the stored prompt is found at confidence 3.946 (threshold 3.7)
— prefix rules (EL-002 → AB-EL-002, etc.) apply automatically
When the same format returns, a human does none of this work. That is the core value of the architecture.
Cost: about $58/month for 1,000 documents
The cost estimate is concrete.
Basis: 10 training docs + 1,000 processed docs per month (US East, N. Virginia)
Total: approximately $58/month
└ foundation model inference ≈ 85%
└ ≈ $0.055 per document
Serverless and on-demand, so no idle cost
Model choices live in config.py and can differ per agent
At roughly five cents per document, the math against manual effort and a 1–4% error rate looks favorable. Re-measure on your own region, models, and workload, of course.
Two loops that compound improvement
Training loop — validation fails → prompts get refined → saved → reused
Processing loop — Troubleshooter's analyses expose format-change patterns
Because both loops persist, the system stops repeating its own mistakes. When you swap models, AWS recommends AgentCore Evaluations to confirm extraction quality holds. Observability is already wired in, so the instrumentation exists.
Limits to know before adopting
- Schemas (JSON) and validation Lambdas are yours to build (the sample is a PO demo)
- Not "fully unattended" — exceptions and sensitive docs need guardrails and review
- New document types come incrementally, one schema plus one validator at a time
- Cost and accuracy figures are examples from a specific region/model/workload
AWS's own starting advice is pragmatic: begin with 5–10 representative samples per type (including format variants), and connect validation to reference data such as vendor lists and product catalogs. And track adaptation cost alongside extraction accuracy — how many corrections a new format needs is the number that decides adoption.
CodeBridge mini lab: a document automation check
[ ] Does each document type have a JSON schema defined?
[ ] Is validation connected to internal reference data (ERP, vendor lists)?
[ ] When a new format arrives, is human work just "provide samples," or rule editing?
[ ] Are per-document cost and latency measured (e.g. $0.055, 1–3 minutes)?
[ ] Do sensitive documents pass through guardrails (PII, grounding)?
The third question decides whether this architecture is worth adopting. If rule editing is still a human job, that is exactly where a learning loop belongs.
Conclusion: replace the person fixing templates with a loop that learns them
The next step in document automation is not smarter templates,
but a loop that builds the templates itself.
Two ideas carry it: don't throw away validation failures — feed them into prompt improvement; and store successes as reusable assets. That is the essence of the $58 story. Pick one document type, bring five samples and one schema, and watch two numbers — cost per document and corrections needed per new format.
Further reading
- Mistral OCR 4.1: parsing breaks before retrieval does
- Internal Document AI Chatbot: How RAG Answers From Company Docs
- Cutting AI cost 90% without changing the model
References
- AWS: Build self-improving document processing using Amazon Bedrock AgentCore (Oct 14, 2026)
- AWS Samples: agentic intelligent document processing guidance
- Amazon Bedrock AgentCore
Go deeper with a course
Extracting data from documents, validating it, and turning results into reusable assets is the fastest skill to grow by building an internal-document AI of your own. Take one round from ingestion to retrieval and answers.