DEV Community

Parth
Parth

Posted on

Retention AI

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission πŸ’Έ

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

RetentionAI is an executive-grade subscription churn intelligence tool that turns passive cancellation risk into automated, revenue-protecting business actions.

  • The Problem: Subscription and micro-SaaS founders lose thousands of dollars each month to silent churn. By the time a customer clicks "Cancel Subscription," it’s already too late. Most churn-prediction solutions either require massive datasets and complex MLOps pipelines (XGBoost, hyperparameter tuning loops) or cost thousands per month on enterprise platforms like ChurnZero or Gainsight.
  • The Solution: RetentionAI leverages TabPFN (PriorLabs' foundational transformer for tabular data) to deliver instant, in-context churn predictions on small-to-medium customer cohorts without any hyperparameter tuning. It flags high-risk accounts, calculates total monthly recurring revenue (MRR) at risk, prescribes targeted retention plays (e.g., automated 20% win-back incentives, fast-track engineering escalation, VIP 1-on-1 reviews), and features an interactive What-If ROI Simulator to forecast exact dollar returns on retention campaigns.
  • Who would pay for it? Indie hackers, bootstrapped SaaS founders, Customer Success (CS) leads, and RevOps managers running subscription products on Stripe, Paddle, or Lemon Squeezy who need proactive churn prevention without hiring an ML engineer.

Demo

  • πŸ’» Local Preview: Run streamlit run app.py at http://localhost:8501

Code

The complete codebase is open-source and pre-configured for 1-click cloud deployment:

GitHub logo parthbadgire-code / retentionai

RetentionAI: Subscription Churn Predictor using TabPFN tabular foundation model

πŸ“‰ RetentionAI: Subscription Churn Predictor

An enterprise-grade, Render-ready Streamlit web application powered by TabPFN (PriorLabs' foundational transformer model for tabular datasets) to predict subscriber churn risk and automate retention actions.


🌟 Key Features

  • TabPFN Client Integration: Direct connection to PriorLabs' in-context tabular foundation model via tabpfn-client.
  • Zero-Config Demo Mode: Ships with 200 realistic synthetic subscription customer records and a default 25-account evaluation cohort so it functions right out of the box.
  • Custom CSV Ingestion: Upload any subscriber dataset with support for custom customer IDs and dynamic column mapping.
  • Dynamic Executive KPIs:
    • πŸ‘₯ Customers Analyzed
    • 🚨 High-Risk Accounts (with dynamic risk threshold)
    • πŸ’° Monthly Revenue at Risk ($)
  • Automated Retention Playbook: Prescribes targeted business actions (e.g. 20% win-back discounts for inactivity >21 days, urgent CS escalation for support tickets β‰₯3, VIP executive calls for high-spend tiers).
  • Interactive Visualizations: Churn distribution histograms, inactivity vs. churn scatter charts, and revenue breakdown by…

Repository link: https://github.com/parthbadgire-code/retentionai

Key components:

  • app.py: Full Streamlit web application featuring TabPFN integration, Scandinavian pastel design system, and the What-If ROI Simulator.
  • generate_data.py: Synthetic customer cohort generator with realistic feature correlations (seed=42).
  • render.yaml & Procfile: Render Blueprint specifications for zero-config cloud hosting.
  • .streamlit/config.toml: Custom light porcelain theme and minimal toolbar settings.

How I Built It

RetentionAI is built around the modern Python open-source AI ecosystem:

  1. Tabular Foundation Model (TabPFN): Built using tabpfn-client. Unlike classical gradient-boosted trees that require training loops and hyperparameter search, TabPFN operates as an in-context transformer trained on millions of synthetic datasets. It produces calibrated Bayesian posterior probabilities directly in a single forward pass.
  2. Streamlit (Scandinavian Pastel UI): Built with streamlit using a bespoke executive dashboard design system inspired by tools like Linear and Stripe. It avoids dark "neon-AI" tropes in favor of soft porcelain surfaces (#F8FAFC), crisp white cards, muted sage/terracotta indicators, and Plus Jakarta Sans typography.
  3. Synthetic Dataset Engine: Built using pandas and numpy to generate realistic customer records with real-world churn drivers:
    • Days elapsed since last login ($1$ to $45$ days)
    • Tier spend ($15, $30, $99 MRR)
    • Support complaints (Poisson distribution, $\lambda = 1.5$)
    • Engagement session duration (Normal distribution, clipped $1$ to $60$ mins)
  4. Interactive What-If Retention ROI Simulator: A dynamic scenario modeling engine that lets teams adjust conversion rates (discount win-back %, support resolution success %, VIP review save %) to model projected preserved MRR, annualized ARR protected, campaign costs, and net ROI multiples in real time.
  5. Calibrated Fallback Engine: Built with scikit-learn (HistGradientBoostingClassifier) to enable seamless offline and demo testing even without an active API key.

Why Does Open Innovation Matter?

Over 80% of critical enterprise data lives in tables, spreadsheets, and relational databases. Yet the AI revolution has disproportionately focused on closed LLM APIs, leaving tabular data reliant on fragmented, complex pipelines or vendor lock-in.

Open foundation models like TabPFN prove that foundation model architectures can solve structured business problems with zero configuration. Open innovation makes enterprise-grade predictive intelligence accessible to solo creators and bootstrapped businesses, allowing them to retain customers and compete with venture-funded giants on equal footing.


My Agent Session

This project was designed, implemented, refined, and deployed through an end-to-end pair-programming session with Antigravity (Google DeepMind's advanced coding agent):

  • Generating realistic synthetic data cohorts with non-deterministic logistic risk distributions.
  • Integrating the PriorLabs TabPFN client authentication and fallback mechanisms.
  • Iteratively redesigning the interface from dark neon styling to a clean, muted pastel executive theme.
  • Architecting the interactive What-If Retention ROI Simulator and Render Blueprint files.

My First User

I tested RetentionAI with a fellow indie SaaS developer managing ~120 active subscriptions. By running their recent activity export through RetentionAI:

  • The Result: The model immediately flagged 6 accounts with high support ticket counts and declining session lengths that hadn't yet cancelled.
  • The Action: The founder scheduled proactive check-ins and offered feature walkthroughs, preventing an estimated $270/mo ($3,240 ARR) in silent churn.
  • Their Feedback: "Normally I only notice someone churned when Stripe sends a cancellation webhook. Seeing the exact dollar value at risk before they leave turns churn prevention into a routine Monday morning task."

Prize Categories

  • Open-Source AI Challenge: Side Hustle (Best revenue-generating tool built with open AI)
  • Best Use of Tabular Open-Source AI / TabPFN

Top comments (0)