ML Model with 120+ engineered features
Optuna hyperparameter tuning
Outputs churn probability (0-1) with auto-threshold optimization
Located in src/training_utils.py and src/models/churn/
CatBoostRegressor for 90-day CLV forecasting
RFM-based features with mutual information selection
Located in src/models/clv/
VIPs: Low churn + High CLV
Steady Buyers: Low churn + Medium CLV
Onboarders: Low churn + Low CLV
Churn Risks: High churn + High CLV
Dormant: High churn + Low/Medium CLV
120+ engineered features across 8 categories: recency, frequency, monetary, product preferences, behavioral patterns, temporal features, engagement, and trends
Automatic column mapping for different data schemas
RFM analysis with time windows (30/90/365 days)
Product embeddings using TruncatedSVD (16-dimensional)
RAG (Retrieval-Augmented Generation) with document collections
Context-aware recommendations per customer/segment
Two generation modes:
Short recommendations: JSON format with quick insights
HTML campaign recommendations: Full reports with charts
Parallel LLM calls (up to 8 concurrent requests)
4 content flows with dynamic chart injection
Auto-fallback to single-request on failure
Static template integration
20+ H2O GPTe prompt fields (system, query, summary, reflection, auto-generation)
Version control with change tracking
12 pre-configured default templates
Import/Export in JSON format
Context-based assignment (html_recommendation, short_recommendation, email_generation, etc.)
Interactive prompt tester with real-time execution
Pre-built test scenarios
Chat-based optimization for iterative refinement
AI-powered email copywriting (5 types: retention, re-engagement, upsell, loyalty, offer)
SMTP integration with Gmail support
Batch sending to customer segments
HTML + plain text formats
Draft preview and approval workflow
Supports CSV, PDF, DOCX, TXT, HTML, JSON, images
Drag-and-drop interface
Automatic schema detection
Multi-format viewer (PDF, CSV, text, HTML, images)
Automatic H2O GPTe ingestion for RAG
Collection integration
11+ Plotly charts (orders trend, segment distribution, CLV histogram, churn gauge, etc.)
Global KPIs: Revenue, Active Customers, Total Orders, AOV
Advanced filtering: date ranges, segments, custom periods
Complete order history
RFM scores
Churn risk probability with visual indicators
Product preferences and behavioral insights
- H2O GPTe settings (API, collections)
- SMTP configuration
- Template assignments
- Connection testing and one-click initialization
- Async task execution for recommendations
- Real-time status tracking
- Auto-refresh with 1-second updates
- CSV exports (customer profiles, at-risk lists)
- HTML campaign downloads
- Recommendation bundles in ZIP format
https://github.com/h2oai/marketing-insight-agent
https://internal.dedicated.h2o.ai/apps/c8927403-9599-42db-8d5c-2dd697790229
dev-mkt-intelligence-agents
Rohit Singh Kalana Weerakoon Ishan Shrivastava
- src/preprocessing.py - Feature engineering (120+ features)
- src/training_utils.py - Model training
- src/run_inference_base.py - Inference pipeline
- recommendation_handler.py - AI recommendation generation
- html_multipart_generator.py - Parallel HTML generation
- prompt_template_manager.py - Template system
- email_handler.py - Email campaigns
- backend.py - Main business logic
- charts.py - Visualization layer
To launch the Marketing Insights application, follow these steps to configure your environment and initialize the system:
Launch the Application: Open the Marketing Insights instance deployed in the internal dedicated environment via this App link
Configure API Credentials: Navigate to the Settings tab and enter your dedicated h2oGPTe URL and API Key to enable LLM connectivity.
Create a Knowledge Collection: Within the Settings tab, go to Collection Management. Create a new collection by entering a unique name; the system will automatically generate and assign a unique Collection ID.
Upload Datasets: Navigate to the Upload section and import both your structured and unstructured datasets. These files are used to build the underlying ML models, populate the dashboard, and generate recommendations.
Initialize the Application: Return to the Settings tab and select Initialize Application. This one-click setup downloads the required prompt templates and establishes the chat session context.