Tasks / Rightbrain Internal

Payment Reconciler

Automates reconciliation of two payment CSVs, identifying matches and flagging all discrepancies. It generates a report detailing unmatched payments for human review, ensuring data integrity.

claude-opus-4-5-20251101
10 views
December 11, 2025

Sign up for a free trial to Clone, Customise and Run

Task Logic

User Prompt Template

CORE INSTRUCTION

Instructions sent to the model. Dynamic variables {brackets} are replaced at runtime.

Goal:
Analyse and reconcile two CSV files containing payment data to identify matching payments and flag discrepancies requiring human review.

Context:
Payment reconciliation ensures consistency and completeness between two independent payment records. A payment is considered matched when key identifying information (such as transaction ID, amount, date, and reference) is present in both datasets with consistent values. Discrepancies, such as payments appearing in only one file, may indicate data entry errors, system failures, fraud, or processing delays and require further investigation by authorised personnel.

Input Parameters:
{payments_doc_1} - First CSV file containing payment transaction records
{payments_doc_2} - Second CSV file containing payment transaction records

Processing Steps:
1. Load and parse both CSV files, automatically detecting column headers, delimiters, and data structure in each file
2. Identify key fields that uniquely define payments, such as transaction ID, payment reference number, amount, transaction date, and payer/payee information
3. Standardise data formats across both files to enable accurate comparison, including date formats, currency representations, decimal precision, and text casing
4. Develop and apply a matching algorithm to identify payments present in both datasets by comparing key identifying fields
5. Identify all payments present in the first CSV but absent from the second CSV
6. Identify all payments present in the second CSV but absent from the first CSV
7. For each unmatched payment, extract complete transaction details including all identifiers, amounts, dates, reference information, and any additional fields available
8. Categorise discrepancies by type: missing from first file versus missing from second file
9. Compile a comprehensive reconciliation report with matched payment statistics and detailed discrepancy listings

Output Guidance:
Provide a structured reconciliation report containing the following sections:

Summary Statistics:
- Total number of payments in first CSV file
- Total number of payments in second CSV file
- Number of successfully matched payments
- Number of discrepancies requiring review

Matched Payments:
- Confirmation statement of successfully reconciled transactions
- Count of matched records

Discrepancies Requiring Human Review:
Present in two subsections:

Subsection A - Payments in First CSV but Missing from Second CSV:
For each discrepancy, provide a table or structured list with:
- Transaction identifier or reference number
- Payment amount with currency
- Transaction date
- Payer and payee information (if available)
- Any additional reference details or notes from the source file

Subsection B - Payments in Second CSV but Missing from First CSV:
For each discrepancy, provide a table or structured list with:
- Transaction identifier or reference number
- Payment amount with currency
- Transaction date
- Payer and payee information (if available)
- Any additional reference details or notes from the source file

Include a clear statement that all flagged items require human review and investigation before any corrective action is taken.

Critical Rules:
- Treat both CSV files as equally authoritative sources; do not assume either file is more accurate or complete than the other
- Flag all discrepancies without attempting to resolve, explain, or reconcile them unless the data itself provides unambiguous evidence
- Preserve all original transaction details exactly as they appear in the source files without modification, interpretation, or correction
- If key identifying fields are ambiguous, inconsistent, or missing, explicitly document this limitation in your analysis
- Do not modify, delete, merge, or create payment records; your role is strictly to identify matches and mismatches
- Ensure every unmatched payment is flagged with sufficient detail to enable effective human investigation
- If column headers are unclear or data structure is inconsistent, note these issues in your report as they may affect reconciliation accuracy

Interface Definition

Prompt Variables
payments_doc_1
Document Scanner
filename: payments_doc_1
payments_doc_2
Document Scanner
filename: payments_doc_2
Output Schema

Try this AI task with your own data

Free trial - no credit card required