INFO:__main__:Receipt for file 1pjzC6yldJGxbL6n7Q2N6Dthp3e5rWCwl already exists, returning existing record
INFO: 199.241.139.243:44726 - "POST /process/1pjzC6yldJGxbL6n7Q2N6Dthp3e5rWCwl HTTP/1.1" 200 OK
INFO:__main__:filename: WhatsApp Image 2025-10-08 at 18.25.20_7f76d34e.jpg, extension: jpg, google_file_id: 11m5rdg47YPr41BKYIMvYdmPnZYnb0K4g
INFO:__main__:File WhatsApp Image 2025-10-08 at 18.25.20_7f76d34e.jpg with ID 11m5rdg47YPr41BKYIMvYdmPnZYnb0K4g already exists, returning existing record
INFO: 199.241.139.243:44732 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Receipt for file 1pjzC6yldJGxbL6n7Q2N6Dthp3e5rWCwl already exists, returning existing record
INFO: 199.241.139.243:47004 - "POST /process/1pjzC6yldJGxbL6n7Q2N6Dthp3e5rWCwl HTTP/1.1" 200 OK
INFO:__main__:filename: WhatsApp Image 2025-10-08 at 18.25.20_7f76d34e.jpg, extension: jpg, google_file_id: 11m5rdg47YPr41BKYIMvYdmPnZYnb0K4g
INFO:__main__:File WhatsApp Image 2025-10-08 at 18.25.20_7f76d34e.jpg with ID 11m5rdg47YPr41BKYIMvYdmPnZYnb0K4g already exists, returning existing record
INFO: 199.241.139.243:47010 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Applying 1 custom AI rules to matching
INFO:services.ai_matcher:Starting AI matching for 8 receipts against 5 transactions
INFO:services.ai_matcher:Processing receipt 1/8: Eleven Labs Inc. - $111.87
INFO:services.ai_matcher:Found 4 candidates for receipt: Eleven Labs Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Eleven Labs Inc.
- Amount: $111.87
- Date: 2025-06-10
- Description: Pro Jun 10 - Jul 10, 2025
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found 4 candidates for receipt: Bzabaowskyj
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Bzabaowskyj
- Amount: $37.55
- Date: 2024-05-22
- Description: Paypal *Bzabaowskyj* 4029357733 On
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - No exact vendor match
INFO:services.ai_matcher:Processing receipt 3/8: Figma, Inc. - $27.0
INFO:services.ai_matcher:Found 4 candidates for receipt: Figma, Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Figma, Inc.
- Amount: $27.0
- Date: 2025-06-19
- Description: Professional Full seats (monthly) Jun 19 - Jul 19, 2025
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - No exact vendor match
INFO:services.ai_matcher:Processing receipt 4/8: Google LLC - $21.15
INFO:services.ai_matcher:Found 4 candidates for receipt: Google LLC
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Google LLC
- Amount: $21.15
- Date: 2025-05-31
- Description: Google Workspace
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - No exact vendor match
INFO:services.ai_matcher:Processing receipt 5/8: Figma, Inc. - $27.0
INFO:services.ai_matcher:Found 4 candidates for receipt: Figma, Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Figma, Inc.
- Amount: $27.0
- Date: 2025-06-19
- Description: Professional Full seats (monthly) Jun 19 - Jul 19, 2025
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - No exact vendor match
INFO:services.ai_matcher:Processing receipt 6/8: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 5 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: ROMATOKI
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 4:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 5:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.390 - Amount similar (10%) with some matches
INFO:services.ai_matcher:Processing receipt 7/8: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 5 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: Vehicle Purchase
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 4:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 5:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.390 - Amount similar (10%) + some matches
INFO:services.ai_matcher:Processing receipt 8/8: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 5 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: Vehicle: ROMATOKI
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 4:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 5:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.690 - Amount similar (10%) + some matches
INFO:services.ai_matcher:AI matching completed. Found 8 matches
INFO:services.ai_rules_matcher:Applying AI rules to 8 matches with 1 custom rules
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
ERROR:services.ai_rules_matcher:Failed to parse LLM response as JSON: Unterminated string starting at: line 5 column 17 (char 151)
ERROR:services.ai_rules_matcher:Response text: {
"flag_for_review": true,
"auto_approve": false,
"rules_applied": ["receipt currency differs from transaction currency"],
"reasons": ["Receipt and transaction currencies differ (CAD vs. CAD is not a match, but the currencies are the same, so this rule is not applicable, however, the built-in rule is applied because the currencies are the same, but the rule is not applicable, so we will use the built-in rule which is always applied when currencies differ, but in this case, the currencies are the same, so we will use the built-in rule which is not applicable, but the rule is applied because the currencies are the same, so we will use the built-in rule which is always applied when currencies differ, but in this case, the currencies are the same, so we will use the built-in rule which is not applicable, but the rule is applied because the currencies are the same, so we will use the built-in rule which is always applied when currencies differ, but in this case, the currencies are the same, so we will use the built-in rule which is not applicable, but the rule is applied because the currencies are the same, so we will use the built-in rule which is always applied when currencies differ, but in this case, the currencies are the same, so we will use the built-in rule which is not applicable, but the rule is applied because the currencies are the same, so we will use the built-in rule which is always applied when currencies differ, but in this case, the currencies are the same, so we will use the built-in rule which is not applicable, but the rule is applied because the currencies are the same, so we will use the built-in rule which is always applied when currencies differ, but in this case, the currencies are the same, so we will use the built-in rule which is not applicable, but the rule is applied because the currencies are the same, so we will use the built-in rule which is always applied when currencies differ, but in this case, the currencies are the same, so we will use the built-in rule which is not applicable, but the rule is applied because the currencies are the same, so we will use the built-in rule which is always applied when currencies differ, but in this case, the currencies are the same, so we will use the built-in rule which is not applicable, but the rule is applied because the currencies
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
ERROR:services.ai_rules_matcher:Failed to parse LLM response as JSON: Unterminated string starting at: line 5 column 17 (char 151)
ERROR:services.ai_rules_matcher:Response text: {
"flag_for_review": true,
"auto_approve": false,
"rules_applied": ["receipt currency differs from transaction currency"],
"reasons": ["Receipt and transaction currencies differ (CAD vs. CAD is not a match, but the currencies are the same, so this rule is not applicable, however, the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same, but the rule is not applicable, so the built-in rule is applied because the currencies are the same
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
ERROR:services.ai_rules_matcher:Failed to parse LLM response as JSON: Unterminated string starting at: line 5 column 17 (char 151)
ERROR:services.ai_rules_matcher:Response text: {
"flag_for_review": true,
"auto_approve": false,
"rules_applied": ["receipt currency differs from transaction currency"],
"reasons": ["Receipt and transaction currencies differ (CAD vs. CAD is not a match, but the currencies are the same so this rule is not triggered by currency difference, however, the built-in rule is triggered because the currencies are the same but the rule is looking for a difference, so it is triggered by the fact that the currencies are the same and the built-in rule is looking for a difference, but the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and the currencies are the same so it is actually triggered by the fact that the built-in rule is looking for a difference and
INFO:__main__:Applying 1 custom AI rules to matching
INFO:services.ai_matcher:Starting AI matching for 8 receipts against 5 transactions
INFO:services.ai_matcher:Processing receipt 1/8: Eleven Labs Inc. - $111.87
INFO:services.ai_matcher:Found 4 candidates for receipt: Eleven Labs Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Eleven Labs Inc.
- Amount: $111.87
- Date: 2025-06-10
- Description: Pro Jun 10 - Jul 10, 2025
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found 4 candidates for receipt: Bzabaowskyj
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Bzabaowskyj
- Amount: $37.55
- Date: 2024-05-22
- Description: Paypal *Bzabaowskyj* 4029357733 On
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - No exact vendor match
INFO:services.ai_matcher:Processing receipt 3/8: Figma, Inc. - $27.0
INFO:services.ai_matcher:Found 4 candidates for receipt: Figma, Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Figma, Inc.
- Amount: $27.0
- Date: 2025-06-19
- Description: Professional Full seats (monthly) Jun 19 - Jul 19, 2025
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - No exact vendor match
INFO:services.ai_matcher:Processing receipt 4/8: Google LLC - $21.15
INFO:services.ai_matcher:Found 4 candidates for receipt: Google LLC
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Google LLC
- Amount: $21.15
- Date: 2025-05-31
- Description: Google Workspace
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - No exact vendor match
INFO:services.ai_matcher:Processing receipt 5/8: Figma, Inc. - $27.0
INFO:services.ai_matcher:Found 4 candidates for receipt: Figma, Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Figma, Inc.
- Amount: $27.0
- Date: 2025-06-19
- Description: Professional Full seats (monthly) Jun 19 - Jul 19, 2025
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 2:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - No exact vendor match
INFO:services.ai_matcher:Processing receipt 6/8: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 5 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: ROMATOKI
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 5:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 7/8: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 5 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: Vehicle Purchase
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 5:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 8/8: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 5 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: Vehicle: ROMATOKI
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: UPDATESTACK LLC
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 4:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 5:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found 3 candidates for receipt: TRANSTAR SANITATION SUPPLY LTD
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: TRANSTAR SANITATION SUPPLY LTD
- Amount: $411.3
- Date: 2025-09-24
- Description: TWIN JR JUMBO TP DISPENSER
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $23.910000000000025 (5.8%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $409.8 (99.6%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $409.8 (99.6%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.870 - Exact amount match with similar vendor
INFO:services.ai_matcher:Processing receipt 2/9: Eleven Labs Inc. - $111.87
INFO:services.ai_matcher:Found 2 candidates for receipt: Eleven Labs Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Eleven Labs Inc.
- Amount: $111.87
- Date: 2025-06-10
- Description: Pro Jun 10 - Jul 10, 2025
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found 2 candidates for receipt: Bzabaowskyj
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Bzabaowskyj
- Amount: $37.55
- Date: 2024-05-22
- Description: Paypal *Bzabaowskyj* 4029357733 On
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - Amount very different (>20%)
INFO:services.ai_matcher:Processing receipt 4/9: Figma, Inc. - $27.0
INFO:services.ai_matcher:Found 2 candidates for receipt: Figma, Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Figma, Inc.
- Amount: $27.0
- Date: 2025-06-19
- Description: Professional Full seats (monthly) Jun 19 - Jul 19, 2025
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - Amount very different (>20%)
INFO:services.ai_matcher:Processing receipt 5/9: Google LLC - $21.15
INFO:services.ai_matcher:Found 2 candidates for receipt: Google LLC
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Google LLC
- Amount: $21.15
- Date: 2025-05-31
- Description: Google Workspace
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 6/9: Figma, Inc. - $27.0
INFO:services.ai_matcher:Found 2 candidates for receipt: Figma, Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Figma, Inc.
- Amount: $27.0
- Date: 2025-06-19
- Description: Professional Full seats (monthly) Jun 19 - Jul 19, 2025
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 7/9: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 3 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: ROMATOKI
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 8/9: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 3 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: Vehicle Purchase
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 9/9: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 3 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: Vehicle: ROMATOKI
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found 3 candidates for receipt: TRANSTAR SANITATION SUPPLY LTD
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: TRANSTAR SANITATION SUPPLY LTD
- Amount: $411.3
- Date: 2025-09-24
- Description: TWIN JR JUMBO TP DISPENSER
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $23.910000000000025 (5.8%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $409.8 (99.6%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $409.8 (99.6%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.870 - Exact amount match with similar vendor
INFO:services.ai_matcher:Processing receipt 2/9: Eleven Labs Inc. - $111.87
INFO:services.ai_matcher:Found 2 candidates for receipt: Eleven Labs Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Eleven Labs Inc.
- Amount: $111.87
- Date: 2025-06-10
- Description: Pro Jun 10 - Jul 10, 2025
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found 2 candidates for receipt: Bzabaowskyj
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Bzabaowskyj
- Amount: $37.55
- Date: 2024-05-22
- Description: Paypal *Bzabaowskyj* 4029357733 On
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - No exact vendor match
INFO:services.ai_matcher:Processing receipt 4/9: Figma, Inc. - $27.0
INFO:services.ai_matcher:Found 2 candidates for receipt: Figma, Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Figma, Inc.
- Amount: $27.0
- Date: 2025-06-19
- Description: Professional Full seats (monthly) Jun 19 - Jul 19, 2025
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 5/9: Google LLC - $21.15
INFO:services.ai_matcher:Found 2 candidates for receipt: Google LLC
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Google LLC
- Amount: $21.15
- Date: 2025-05-31
- Description: Google Workspace
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 6/9: Figma, Inc. - $27.0
INFO:services.ai_matcher:Found 2 candidates for receipt: Figma, Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Figma, Inc.
- Amount: $27.0
- Date: 2025-06-19
- Description: Professional Full seats (monthly) Jun 19 - Jul 19, 2025
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - Amount very different (>20%)
INFO:services.ai_matcher:Processing receipt 7/9: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 3 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: ROMATOKI
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - Amount very different (>20%)
INFO:services.ai_matcher:Processing receipt 8/9: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 3 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: Vehicle Purchase
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - Amount very different (>20%)
INFO:services.ai_matcher:Processing receipt 9/9: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 3 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: Vehicle: ROMATOKI
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
Candidate 3:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:AI matching completed. Found 9 matches
INFO:services.ai_rules_matcher:Applying AI rules to 9 matches with 1 custom rules
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
ERROR:services.ai_rules_matcher:Failed to parse LLM response as JSON: Unterminated string starting at: line 5 column 17 (char 151)
ERROR:services.ai_rules_matcher:Response text: {
"flag_for_review": true,
"auto_approve": false,
"rules_applied": ["receipt currency differs from transaction currency"],
"reasons": ["Receipt and transaction currencies differ (CAD vs. CAD is not a match, but the currencies are the same, so this rule is not applicable, however, the built-in rule is applied because the currencies are the same but the rule is based on the fact that they are different, but in this case they are the same, so the built-in rule is not applied, however, the rule is applied because the currencies are the same, but the rule is based on the fact that they are different, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is not applied, but the rule is applied because the currencies are the same, so the built-in rule is
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
ERROR:services.ai_rules_matcher:Failed to parse LLM response as JSON: Invalid control character at: line 5 column 211 (char 345)
ERROR:services.ai_rules_matcher:Response text: {
"flag_for_review": true,
"auto_approve": false,
"rules_applied": ["receipt currency differs from transaction currency"],
"reasons": ["Receipt and transaction currencies differ (CAD vs. CAD is not a match, but the currencies are the same, so this rule is actually not applicable, however, the built-in rule is applied instead.)]
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
ERROR:services.ai_rules_matcher:Failed to parse LLM response as JSON: Unterminated string starting at: line 5 column 17 (char 151)
ERROR:services.ai_rules_matcher:Response text: {
"flag_for_review": true,
"auto_approve": false,
"rules_applied": ["receipt currency differs from transaction currency"],
"reasons": ["Receipt currency (CAD) differs from transaction currency (CAD) is not possible, but built-in rule applies due to different currency being used in the match details, however, the currencies are the same, but the built-in rule still applies because of the difference in the match quality reason which is amount difference, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference which is a different scenario, but the currencies are the same, so the built-in rule applies because of the amount difference
INFO:services.ai_matcher:Found 6 candidates for receipt: TRANSTAR SANITATION SUPPLY LTD
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: TRANSTAR SANITATION SUPPLY LTD
- Amount: $411.3
- Date: 2025-09-24
- Description: TWIN JR JUMBO TP DISPENSER
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $674.08 (absolute: $674.08)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $262.78000000000003 (63.9%)
Candidate 2:
- Vendor: Unknown
- Amount: $1025.07 (absolute: $1025.07)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $613.77 (149.2%)
Candidate 3:
- Vendor: Unknown
- Amount: $841.63 (absolute: $841.63)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $430.33 (104.6%)
Candidate 4:
- Vendor: Unknown
- Amount: $300.0 (absolute: $300.0)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $111.30000000000001 (27.1%)
Candidate 5:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $23.910000000000025 (5.8%)
Candidate 6:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (177 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $409.8 (99.6%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.580 - Amount match with similar vendor and close date
INFO:services.ai_matcher:Processing receipt 2/9: Eleven Labs Inc. - $111.87
INFO:services.ai_matcher:Found 2 candidates for receipt: Eleven Labs Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Eleven Labs Inc.
- Amount: $111.87
- Date: 2025-06-10
- Description: Pro Jun 10 - Jul 10, 2025
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $300.0 (absolute: $300.0)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $188.13 (168.2%)
Candidate 2:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (71 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $110.37 (98.7%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found 1 candidates for receipt: Bzabaowskyj
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Bzabaowskyj
- Amount: $37.55
- Date: 2024-05-22
- Description: Paypal *Bzabaowskyj* 4029357733 On
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (313 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $36.05 (96.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 4/9: Figma, Inc. - $27.0
INFO:services.ai_matcher:Found 1 candidates for receipt: Figma, Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Figma, Inc.
- Amount: $27.0
- Date: 2025-06-19
- Description: Professional Full seats (monthly) Jun 19 - Jul 19, 2025
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 5/9: Google LLC - $21.15
INFO:services.ai_matcher:Found 1 candidates for receipt: Google LLC
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Google LLC
- Amount: $21.15
- Date: 2025-05-31
- Description: Google Workspace
- Category: cloud service
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (61 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $19.65 (92.9%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Found match: 0.000 - Amount very different (>20%)
INFO:services.ai_matcher:Processing receipt 6/9: Figma, Inc. - $27.0
INFO:services.ai_matcher:Found 1 candidates for receipt: Figma, Inc.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: Figma, Inc.
- Amount: $27.0
- Date: 2025-06-19
- Description: Professional Full seats (monthly) Jun 19 - Jul 19, 2025
- Category: technology
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (80 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $25.5 (94.4%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 7/9: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 7 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: ROMATOKI
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $674.08 (absolute: $674.08)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37857.79 (98.3%)
Candidate 2:
- Vendor: Unknown
- Amount: $1025.07 (absolute: $1025.07)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37506.8 (97.3%)
Candidate 3:
- Vendor: Unknown
- Amount: $1443.42 (absolute: $1443.42)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37088.450000000004 (96.3%)
Candidate 4:
- Vendor: Unknown
- Amount: $841.63 (absolute: $841.63)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37690.240000000005 (97.8%)
Candidate 5:
- Vendor: Unknown
- Amount: $300.0 (absolute: $300.0)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38231.87 (99.2%)
Candidate 6:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 7:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 8/9: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 7 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: Vehicle Purchase
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $674.08 (absolute: $674.08)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37857.79 (98.3%)
Candidate 2:
- Vendor: Unknown
- Amount: $1025.07 (absolute: $1025.07)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37506.8 (97.3%)
Candidate 3:
- Vendor: Unknown
- Amount: $1443.42 (absolute: $1443.42)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37088.450000000004 (96.3%)
Candidate 4:
- Vendor: Unknown
- Amount: $841.63 (absolute: $841.63)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37690.240000000005 (97.8%)
Candidate 5:
- Vendor: Unknown
- Amount: $300.0 (absolute: $300.0)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38231.87 (99.2%)
Candidate 6:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 7:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:services.ai_matcher:Processing receipt 9/9: MAPLE LEAF MOTORS INC. - $38531.87
INFO:services.ai_matcher:Found 7 candidates for receipt: MAPLE LEAF MOTORS INC.
INFO:services.ai_matcher:This is the prompt: You are an expert at matching receipts to bank transactions. Analyze the receipt below against ALL the candidate transactions and return the BEST match.
RECEIPT TO MATCH:
- Vendor: MAPLE LEAF MOTORS INC.
- Amount: $38531.87
- Date: 2025-10-07
- Description: Vehicle: ROMATOKI
- Category: Supercar
CANDIDATE TRANSACTIONS:
Candidate 1:
- Vendor: Unknown
- Amount: $674.08 (absolute: $674.08)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37857.79 (98.3%)
Candidate 2:
- Vendor: Unknown
- Amount: $1025.07 (absolute: $1025.07)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37506.8 (97.3%)
Candidate 3:
- Vendor: Unknown
- Amount: $1443.42 (absolute: $1443.42)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37088.450000000004 (96.3%)
Candidate 4:
- Vendor: Unknown
- Amount: $841.63 (absolute: $841.63)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $37690.240000000005 (97.8%)
Candidate 5:
- Vendor: Unknown
- Amount: $300.0 (absolute: $300.0)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38231.87 (99.2%)
Candidate 6:
- Vendor: Unknown
- Amount: $387.39 (absolute: $387.39)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank e-Transfer sent
- Amount difference: $38144.48 (99.0%)
Candidate 7:
- Vendor: Unknown
- Amount: $1.5 (absolute: $1.5)
- Date: 2025-03-31 (190 days difference)
- Notes: Bank INTERAC e-Transfer fee
- Amount difference: $38530.37 (100.0%)
SCORING CRITERIA (Amount is the PRIMARY factor):
Amount Similarity (MOST IMPORTANT - 60% weight):
- Exact match or within 1%: Start at 0.9-1.0
- Within 5%: Start at 0.75-0.89
- Within 10%: Start at 0.5-0.74
- Within 20%: Start at 0.3-0.49
- More than 20% difference: Start at 0.0-0.29
Then adjust UP or DOWN based on:
- Vendor similarity (20% weight): Exact or similar name increases score
- Date proximity (15% weight): Within 7 days increases score, within 30 days moderate increase
- Description/notes match (5% weight): Relevant keywords increase score
EXAMPLES:
- Amount match + vendor match + close date = 0.95-1.0 (Perfect match)
- Amount match + different vendor + close date = 0.85-0.94 (High confidence)
- Amount match + different vendor + far date = 0.70-0.84 (Medium-high confidence)
- Amount similar (5%) + vendor match = 0.75-0.85 (Medium-high confidence)
- Amount similar (10%) + some matches = 0.50-0.69 (Medium confidence)
- Amount very different (>20%) = 0.0-0.29 regardless of other factors
CRITICAL: You MUST return valid JSON only. No explanations, no text before or after.
Return format:
{"candidate_number": 1, "confidence_score": 0.87, "reason": "Exact amount match with similar vendor"}
Another example:
{"candidate_number": 3, "confidence_score": 0.15, "reason": "Poor match but best available"}
Return ONLY JSON for the best candidate:
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"