Post #12 Companion — The CFO & AI Series

The Agent That Ranks Which Customer
to Chase First

A small script that scores each open receivable by more than its days overdue — and prints the collections order it actually suggests, before anyone works through the list by hand.

Boris Dračka · October 2026 · Companion demo

This is a personal, non-commercial side project I put together to learn — not a product or service.

Post #12 asked a simple question: if collections order isn't really decided by days overdue, what else is doing the deciding — and can a rule capture it? Below is a small prototype that answers that with sample data.

8
Sample receivables scored
2 of 8
Reordered ahead of an older balance because of an active credit-hold flag
€27,500
Receivable kept near the front because the hold was blocking the customer's next order

The script doesn't decide which customer matters more. It just writes down, in one place, the same signals someone was already weighing account by account — days overdue, a credit-hold flag, how many reminders already went unanswered.

The sample data

Eight open receivables, each with a days-overdue count, an amount, a reminder count, and whether the customer is on an active credit hold. Two of them move ahead of an older balance once those signals are counted.

  open_receivables.csv — sample data
IDCustomerAmountOverdueRemindersHoldRankStatus
CUST-04Manufacturing Client€18,20095 days3No1
CUST-07Regional Distributor€3,40080 days2No2
CUST-02Wholesale Partner€9,80060 days2No3
CUST-08Retail Chain€1,25045 days1No4
CUST-01Specialty Retailer€6,70030 days1No5
CUST-05Key Account Co.€27,50020 days1Yes6
CUST-03Growth-Stage Customer€4,10010 days0Yes7
CUST-06New Customer€9505 days0No8
Sorted by days overdue

How it works

1
Load the receivablesReads a CSV with one row per open invoice: customer, amount, days overdue, reminders sent, credit-hold flag.
2
Rank by days overdueFor each receivable, ranks it by how long it's been past the due date.
3
Apply priority signalsChecks the credit-hold flag and reads each receivable's reminder count. A hold always moves a receivable forward; reminders only do if you set a threshold.
4
Re-rank the queueReceivables carrying a priority signal move to the front; everything else keeps its overdue-based order.
5
Print the suggested runLists the receivables in suggested collections order, flagging which ones moved.

Try it yourself

1 — Clone the repository

# same personal, non-commercial repo as the earlier demos in this series git clone https://github.com/LuliBobo/cfo-agents.git cd cfo-agents

2 — Add your own receivables (optional)

customer_id,customer,amount,days_overdue,reminders_sent,credit_hold CUST-05,Key Account Co.,27500,20,1,true CUST-03,Growth-Stage Customer,4100,10,0,true # ...add as many rows as you have open receivables

3 — Run it

python collections_priority_agent.py data/open_receivables.csv

4 — Read the output

================================================================ Collections Priority Agent — Suggested Chase Order ================================================================ [Step 1] Loaded 8 open receivable(s) from CSV [Step 2] Ranked by days overdue [Step 3] Checking for credit-hold flags and reminder history CUST-05 Key Account Co. 27,500 20d overdue HOLD ⚠ REORDERED → #1 CUST-03 Growth-Stage Customer 4,100 10d overdue HOLD ⚠ REORDERED → #2 CUST-04 Manufacturing Client 18,200 95d overdue CUST-07 Regional Distributor 3,400 80d overdue CUST-02 Wholesale Partner 9,800 60d overdue CUST-08 Retail Chain 1,250 45d overdue CUST-01 Specialty Retailer 6,700 30d overdue CUST-06 New Customer 950 5d overdue [Step 4] 2 of 8 receivable(s) reordered ahead of an older balance [Step 5] Suggested collections order printed above

What it's built from

Data source

A plain CSV of open receivables — no CRM connection, no live banking access, nothing beyond sample data.

Calculation

Standard Python, no external dependencies — an overdue ranking and two flag checks.

Configurable signals

What counts as an active hold and the reminder threshold are command-line arguments, not hardcoded.

Read-only by design

The script only reads and reports. It doesn't send a single reminder on its own.

What's in the repository

The same personal, non-commercial repository as the earlier demos in this series:

View on GitHub Back to Post #12

Follow the series

Post #13 steps back from any single ledger line to ask a harder question: once both sides of cash — what the company owes, and what it's owed — are visible at the same time, what actually changes about how a finance team spends its week?

Subscribe free
No spam. One post per week. Unsubscribe any time.