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

A Custom Sales & Marketing Agent with H2O Super Agent: A Technical Overview

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

We recently built a custom sales and marketing agent that combines predictive ML with generative AI capabilities. Here's what went into it and how it works.

Sales and marketing teams have plenty of data, but using it effectively is the real challenge. Traditional marketing often relies on guesswork, casting a wide net and hoping for the best.
While standard AI can predict numbers (like who might leave), and Generative AI can write text, combining them into a useful tool is difficult.

In this post, we introduce a Sales & Marketing Agent built with H2O Super Agent. This system bridges the gap between raw data and action. It combines predictive models—which identify risks and opportunities—with Generative AI to create personalized recommendations and reports for every customer based on needs, behavior and lifetime value.

This is a technical overview of how the agent is designed: the modeling stack, feature engineering pipeline, RAG integration, prompt management system, and the infrastructure that holds it all together.


The Core ML Stack

The foundation is three CatBoost models handling different prediction tasks:

  • Churn prediction uses 120+ engineered features with Optuna hyperparameter tuning. It outputs probabilities with auto-threshold optimization to flag at-risk customers.
  • CLV forecasting predicts 90-day customer lifetime value using RFM-based features selected through mutual information scoring.
  • Customer segmentation combines both models to classify customers into five profiles: VIPs, Steady Buyers, Onboarders, Churn Risks, and Dormant accounts.

 

Feature Engineering Pipeline

The preprocessing layer generates features across eight categories: recency, frequency, monetary value, product preferences, behavioral patterns, temporal trends, engagement metrics, and trajectory indicators. Product interactions get embedded into 16 dimensions using TruncatedSVD. The pipeline automatically maps columns across different data schemas.

 

RAG-Powered Recommendations

We integrated H2O GPTe for context-aware recommendations using retrieval-augmented generation. The system ingests customer data and business documents into collections, then generates personalized insights per customer or segment.

For campaign creation, we built a multi-part HTML generator that makes parallel LLM calls—up to 8 concurrent requests—to produce full reports with dynamically injected charts. It falls back to single-request mode if parallelization fails.

 

Prompt Template System

Managing LLM behavior required a proper template system. We built version-controlled prompt templates covering 20+ H2O GPTe fields (system prompts, queries, summaries, reflection prompts). The system includes 12 default templates and supports import/export in JSON.

There's also an interactive testing module where you can run prompts against real data and iteratively refine them through a chat interface.

 

Email Campaigns

The agent generates email copy for five campaign types: retention, re-engagement, upsell, loyalty rewards, and special offers. SMTP integration handles batch sending to customer segments with HTML and plain text formats. Drafts get previewed before sending.

 

Data Handling

The upload manager accepts CSV, PDF, DOCX, TXT, HTML, JSON, and images through drag-and-drop. Documents automatically feed into H2O GPTe collections for RAG. There's a multi-format viewer for inspecting uploaded files.

 

Analytics Layer

We built an interactive dashboard with 11+ Plotly charts showing order trends, segment distributions, CLV histograms, churn gauges, and more. Global KPIs track revenue, active customers, total orders, and average order value. The customer 360° view displays complete order history, RFM scores, churn probabilities, and product preferences.

 

Architecture Notes

Background job processing handles async tasks like recommendation generation with real-time status tracking. The config manager centralizes H2O GPTe settings, SMTP configuration, and template assignments with connection testing.

Export functionality outputs customer profiles and at-risk lists as CSV, HTML campaigns as downloads, and recommendation bundles in ZIP format.

 

Wrapping Up

This agent demonstrates how predictive and generative AI can work together effectively—ML models identify patterns and quantify risk, while LLMs translate those insights into actionable recommendations and content. The architecture is straightforward: solid feature engineering yields accurate predictions that provide context for relevant LLM outputs. It's not revolutionary, but it's practical. The modular design means you can swap components, experiment with different models, or adjust prompt strategies without rebuilding everything. If you're working on similar problems, start with your data pipeline and feature quality—everything else builds from there.

 

 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