Using an AI-based predictive model to improve collections and manage cash flow
In this article, Adam Kovalcik provides a technically detailed look at an engagement where we applied analytics and AI to predict and manage cash flows. He walks through how our team developed a model to generate dynamic projections and integrated it within the client’s Palantir Foundry environment to give them more control over their financial stability.
Adam leads SATOV’s work on helping clients harness AI, identifying where it can accelerate insights and automation, while ensuring that human judgment and interaction remain at the heart of decision-making.
Our client, a building services company with many branches across the United States, was experiencing cash flow variability that was higher than predicted, making day-to-day management very challenging and hurting relationships with vendors. Having worked with this client extensively on setting up their branch-level operating model and integrating acquisitions, we had a good working knowledge of the business flows. The client asked us to help improve visibility by building a cash flow forecasting model into their Palantir Foundry environment.
Background
The provider works for consumers but collects invoices through a group of third-party payors. Payors negotiate invoices, meaning 100% of an invoice isn’t always collected. So while job starts were the best predictor of cash flow, there was a great degree of uncertainty on the exact amount and timing of the receipts.
The business already had a cash flow forecasting process but needed more accuracy and a greater level of detail on individual business units. This became the benchmark against which we gauged success.
Since our output would be a forecast, the model needed to be predictive. This meant taking some number of independent variables and using them to infer dependent ones. The model needed to predict both the time to collect (how long it takes from the invoice date) and the collection percentage (what % of the invoiced amount is collected) of invoices. By doing so, we could pin money inflows to dates.
The model also needed to consider both outstanding invoices (those awaiting collection) and future invoices (in progress jobs or jobs expected to start in the future) to build a complete picture. As predictions were made further into the future, the model would rely more on budgeted jobs versus those outstanding.

Deciding on the approach
We couldn’t apply a simple linear regression to drive predictions. We found that time to collect and collection percentage did not follow a normal distribution. We needed more advanced modeling techniques for accurate prediction.
We applied a combination of regression approaches (survival analysis and logistic regression) to predict time to collect and collection percentage respectively. Our approach generated an expected value curve for each invoice into the future (expected dollars collected by day). By adding all the curves for all the invoices together, we could have our overall cashflow prediction.

Building the model
With the end-state in mind, we could begin to determine what variables would drive our prediction. We relied on our client’s field service management system to determine the independent variables we could use to drive our prediction.
We started with 10+ variables but were wary of over-complicating the model and “over-fitting” our prediction. We systematically narrowed it down to four variables that were impactful (significantly influenced the output), accessible (easy to pull), and consistent (their definitions weren’t changing across branches or business units). This would ensure the model both ran today and as the platform evolved and scaled.
The complex nature of our analysis and the volume of data we would need to process meant that we would need to go beyond Excel. We used Python, which we knew could support the analysis and integrate into the client’s chosen data analytics platform later with minimal friction.
We translated our framework into code, transforming inputs from branch systems and budgets into a cohesive dataset and applying Python’s machine learning functionality to generate the predictions. Finally, we sensitized predictions based on historical invoices collected.
This build process required multiple iterations. We worked closely with the client to ensure that appropriate variables were driving predictions, that forecasts were detailed enough and projected far enough out, and that our sensitivities were useful in driving decision making.
Deploying the model
Our client had the vision of implementing our model within their Palantir Foundry environment, and having it run regularly as new data was uploaded. This required an effective data pipeline.
We worked closely with internal owners to design the data architecture required and built the data pipeline in Foundry. We aggregated multiple data sources across each branch’s field service management and accounting systems, often with different variable names, data types, and file formats. We were also able to leverage Foundry’s generative AI capabilities to categorize open text data fields which were inconsistent across input datasets (e.g., payor names).

We built detailed operating procedures and a clear process for future execution. We worked with finance teams to establish the data inputs and upload process required to keep the model functional. We established a clear cadence for model execution with technical staff and outlined effective ways to validate the data. We left behind extensive documentation.
Finally, we built outputs from Foundry that were granular and in a format that could be used in other tools and models within the business.
AI is only sometimes the answer
Our world today is filled with easy-to-access AI tools, data analytics platforms, and other business intelligence applications. We are inundated with claims about how much more productive or successful we can be if we just embrace the newest technology, and how many problems they can seem to solve. We see huge potential in big data, analytics and AI, but deriving value from these tools is possible only if they solve a real problem (not one they’ve made up) or create a net-new opportunity in your business. Businesses then need to tangibly change the way they operate to accommodate the revised decision support.
We help our clients use their data practically to pursue their goals. From conjoint analysis for product and pricing decisions, to sales force compensation modelling, to operational health indicators and forecasting. A thoughtful process from design to deployment across the analytical lifecycle is critical. We are ready to work with you to pursue your analytical vision.