Skip to content

JCedrix/caller-companion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Caller Companion

Stop letting good leads slip through bad conversations.

A pre-call briefing tool for outbound sales agents. The model writes the brief. The agent runs the call.

Python Next.js FastAPI LightGBM License: MIT


The problem

Every cold-call agent faces the same problem on every shift: a list of names, a script, and no context. The good agents build context themselves through tone, intuition, and follow-up notes. The average agent reads the script.

Caller Companion closes that gap.

What it does

Before every dial, the agent sees a one-screen brief:

  • πŸ“Š A calibrated subscription probability based on historical conversion patterns
  • 🎯 A confidence band (high, medium, low) so the agent knows how much to trust the number
  • πŸ’¬ Two to three talking points translated from the model's reasoning into agent-readable language
  • πŸ‘€ The customer's profile including age, occupation, prior campaign history, contact preferences

The agent reads the brief, makes the call, logs the outcome. The app shows them whether the model was right. Over a shift, agents calibrate their own instincts against the model's predictions and learn where to trust it and where to override it.

Each rep also has their own session history: every completed shift is logged with date, calls made, model accuracy, and outcome breakdown. The pattern scales to teams. Same UI, different rep, separate history.

Who it's for

Outbound sales teams running campaigns into existing customer lists
Call centers where reps make 30-80 calls a shift and need fast context
CRM operators who want their reps spending more time on warm leads and less time fishing in the dark

What makes it different

Most ML sales tools fall into one of two traps. They either replace the human (auto-dialers, robocallers, scripted bots that turn every prospect off within 15 seconds) or they hide the model (a probability score with no explanation, leaving the rep to guess why a lead is "hot"). Caller Companion does neither.

  • βœ… No auto-dialer. The agent decides who to call, when to call, and what to say. The tool briefs, doesn't dial.
  • βœ… No black box. The brief surfaces why the model is confident, not just that it is. Top features become talking points.
  • βœ… No false certainty. Predictions are explicitly bucketed. Low-confidence customers tell the agent "the model doesn't know, trust your read."
  • βœ… No leakage. The model was built on features known before the call. Predictive features only available after the call (like call duration) were dropped from training. Including them would inflate metrics and produce a model that can't help an agent picking up the phone.

The model

A LightGBM gradient-boosted classifier trained on the UCI Bank Marketing dataset. 41,188 customer records from a Portuguese bank's term deposit campaigns. The dataset is publicly available and well-documented, making the model and its limitations easy to verify and audit.

Performance on the held-out test set

Metric Caller Companion Logistic Regression Baseline Winner
ROC-AUC 0.8008 0.8008 Tie
PR-AUC 0.4840 0.4601 Caller Companion
Brier Score 0.1312 0.1616 Caller Companion

The two models tie on ranking quality but Caller Companion wins on calibration (lower Brier means the probability number is more trustworthy in absolute terms) and on positive-class identification (higher PR-AUC means the model surfaces actual subscribers more reliably at the top of any ranked queue).

Confidence tiers

Three tiers are applied to the calibrated probability:

Tier Threshold % of customers Agent guidance
🟒 High β‰₯ 0.65 12.9% Strong likelihood of conversion. Lean in.
🟑 Medium 0.30 to 0.65 26.7% Some positive signal. Read the brief, use judgment.
βšͺ Low < 0.30 60.4% Model is uncertain. Trust your instincts.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Next.js App    β”‚ ───► β”‚   FastAPI Service β”‚ ───► β”‚  LightGBM Model β”‚
β”‚   (Vercel)       β”‚      β”‚   (Render)        β”‚      β”‚  (in-memory)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β–²                         β”‚
         β”‚                         β–Ό
         β”‚                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         └─────────────── β”‚  Talking Points   β”‚
        Profile + Brief   β”‚  Translator       β”‚
                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Backend. FastAPI loads the trained model on startup and pre-computes per-row SHAP-like feature contributions for the entire test set. Queue requests are constant-time. Three endpoints: customer queue, customer detail, outcome submission.

Frontend. Next.js 14 with TypeScript and Tailwind. Identity persistence in localStorage. State machine: identity picker, queue, active customer, outcome, reveal, next.

Talking points translator. A Python module that ranks each customer's feature contributions by magnitude, then translates the top 2-3 into agent-readable sentences. A hard override surfaces poutcome (previous campaign outcome) whenever it's success or failure, regardless of contribution rank. The agent always knows when they're calling a returning customer.


Repository structure

caller-companion/
β”œβ”€β”€ notebooks/
β”‚   β”œβ”€β”€ 01_eda.ipynb           # Exploratory data analysis
β”‚   └── 02_modeling.ipynb      # Model training and evaluation
β”œβ”€β”€ model/
β”‚   β”œβ”€β”€ model.pkl              # Trained LightGBM (500 estimators)
β”‚   β”œβ”€β”€ predictions.csv        # Test set predictions with confidence bands
β”‚   β”œβ”€β”€ feature_importance.csv
β”‚   └── model_metadata.json
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ backend/               # FastAPI service
β”‚   └── frontend/              # Next.js application
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ MODEL_REPORT.md        # One-page model summary
β”‚   └── RESPONSIBLE_AI.md      # Bias considerations and deployment guardrails
└── render.yaml                # Render deployment configuration

Run it locally

Prerequisites: Python 3.11+, Node.js 18+, npm.

Backend

cd app/backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000

The backend will load the model and pre-compute feature contributions on startup. First boot takes about 30 seconds.

Frontend

cd app/frontend
npm install
echo "NEXT_PUBLIC_BACKEND_URL=http://localhost:8000" > .env.local
npm run dev

Open http://localhost:3000 in your browser.


Honest limitations

This isn't a finished product. A few things worth knowing before evaluating it:

  • ⚠️ The model was trained on 2008-2010 Portuguese bank data. The macroeconomic features (Euribor rate, employment indicators) are doing real predictive work but bind the model to its training era. Re-training on current data from a target vertical is required for real deployment.
  • ⚠️ Predictive ceiling sits at ROC-AUC 0.80 without the duration feature. This was confirmed across four hyperparameter configurations and none improved on the baseline. The signal in the available features is what it is.
  • ⚠️ The talking points translator covers the highest-impact features but isn't exhaustive. Some predictions surface generic confidence-band advice when no specific feature translation applies.
  • ⚠️ Low absolute count of high-confidence positive predictions means a real deployment should pair this tool with fresh-prospect campaigns to avoid a "rich-get-richer" loop where the same returning customers get over-marketed.

License

MIT. Use it, fork it, run it on your own data, ship something better.


The best closer is the one who knows when to stop pitching.

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors