OUTLIER AI is an advanced, agentic system designed to not only predict customer churn but also autonomously reason about risk factors and generate tailored retention strategies using Retrieval-Augmented Generation (RAG).
- Predictive Intelligence: High-accuracy Random Forest classifier with 82.7% ROC-AUC.
- Agentic Reasoning: A multi-stage AI agent that analyzes SHAP-based churn drivers to understand why a customer is at risk.
- RAG-Powered Strategies: Pulls from a curated Tactical Knowledge Base to recommend industry-standard retention plays.
- Dual Flow Architecture:
- Advanced Agent: Structured strategy reports with reasoning logs and business disclaimers.
- Llama-3 Integration: Deep synthesis using Llama-3-70b (via Groq) for conversational strategy generation.
- Cyberpunk UI: High-fidelity, glassmorphic dashboard built with Streamlit.
- Core AI:
Scikit-Learn,SHAP,RandomForest - Agentic Layer:
LangChain,Groq (Llama-3),FAISS - Dashboard:
Streamlit,Python-Dotenv - Embedding Models:
HuggingFace (all-MiniLM-L6-v2)
├── models/ # Saved ML model artifacts (rf_model.pkl, etc.)
├── src/ # Core Logic
│ ├── retention_automation.py # Primary Agentic Retention logic
│ ├── retention_agent.py # Upstream LLM/RAG integration
│ ├── inference.py # SHAP & Logic orchestration
│ ├── preprocessing.py # Data cleaning pipeline
│ └── train.py # Automated training w/ 5-fold CV
├── app.py # Main "Nexus" Dashboard entrypoint
├── requirements.txt # Integrated dependencies (LangChain + ML)
├── .env # API Key configuration
└── README.md
git clone https://github.com/Vegapunk-debug/customer-churn-agentic-retention-system.git
cd customer-churn-agentic-retention-system
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCreate a .env file in the root directory:
GROQ_API_KEY=your_groq_api_key_hereGet your key at console.groq.com
# To train/validate the model
python src/train.py
# To launch the dashboard
streamlit run app.pyOur training pipeline uses 5-fold cross-validation to ensure robustness:
- Accuracy: ~78.8%
- ROC-AUC Score: 82.7%
- Top Feature Contributions:
Contract_Month-to-month,TotalCharges,Tenure.
When deploying to Streamlit Cloud, do not use a .env file. Instead, add your GROQ_API_KEY to the Secrets tab in the Streamlit Cloud Settings.