Return to page
Customer Churn, Enterprise h2oGPTe, H2O Wave, Machine Learning, Marketing, Smart Segmentation

Engineering the Future of Customer Intelligence - Inside the Marketing Insights App

Published: January 26, 2026 Written by: Ishan Shrivastava min read
decorator

This is an enterprise-grade AI-powered customer intelligence platform built with H2O Wave for cross-industry marketing teams.

Core ML Capabilities

1. Churn Prediction

  • 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/

  

2. CLV (Customer Lifetime Value) Prediction

  • CatBoostRegressor for 90-day CLV forecasting

  • RFM-based features with mutual information selection

  • Located in src/models/clv/

  

3. Customer Segmentation (5 profiles)

  • 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

  

Data Pre-processing & Feature Engineering Pipeline (src/preprocessing.py)

  • 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)

 

AI-Powered Recommendations

4. H2OGPTe Integration (recommendation_manager.py, recommendation_handler.py)

  • 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

       

5. Multi-Part HTML Generation (html_multipart_generator.py)

  • 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

  

 

Prompt Template System

6. Template Management (prompt_template_ui.py, prompt_template_manager.py)

  • 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.)

  

7. Template Testing Module (template_testing/)

  • Interactive prompt tester with real-time execution

  • Pre-built test scenarios

  • Chat-based optimization for iterative refinement

  

Campaign Management

8. Email Campaign System (email_handler.py, email_manager.py)

  • 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

 

Data Management

9. Multi-Format Upload (upload_manager.py)

  • Supports CSV, PDF, DOCX, TXT, HTML, JSON, images

  • Drag-and-drop interface

  • Automatic schema detection

 

10. Document Management (document_manager.py)

  • Multi-format viewer (PDF, CSV, text, HTML, images)

  • Automatic H2O GPTe ingestion for RAG

  • Collection integration

  

Analytics & Visualization

11. Interactive Dashboard (charts.py, backend.py)

  • 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

  

12. Customer 360° View

  • Complete order history

  • RFM scores

  • Churn risk probability with visual indicators

  • Product preferences and behavioral insights

  

 

System Features

13. Configuration Manager (config_manager.py, settings_page.py)

    - H2O GPTe settings (API, collections)

    - SMTP configuration

    - Template assignments

    - Connection testing and one-click initialization

  

14. Background Job Processing

    - Async task execution for recommendations

    - Real-time status tracking

    - Auto-refresh with 1-second updates

  

15. Export & Reporting

    - CSV exports (customer profiles, at-risk lists)

    - HTML campaign downloads

    - Recommendation bundles in ZIP format

 

Repo Link: 

https://github.com/h2oai/marketing-insight-agent

 

App Link:

https://internal.dedicated.h2o.ai/apps/c8927403-9599-42db-8d5c-2dd697790229

 

Slack Channel

dev-mkt-intelligence-agents

https://join.slack.com/share/enQtMTAzMzI1ODE1MTI3MjItN2E0YzBmNTdkNzNmZjRhMDQ0ZjZiOTg2MTRlMDlhY2VhNjM2YTA5YjUyOGNhZGM3NTg1OTQyMjVkODYyYTM4ZA

 

Development Team:

Rohit Singh Kalana Weerakoon Ishan Shrivastava

 

Demo Video: 


Key Files

  - 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

 

Configuration Settings

To launch the Marketing Insights application, follow these steps to configure your environment and initialize the system:

 

  1. Launch the Application: Open the Marketing Insights instance deployed in the internal dedicated environment via this App link

  2. Configure API Credentials: Navigate to the Settings tab and enter your dedicated h2oGPTe URL and API Key to enable LLM connectivity.

  3. 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.

  4. 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.

  5. 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.

 headshot

Ishan Shrivastava

Manager - Data Science, Field Technology

Ishan is a Manager – Data Science on H2O.ai’s Field Technology team, bringing 9+ years of experience delivering AI solutions across retail, pharma, and CPG industry with impact across supply chain, operations & commercial domain. He supports pre-sales, customer success, and drive innovation for global customers, partnering with Field Technology to translate complex business problems into production-grade AI applications. He holds a B.Tech from the National Institute of Technology, Bhopal and his linked profile can be found here

decorator decorator
decorator decorator
h2oai_cube h2oai_cube

Best-in-Class Agents
For Sovereign AI

REQUEST LIVE DEMO