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 foundation is three CatBoost models handling different prediction tasks:
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.
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.
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.
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.
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.
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.
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.
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.