Back to Prompt Library
Build the complete application
Implementation brief
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build a Purchase-to-Payment Invoice Reconciliation Agent
Format
Code-aware
Lines
80
Sections
11
Linked challenge
Build a Purchase-to-Payment Invoice Reconciliation Agent
Prompt source
Original prompt text with formatting preserved for inspection.
80 lines
11 sections
No variables
1 code block
## Who Uses It
An accounts payable team reviewing invoices before payment approval.
## What You Will Build
Build an agent that reads invoices, matches purchase orders and receipts, calculates discrepancies, and creates a finance review queue. Reviewers must see the source records and approve any proposed next step.
## Inputs
- Invoice records
- Purchase orders
- Goods receipts and matching tolerances
## Workflow
1. Extract and normalize invoice lines.
2. Match each line to its purchase order and receipt.
3. Calculate price, quantity, and duplicate exceptions.
4. Prepare matched cases and exception cases for finance review.
## Interface
An invoice inbox with a three-way comparison, highlighted differences, evidence links, and reviewer decisions.
## Working Demo
Show I1 as matched for 50 and I2 as an exception for four unreceived units worth 32. Request finance review.
## Deliverables
- A working local application with the specified review interface.
- Source code, dependency lockfile, and setup commands.
- A recorded end-to-end demo using the supplied starter data.
- Example outputs, action logs, and automated tests.
## Starter Data
These fictional records are a small development fixture, not a production dataset. Implement the mock services described in the brief.
```json
{
"invoices": [
{
"id": "I1",
"po_id": "P1",
"item": "Cable",
"quantity": 10,
"unit_price": 5
},
{
"id": "I2",
"po_id": "P2",
"item": "Adapter",
"quantity": 10,
"unit_price": 8
}
],
"purchase_orders": [
{
"id": "P1",
"item": "Cable",
"quantity": 10,
"unit_price": 5
},
{
"id": "P2",
"item": "Adapter",
"quantity": 10,
"unit_price": 8
}
],
"receipts": [
{
"po_id": "P1",
"quantity": 10
},
{
"po_id": "P2",
"quantity": 6
}
],
"policy": {
"quantity_tolerance": 0
}
}
```
## Constraints
Use synthetic finance data. Prepare recommendations only and do not execute payments.
Choose an available model that supports your implementation. Record its identifier and version.
## Evaluation
Review the complete application, not only the starter-case answers.
- Each invoice links to the correct order and receipt.
- I2 shows a quantity difference of four and value difference of 32.
- No payment is sent or marked approved automatically.
Add one normal case, one incomplete-input case, and one failure-recovery case.Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Preserve the source structure until you know which part of the prompt is actually driving the result quality.
Tune next
Change domain facts, examples, and tool context first before you rewrite the instruction scaffold.
Verify after
Validate one failure mode at a time so prompt changes stay attributable instead of getting noisy.