An intelligent AI-powered telecom business analytics dashboard built with Python, Machine Learning, and Large Language Models.
TelecomAI Assistant is a complete data-driven web application that helps telecom companies:
- Predict customer churn using Machine Learning (80% accuracy)
- Recommend the best data packages for each customer
- Analyze bundle purchase patterns and app usage trends
- Answer any business question through an AI chatbot powered by Llama 3
- Generate automated business reports from real telecom datasets
This application runs locally on your machine. Follow the Installation & Setup section below to run it.
Note: This is a locally hosted application. Clone the repository, install dependencies, add your Groq API key, and run
streamlit run app.pyto launch.
| Technology | Purpose |
|---|---|
| Python 3.11 | Core programming language |
| Streamlit | Web dashboard framework |
| Pandas | Data analysis and manipulation |
| Scikit-learn | Machine Learning models |
| Plotly | Interactive charts and visualizations |
| Groq API + Llama 3 | AI chatbot (free, no credit card needed) |
| Joblib | Saving and loading ML models |
| python-dotenv | Secure API key management |
| openpyxl | Excel file reading |
| Dataset | Records | Description |
|---|---|---|
| IBM Telco Customer Churn | 7,043 customers | Churn prediction and revenue analysis |
| Bundle Purchases May 2026 | 33,025 purchases | Bundle sales and revenue data |
| Addon Subscription Report | 5,919 records | Subscription analytics |
| Data Usage November 2025 | 16,670 customers | App-level usage breakdown |
| Data Usage October 2025 | 17,150 customers | Monthly comparison data |
| Postpaid November 2025 | 436 customers | Postpaid usage analytics |
| Postpaid October 2025 | 432 customers | Month-over-month comparison |
| Service Usage Files | 178 records | Individual customer bucket data |
- Churn Prediction — Random Forest Classifier with 80% accuracy
- Usage Prediction — Linear Regression for spending forecast
- Package Recommendation — Rule-based engine for personalized plans
- AI Chat Assistant — Llama 3 (70B) via Groq API with real dataset context
- Automated Reports — Download business reports as TXT and CSV
telecom-ai-assistant/ │ ├── app.py # Main Streamlit dashboard ├── model_builder.py # ML model training script ├── load_all_data.py # New dataset loading functions ├── test_models.py # Model testing script ├── test_groq.py # Groq API connection test │ ├── data/ # Dataset files (not uploaded - see below) │ └── telecom.csv │ ├── models/ # Saved ML models (generated by model_builder.py) │ ├── churn_model.pkl │ ├── scaler_churn.pkl │ ├── usage_model.pkl │ ├── scaler_usage.pkl │ └── recommendation_engine.pkl │ ├── .env # API keys (NOT uploaded - create your own) ├── .gitignore # Files excluded from Git └── README.md # This file
git clone https://github.com/YOUR_USERNAME/telecom-ai-assistant.git
cd telecom-ai-assistantpython -m venv .venvActivate on Windows:
(Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned) ; (& .\.venv\Scripts\Activate.ps1)Activate on Mac/Linux:
source .venv/bin/activatepip install pandas numpy scikit-learn joblib streamlit plotly groq python-dotenv openpyxl reportlab- Go to console.groq.com
- Sign up with Google account (free — no credit card needed)
- Click API Keys → Create API Key
- Copy the key (starts with
gsk_...)
Create a file called .env in the project root:
GROQ_API_KEY=gsk_your_real_key_here
Download the IBM Telco Customer Churn dataset from Kaggle:
- Search: "Telco Customer Churn" on kaggle.com
- Download
WA_Fn-UseC_-Telco-Customer-Churn.csv - Rename it to
telecom.csv - Place it inside the
data/folder
python model_builder.pyThis creates all 5 model files inside the models/ folder.
python test_groq.pyYou should see: ✅ Groq is working!
streamlit run app.pyOpen your browser at: http://localhost:8501
- 8 KPI metric cards from all datasets
- Churn distribution pie chart
- Bundle purchase analysis charts
- App usage breakdown (Facebook, YouTube, TikTok, Netflix, Gaming)
- October vs November comparison
- Interactive sliders for customer profile input
- Real-time churn probability prediction (ML)
- Predicted spending amount
- Package recommendation with reason
- Churn risk gauge chart
- App usage comparison charts
- Bundle purchase channel analysis
- Powered by Llama 3 (70B parameters) via Groq API
- Answers questions about all 9 datasets
- Quick-question buttons for common queries
- Full conversation memory within session
- Example questions:
- Which packages should we promote next month?
- Which app uses the most data in November 2025?
- Which customers are most likely to churn?
- What is the predicted revenue for next month?
- Complete churn analysis by contract type and internet service
- Bundle purchase revenue charts
- October vs November usage comparison
- Postpaid customer comparison
- AI-generated recommendations table
- Download full report as TXT
- Download key metrics as CSV
| Item | Detail |
|---|---|
| AI Provider | Groq Cloud |
| Model | llama-3.3-70b-versatile |
| Cost | Free tier |
| Speed | ~1-2 seconds per response |
| Context | Real dataset statistics injected via system prompt |
| Model | Algorithm | Accuracy |
|---|---|---|
| Churn Prediction | Random Forest Classifier | ~80% |
| Spend Prediction | Linear Regression | RMSE ~430 |
| Package Recommendation | Rule-based Engine | N/A |
- The
.envfile is excluded from Git for security — never commit API keys - Dataset files are excluded from Git — download from Kaggle and place in
data/ - Run
model_builder.pyonce to generate all model files before running the app - The Groq API is free — go to console.groq.com to get your key
Kaviya