# Check an AgentCore purchase-order extraction with AWS's synthetic sample

> A documented guide to deploy AWS's synthetic purchase-order sample, compare extracted JSON with the source PDF, inspect saved instructions, and identify checks its validator does not perform.

By BIGCHANGE.AI Editorial

Published: 2026-10-15T10:39:19.068Z
Updated: 2026-10-15T10:39:19.068Z
Canonical: https://bigchange.ai/blog/aws-agentcore-purchase-order-extraction-guide

![Conceptual charcoal illustration of an itemized purchase-order page, a separate proposed field sheet, a magnifying glass and a small stack of instruction cards.](https://bigchange.ai/api/media/file/aws-agentcore-po-review-v1.png)
AI-generated conceptual illustration by BIG CHANGE; no actual AWS interface, sample output or measured extraction result is depicted.

AWS published a [document-processing tutorial on October 14](https://aws.amazon.com/blogs/machine-learning/build-self-improving-document-processing-using-amazon-bedrock-agentcore/) that routes purchase orders through extraction, validation and reusable instructions on Amazon Bedrock AgentCore. For an operations or application team, the useful first task is narrower than an integration: run the synthetic sample, compare its JSON with the source purchase order, and find out exactly what its validator checked. BIG CHANGE reviewed the tutorial and sample code. We did not deploy the stack or run a model call.

## The big change

- **What changed:** AWS has published a worked AgentCore document-processing example with one path for a document that lacks stored instructions and another for a similar document that can reuse them.
- **Why it matters:** A team can inspect the extraction, the validation result and the saved instructions together before designing its own business rules. The sample gives a concrete test case, not a measured accuracy guarantee.
- **What to watch:** The checked-in purchase-order validator does not calculate line totals or compare their sum with the order total. A `VALID` result therefore still needs a source-to-output review before an order could enter a business system.

## Before you start

The reader is a technical operations or application team evaluating purchase-order extraction. The input is one of the repository's synthetic PDF purchase orders. The expected output is a processing job with extracted JSON, validation details and, on the new-document path, saved instructions that a later similar document may reuse. A successful evaluation has matching purchase-order identity, line items and arithmetic when compared with the PDF; any discrepancy stays unresolved for a person to inspect.

You need an AWS account with billing enabled, suitable IAM permissions, and access in the chosen Region to Bedrock, the sample's Nova and Claude models, AgentCore Runtime/Gateway/Identity, S3 Vectors and Aurora DSQL. AWS recommends `us-east-1`, `us-west-2`, `eu-west-1` or `ap-northeast-1` in the [sample README](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/README.md); confirm that every required service and model is enabled in your own account before deployment. The local tools are AWS CLI, CDK v2, Python 3.11 or newer, `uv`, Node.js 18 or newer with npm, and Docker or an equivalent container builder.

Use Linux, macOS or WSL for these commands. The current repository contains a filename with a colon in a path, which prevented our native Windows Git checkout even with a sparse clone. The README's general Windows claim and its later Windows caveat should not be treated as a tested native-Windows deployment path.

## Run a bounded sample check

These are documentation-based steps using the repository's `31d671ef54c6694fea6431ee4102e3de85b982c1` commit, dated February 6, 2026. The October 14 blog links to this repository, but its displayed clone command names `aws-samples/agenticidp-guidance`, which currently returns 404. Use the linked repository and its `guidance/agentic-orchestration` subdirectory.

1. In Linux, macOS or WSL, clone and pin the sample, then enter its deployment directory:

```sh
   git clone https://github.com/aws-samples/aws-ai-intelligent-document-processing.git
   cd aws-ai-intelligent-document-processing
   git checkout 31d671ef54c6694fea6431ee4102e3de85b982c1
   cd guidance/agentic-orchestration
```

   Confirm that `README.md`, `deploy.py`, `requirements.txt` and `infrastructure/sample_data/purchase_orders/training/` exist. The pin makes the steps repeatable even if `main` changes.

2. Configure the AWS CLI for the intended account and Region, bootstrap CDK if that account/Region has not been bootstrapped, and install the local dependencies. The [sample deployment guide](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/README.md) gives `aws configure`, `cdk bootstrap`, `uv venv`, `uv pip install -r requirements.txt`, and `npm install` inside `ui/orchestrator`. Check the active account and Region before running a deployment command; CDK will create billable resources.
3. Deploy with `uv run deploy.py --admin-email your-email@example.com`, replacing the address with one you control. AWS documents six CloudFormation stacks covering storage and identity, Gateway tools, Aurora DSQL, the AgentCore agent, API endpoints and the UI. Wait for all six to show `CREATE_COMPLETE`. If one fails, inspect that stack's CloudFormation events and the Region's model/service access; do not assume a partially created system is ready.
4. Sign in through the CloudFront URL delivered to the admin email and change the temporary password. In **Process Document**, upload one PDF from `infrastructure/sample_data/purchase_orders/training/`. For a repeatable source pair, the pinned tree contains `PO_RT-014_Two_Wheel_Store_clean_20260102_172623_001.pdf` and `_002.pdf`. Use the first as the new-document candidate and keep the second for the later reuse check. A fresh deployment should have no stored instruction for that retailer, but inspect the job's route instead of assuming the match state.
5. Open **Review Jobs and Instructions**. Record the job ID, extracted JSON, schema result, each line-item result, company result, and the stored instruction reference if the job took the training route. Compare the PDF's order number, retailer, date, each SKU, quantity, unit price, line total and order total with the JSON. The [schema](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/agents/orchestratorgraph/doc_schema/purchase_order_schema.json) requires several identity and line-item fields and constrains SKU format. The [validator Lambda](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/gateway/tools/po_validator_tool/lambda_function.py) checks schema, catalog SKUs, prices, some options and retailer identity. Its code does not recompute line totals or the order total; record those comparisons separately even when it says `VALID`.
6. If the first job saved instructions, upload the second same-retailer PDF and inspect the route and instruction reference. The [orchestration graph](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/agents/orchestratorgraph/orchestratorgraph_agent.py) sends a no-match job through instruction generation, extraction, validation and instruction saving. A match takes the existing-instruction path; validation failures on that path go to the Troubleshooter, which edits that document's extracted data. Match selection is conditional, so the second upload is a reuse check only if its job actually names the saved instruction. Repeat the same source-to-output comparison for this second job.

## Handle a mismatch

If validation reports an invalid SKU or retailer, compare the extracted text with the PDF first, then inspect the schema, catalog data, instruction text and the job's error detail. AWS's published Two Wheel Store example shows a vendor SKU without the internal `AB-` prefix failing schema validation, followed by an instruction update on the training path. BIG CHANGE did not run that example. The graph sets a maximum of 10 node executions for each inner workflow; a failed or exhausted job needs review rather than a claim that it will eventually self-correct.

If schema and catalog checks pass but a total, quantity or other field differs from the PDF, keep the job out of downstream order handling. Correct the input, instructions or validation rule under human review, then check a fresh job. The included Aurora DSQL data is a synthetic reference catalog, not a connection to an organization's ERP. A production path would need organization-specific schema and validators, access controls, tests with approved data and a human decision on exceptions.

AWS's [README cost table](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/README.md) is explicitly dated January 2026: $57.88 for its stated US East scenario of 10 training documents and 1,000 processed documents, with 10% assumed to need troubleshooting. It is not a quote for today's account or this two-document exercise. AWS's [AgentCore pricing page](https://aws.amazon.com/bedrock/agentcore/pricing/), accessed October 15, lists different Runtime v1 and v2 rates and separate Gateway charges. Check the Runtime version your deployment actually uses, plus the Bedrock, Textract, storage, database, network and logging rates for your Region and model choices; set a budget before deployment. Large documents can also run into model context limits, and AWS notes possible container cold-start delay.

Use only the supplied synthetic orders for the first check. Real orders can include personal and commercially sensitive data; review storage, IAM, retention, model access and who can see the UI before uploading them. AWS's `uv run destroy.py` is the documented cleanup path, but it deletes stored documents, job history, validation data and learned instructions. Export anything you are authorized to retain before cleanup, then verify the six stacks are gone.

### Sources & further reading

- [AWS's October 14, 2026 tutorial](https://aws.amazon.com/blogs/machine-learning/build-self-improving-document-processing-using-amazon-bedrock-agentcore/) describes the two document routes and reports its own Two Wheel Store example. Its displayed clone command pointed to a repository that returned 404 on October 15; the working sample is the linked repository below.
- The [sample README at commit `31d671ef`](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/README.md), committed February 6, 2026, provides the canonical path, prerequisites, deployment and cleanup. Its $57.88 cost scenario is dated January 2026.
- The pinned [purchase-order schema](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/agents/orchestratorgraph/doc_schema/purchase_order_schema.json) defines required fields and SKU format. The pinned [validator Lambda](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/gateway/tools/po_validator_tool/lambda_function.py) shows the catalog and retailer checks; its code contains no line-total or order-total arithmetic check.
- The pinned [orchestration graph](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/agents/orchestratorgraph/orchestratorgraph_agent.py), [matcher](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/agents/orchestratorgraph/matcher_agent.py) and [saved-instructions node](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/agents/orchestratorgraph/save_instructions_agent.py) show how a match selects the reuse path and where the instruction reference is recorded. BIG CHANGE reviewed the code but did not run either path.
- [Amazon Bedrock AgentCore pricing](https://aws.amazon.com/bedrock/agentcore/pricing/), accessed October 15, 2026, lists Runtime v1 and v2 prices and Gateway rates. The full example also consumes other AWS services, so its bill depends on the deployed version, account, Region, model and usage.

## Sources

- [AWS Machine Learning Blog, Build self-improving document processing using Amazon Bedrock AgentCore](https://aws.amazon.com/blogs/machine-learning/build-self-improving-document-processing-using-amazon-bedrock-agentcore/) — Dated AWS tutorial for architecture, sample processing trace and deployment. Its displayed clone target returned 404; the linked repository supplies the documented sample. Timings and behavior are AWS examples, not BIG CHANGE measurements.
- [AWS Agentic Orchestration sample README, pinned commit](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/README.md) — Canonical repository paths, prerequisites, supported-region suggestions, deployment and cleanup. Its $57.88 US East scenario is dated January 2026 and depends on stated usage assumptions.
- [AWS pinned purchase-order JSON schema](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/agents/orchestratorgraph/doc_schema/purchase_order_schema.json) — Defines required extracted fields and SKU format. It does not require order_total or calculate line arithmetic.
- [AWS pinned purchase-order validator Lambda](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/gateway/tools/po_validator_tool/lambda_function.py) — Checks schema, catalog SKU, price, selected options and retailer records; reviewed code has no recomputation of line totals or comparison to the order total.
- [AWS pinned orchestration graph](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/agents/orchestratorgraph/orchestratorgraph_agent.py) — Shows no-match training route, matched-document processing route, validation loops and 10-node execution cap. No route was tested by BIG CHANGE.
- [AWS pinned matcher and saved-instruction nodes](https://github.com/aws-samples/aws-ai-intelligent-document-processing/blob/31d671ef54c6694fea6431ee4102e3de85b982c1/guidance/agentic-orchestration/agents/orchestratorgraph/matcher_agent.py) — Matcher prompt and job update fields for an instruction match; paired with the save_instructions_agent.py node linked in the source notes.
- [Amazon Bedrock AgentCore pricing](https://aws.amazon.com/bedrock/agentcore/pricing/) — Current public AgentCore Runtime v1 and v2 and Gateway pricing; accessed October 15, 2026. This is not a full-stack quote; the deployed Runtime version and other AWS services, Region, models and usage affect cost.
