We’ve bundled a list of prompts for you to copy-and-paste in our Notebook Agent.
My Holy Sh*t moment with agentic LLMs was when I started working with the vibe coding tool Lovable in the Spring of 2025 (yes, I was late to the party). With no software development background, but some industry experience as a solutions engineer, I was stunned at how easy it was to stand up a web app prototype passion project in the span of a couple of hours. 'Alright,' I thought, 'I get the hype.' This stuff is real, it’s here now, and it’s super powerful (shoutout Lovable, great Hex customer).
It wasn’t all roses, though. Working with the agent came with hiccups, ahem… bug fix death loops. And like with any new tech, I found myself mired in 30+ tabs of docs and forum posts and LLM threads on how best to work with the vibe coding agent. My natural inclination for using prompts like “just fix the damn button, don’t change anything else!” was insufficient and ineffective, and I felt like a noob.
One blog post, fervidly named The Prompting Bible, blessed be thy prompt, cleared a lot of the fog and annoyance I had with these death loops by simply giving me frameworks and examples of prompts I could use to debug. I know it sounds silly — using copy-pastable prompts with a non-deterministic model that are generalized enough to work with any project — but more than anything, the examples and best practices helped me build a mental model for working with an agent and led me to treating it more like an expert consultant and less like a code jockey. I suggest you read the Bible, but here are the quick hits that were helpful for me:
Build a broad plan with the agent; don’t sweat the small stuff initially.
Frequently ask for feedback, consult the agent on approaches, industry standards, and best practices.
Feed the agent’s words back to it — i.e., “Meta Prompting.”
When you’re actually building things, start sweating the small stuff. Be detailed and deliberate.
Don’t be afraid to revert changes and explain why. If something is consistently not working, start over.
Okay, so what does this have to do with Hex? We just released our Notebook Agent and it’s a massive step-change in the way people can do analytics and data science. You can read technical docs about it here and get a live demo in the webinar Olivia Koshy (PM of the team that built it) and I did earlier this month.
Turns out, a lot of the learnings I gathered while vibe coding are applicable to working with our Notebook Agent. That’s because our agent is not just a tool for writing code, it’s an analytical partner that knows the best industry standards for building data projects, has access to a bunch of tools that data practitioners need to do their jobs, and yeah, it’s really good at writing SQL, Python, and configuring viz.
So below, I’m writing the prompting religious text for folks who are just dipping their toes into agentic analytical workflows. If this is your first time using agents, hopefully reading this and trying it out leads to your “Holy Sh*t” moment with agentic AI.
Feel free to copy and paste sample prompts below into your Hex projects, but read this like the Pirate Code: “The code is more what you'd call 'guidelines' than actual rules.” - Captain Barbossa
Hex's Notebook Agent isn't just another chatbot, it's specifically designed for assisting with data work. The special sauce has four key ingredients:
Agentic search: It can help you discover the right data sources without you having to remember exact table names or schemas. Pretty soon, it’s also going to be able to search other elements in the Hex ecosystem: docs, projects, components, and more.
Building a plan: It translates your business questions into a structured analytical approach.
Executing analysis: It writes and runs code to transform, visualize, and model your data.
Summarizing results: It explains insights in plain language anyone can understand.
The agent acts like a seasoned data analyst sitting next to you, ready to collaborate on everything from quick exploratory analysis to complex predictive modeling.
Of course, you can use it however you want just like how you’d use any other LLM, have it write you poetry or whatever, but these are the things that make our agent different and better equipped to work with data.
You don’t need to be overly explicit in your prompts, but there is a sort of garbage-in-garbage-out paradigm with prompting. Some folks suggest starting with clear structures that break down context, tasks, guidelines, and constraints:
Structured Prompt Template
Context: You are analyzing [dataset description] to help [business objective].
Task: Perform [specific analysis type] to determine [specific question].
Guidelines: Use [techniques/methods/packages], focus on [key metrics/variables].
Constraints: The analysis must [limitations/requirements], avoid [pitfalls/assumptions].
Template for Data Clustering
Context: You are analyzing customer transaction data to help improve marketing targeting.
Task: Perform k-means clustering to segment customers based on purchasing behavior.
Guidelines: Use Python's scikit-learn, evaluate different numbers of clusters (2-10), and visualize the results with dimensionality reduction.
Constraints: Handle missing values appropriately, normalize features before clustering, and provide business interpretations for each identified segment.
Most of the time, though, you’ll prompt the Notebook Agent kind of like how you’d send a DM to a peer. That’s perfectly fine, and is how I prompt most of the time, but notice that the spirit of the structure outlined above is included in the prompt below.
Conversational Data Clustering Prompt
I'm looking at our customer transaction data and want to improve our marketing targeting. Could you help me segment our customers based on their purchasing behavior? I'd like to use k-means clustering for this. Use scikit-learn to implement the clustering. Try different cluster counts (between 2-10) to find the optimal number. Make sure to handle any missing values in the dataset appropriately, and normalize the features before running the clustering algorithm.
One of my biggest pieces of advice is to use the agent to craft a concrete plan, then feed that plan back to the agent for execution. With complex multistep analyses, agents are prone to getting lost in all the steps in front of it. Building a plan and executing step-by-step helps the agent focus on the task at hand, and gives you an opportunity to critique/refine the approach as results stream in. And once you have a plan you like, feed that back to the agent.
(Sidebar — we’re actively thinking about how to make your plans more visible to you, the user, and reduce scrolling in the thread with the agent… Stay tuned!)
Building the plan
I need to analyze customer churn for our subscription service. What data variables should I include, and what analytical approach would be most appropriate? Can you outline a step-by-step plan for this analysis?
Response from the agent
1. Exploratory Data Analysis
Churn rate trends over time, by segment, and by cohort
Feature correlation analysis and usage pattern identification
2. Feature Engineering
Create recency/frequency metrics, usage velocity changes
Rolling averages for engagement, days-to-churn calculations
3. Predictive Modeling
Logistic regression for interpretability, random forest for feature importance
Time-to-churn survival analysis for more nuanced insights
4. Actionable Segmentation
Risk scoring (high/medium/low churn probability)
Intervention timing recommendations
Executing the plan
Great, let's proceed with the first step:
Exploratory Data Analysis
Churn rate trends over time, by segment, and by cohort
Feature correlation analysis and usage pattern identification
In a vacuum, the prompt is important, but the team intentionally built the Notebook Agent to be deeply integrated with Hex’s environment. That means you can scope context deliberately, like which tables and dataframes to use or which cells to edit. Scoping context helps the agent focus on the right stuff. When you know what data you need, @ tag the relevant table:
@ tagging data
Meh: "Analyze the customer data."
Good: "Analyze the @customer_transactions table, focusing on the relationship between 'purchase_frequency' and 'customer_lifetime_value' columns."
Or when you want to make changes to a specific cell, scope it in:
@ tagging cells
Meh: "Adjust the model so it prioritizes the recent explosive growth we saw in the past 6 months"
Good: "[@Prophet Model Components Analysis] Edit this cell where we define the parameters of the Prophet model so it prioritizes the recent explosive growth we saw in the past 6 months"
If you know the exact approach you want to take in an analysis, clearly state the analytical techniques, models, or packages you want to use. Remember, you don’t need to know everything. If you want suggestions, just ask the model for its advice first, then narrow down the plan.
Example
Meh: "Predict customer churn."
Good: "Build a random forest classifier to predict customer churn, using feature importance to identify the top factors contributing to churn."
Analysis for analysis's sake is a fool’s errand. The agent can help you reason about actionable next steps that your stakeholders and decision makers really want to know.
Example
Meh: "Analyze marketing channel performance."
Good: "Analyze marketing channel ROI to determine which channels to increase investment in for our Q4 campaign planning. Consider both acquisition cost and customer lifetime value by channel."
Many businesses have structured processes and rules for how to do data work. Think things like: coding conventions, color palettes, analytical techniques, data structures, compliance requirements, etc. Your Hex Workspace has a rules file that applies to every agent interaction in the Workspace that essentially acts as injected context to the agent. Below is an example of Hex’s internal rules file (with some private stuff stripped out).
Example
# AwesomeCo Analytics Workspace Rules
## Critical Data Governance
- PII Handling: Mask email domains in all outputs (show user@****.com)
- EU Data: Filter WHERE consent_status = 'granted' for GDPR compliance
- Financial Access: Only use finance.* tables for board reports
- Test Accounts: Always exclude WHERE is_internal = false AND email NOT LIKE '%@dataco.com'
## Source of Truth Tables
- Customers: warehouse.customers_dim (updates 2am UTC daily)
- Subscriptions: billing.active_subscriptions_v2 (v1 deprecated Nov 2024)
- Usage Events: events.user_actions_cleaned (raw has duplicates)
- Revenue: finance.recognized_revenue (not billing.charges)
- Marketing: marketing.campaigns_attributed (30-day window)
## Business Definitions
- MRR: Sum of monthly_amount WHERE status IN ('active', 'paused')
- Active User: 3+ sessions in rolling 30 days, exclude internal
- Churn Date: First day of month after last payment
- LTV: Revenue until churn / (1 - gross_margin), GM = 0.75
- Qualified Lead: Score > 50 AND company_size > 10
## Calculations & Logic
- Fiscal Year: Feb 1 - Jan 31 (Q1 starts February)
- Cohorts: By signup_week, weeks start Monday
- Attribution: First-touch for acquisition, multi-touch for expansion
- Exchange Rates: Use finance.exchange_rates for month-end conversion
- Growth Rates: Month-over-month using compound formula, not simple
## Required Analysis Patterns
- Time Comparisons: Always show YoY and MoM together
- Segments: Break down by plan_type (Starter/Pro/Enterprise)
- Statistical Significance: Min 100 samples for A/B tests
- Forecasting: Use 13-week rolling average for baseline
- Anomaly Detection: Flag if metric deviates >2 std from 30-day mean
## Data Quality Warnings
- orders table: 2% duplicate rows, use orders_deduped
- user_attributes: NULL company_size for 30% of records pre-2024
- revenue_forecast: Only reliable 30 days out
- marketing_spend: Delayed by 3 days, note in analyses
## Stakeholder Preferences
- Executive Reports: Focus on trends not absolute numbers
- Sales Team: Include pipeline_stage breakdown
- Product Team: Segment by feature_flag exposure
- Finance: Show both GAAP and billing revenue
## Industry Context
- Benchmarks: Target 125% NDR (industry avg: 110%)
- Seasonality: Q4 -20% new sales, Q1 +35% (budget cycles)
- Competition: We're 2x pricing of alternatives, emphasize ROI
- Market Position: #3 by revenue, #1 by NPS in our segment
The agent is basically an expert analyst/data scientist that knows industry standard analytical and data science techniques. Often times, you might want to start by asking the agent to suggest some approaches on a type of analysis, or explain how some technique works. Treat the agent like a knowledgable peer; it’s eager to help you learn while you’re building.
Example
[@Prophet Model Components Analysis] Can you describe what each of these configs/parameters in this Prophet model do?
Finally, I’m going to share some of the prompts we’re using for various things internally at Hex and some prompts you can use to help recreate the projects we have listed in our Templates page from scratch. Feel free to copy/paste these into your projects, and tag us on social (X: @hex_tech \ LI: Hex) with the cool stuff you build!
The Notebook Agent can help you explore your data warehouse and semantic models without needing to remember exact schemas or table names. This is useful when you’re working across unfamiliar domains or want to find the best source of truth for a metric.
How to use it
Ask the Agent to look up semantic objects, tables, schemas, and column definitions that might be relevant to your question. You can also have it suggest which tables to join, or flag potential duplicates in the warehouse.
Sample prompt
Help me discover data in the warehouse related to churn. List relevant semantic models, schemas, and tables. Summarize what metrics and columns they contain, and recommend the best starting points for analysis.
💡pro tip! The better documented your metadata is, the better the agent will perform at data discovery (and all other tasks). Add metadata manually in the [data browser] or in dbt/snowflake.
When working in longer notebooks, it’s easy to end up with unused or duplicative cells. The Notebook Agent can help streamline cleanup by analyzing dependencies and surfacing which cells are critical versus safe to remove. This gives you confidence before deleting anything and helps keep notebooks lean.
Editor’s note: I’m rooting for a feature that natively renders Hex’s Graph DAG to do this… If you like that too, let us know and make our dreams reality.
How to use it
Ask the Agent to scan your notebook, identify irrelevant or unused cells, and generate a quick dependency graph. This shows which cells feed downstream outputs, which are redundant, and which don’t connect anywhere. Use the results to decide what to delete or consolidate.
Sample prompt
Analyze this notebook for cleanup.
1. Scan all cells and flag any that appear unused, irrelevant, or duplicative.
2. Map the dependency graph of cells (which depend on which).
3. Highlight orphaned cells (not used anywhere downstream), duplicative calculations, or intermediate steps that don’t feed final outputs.
4. Give me a concise summary of which cells are safe to delete, which are candidates for consolidation, and which are critical to keep.
Sometimes you get a project shared with you by a teammate, and you have a vague idea of what they’ve built, but the project contains hundreds of cells and you just want to get a quick summary of what you’re looking at. Ask the Agent to build you a summary.
Sample prompt
This project was just shared with me by a teammate. Can you summarize the approaches they took in this analysis and any insights gleaned from the results?
This project was just shared with me by a teammate. Can you summarize the approaches they took in this analysis and any insights gleaned from the results?
When starting a follow-on or related analysis, it’s useful for the Agent to begin with context from a prior notebook. Instead of re-explaining everything, you can have the agent generate a portable prompt that you paste into your new notebook. This “seeds” the agent with definitions, assumptions, and prior steps so it can collaborate with you on what you’re working on now.
To do this, run a prompt in the source notebook asking the agent to produce a portable context block. Then paste that into a new notebook to give the agent the background it needs for your next analysis.
Prompt A (run in the source notebook)
Analyze this notebook and generate a portable context prompt I can paste into a new notebook. The prompt should:
- Restate the core business question in plain English
- Define each key metrics, dataframes, and calculations precisely (filters, windows, denominators)
- Summarize the data sources (tables, views) with example names
- Note important assumptions (freshness, grain, joins)
- Highlight the main outputs and conclusions so far
- End with “Context Notes” about what might be adapted or extended
Output only the portable prompt in a single code block.
Prompt B (run in the new notebook)
Seed context:
[Portable prompt from Prompt A goes here]
Use this context as background for my current analysis.
Work with me on follow-up or related questions, and suggest how I can
extend or adapt the prior work as needed.
Preface: I’ll admit the prompts below are a little bit of AI slop. But I personally found these to be helpful for crafting quick custom demos for customers, and they get pretty close to recreating some of the projects we have listed on our Templates page. I’m providing two examples for each category, one for basic prototyping, and another when I need a specific solution.
Basic prompt
Cluster our customer data into meaningful segments using k-means. Use RFM (Recency, Frequency, Monetary value) as the main features and determine the optimal number of clusters using the elbow method. Visualize the clusters and describe the characteristics of each segment.
Advanced prompt
Perform hierarchical clustering on our customer dataset with the following requirements:
1. Preprocess the data by handling outliers using IQR method
2. Standardize all features
3. Use Ward's method with Euclidean distance
4. Determine optimal clusters using silhouette score and dendrogram visualization
5. Compare results with k-means and DBSCAN approaches
6. Create cluster profiles describing key characteristics
7. Recommend marketing strategies for each identified segment
Basic prompt
Can you help me analyze customer lifetime value for our business? I'd like to understand which customer segments are most valuable over time and what factors might influence their long-term value to us. What would be a good approach to look at this?
Advanced prompt
Develop a predictive model for customer lifetime value with these specifications:
1. Create engineered features from purchase history, browsing behavior, and customer demographics
2. Handle class imbalance using SMOTE
3. Implement a gradient boosting model (XGBoost) with hyperparameter tuning
4. Use 5-fold cross-validation with stratification
5. Compare performance against a baseline random forest model
6. Evaluate using precision-recall AUC, confusion matrix, and business impact metrics
7. Implement feature importance analysis and partial dependence plots for interpretability
Basic prompt
Create visualizations that show the relationship between marketing spend and revenue across different channels.
Advanced prompt
Design an interactive geospatial heatmap showing customer density by region using Folium. Use a red to green gradient, highlight customer counts and summary statistics in the tooltip.
Basic prompt
Perform exploratory data analysis on our customer dataset. Include summary statistics, distribution of key variables, correlation analysis, and identify any potential outliers or data quality issues.
Advanced prompt
Conduct a comprehensive exploratory analysis of our e-commerce transaction data with:
1. Data quality assessment (missing values, outliers, duplicates)
2. Univariate analysis of all numerical and categorical features with appropriate visualizations
3. Bivariate analysis focusing on relationships between purchase amount and customer attributes
4. Temporal patterns in purchasing behavior (daily, weekly, monthly trends)
5. Cohort analysis based on customer acquisition date
6. Segmentation analysis based on purchasing behavior
7. Anomaly detection to identify unusual transactions
8. Feature engineering suggestions for future modeling
Basic prompt
Analyze our ecommerce data to calculate key metrics including conversion rate, average order value, customer acquisition cost, and lifetime value. Create visualizations to show how these metrics have changed over the past year.
Advanced prompt
Perform a comprehensive ecommerce analysis with these components:
1. Calculate and trend key performance indicators (AOV, CVR, CAC, LTV, ROAS)
2. Analyze the customer journey with funnel visualization from product view to purchase
3. Segment customers using the RFM (Recency, Frequency, Monetary) framework
4. Perform market basket analysis to identify cross-selling opportunities
5. Analyze product affinity and build a recommendation algorithm
6. Create a cohort analysis of customer retention by acquisition channel
7. Forecast demand for top 10 products for the next quarter
8. Identify underperforming products and potential inventory issues
Basic prompt
Create a cohort analysis to track user retention over time. Group users by signup month and show retention rates for the following 6 months. Visualize the results as a heatmap.
Advanced prompt
Develop a multi-dimensional cohort analysis framework with:
1. Time-based cohorts (acquisition date) with 12-month retention tracking
2. Behavioral cohorts based on first action (purchase vs. trial)
3. Channel-based cohorts comparing retention across marketing channels
4. Monetary cohorts comparing high vs. low initial purchase value
5. Custom cohort based on product category of first purchase
6. Calculate and visualize not just retention but also average revenue per cohort over time
7. Statistical significance testing between cohort performance
8. Predictive model to identify early indicators of long-term retention
Basic prompt
Perform market basket analysis on our transaction data to identify products that are frequently purchased together. Use the Apriori algorithm with a minimum support of 0.01 and minimum confidence of 0.5. Visualize the top 10 rules.
Advanced prompt
Conduct a comprehensive market basket analysis with these specifications:
1. Use the FP-Growth algorithm for better performance on our large transaction dataset
2. Optimize support and confidence thresholds through iterative testing
3. Filter rules by lift > 3 to focus on meaningful associations
4. Create network visualization of product relationships
5. Segment analysis by customer type and purchase time (weekday vs. weekend)
6. Generate specific product bundle recommendations for marketing campaigns
7. Compare seasonal variation in product association patterns
8. Implement sequential pattern mining to identify common purchase sequences
Basic prompt
Perform feature selection for our churn prediction model. Use a combination of correlation analysis, variance inflation factor, and recursive feature elimination to identify the most important predictors of customer churn.
Advanced prompt
Implement a comprehensive feature selection pipeline with:
1. Statistical filtering (remove features with >90% missing values and near-zero variance)
2. Multicollinearity analysis using VIF with threshold of 5
3. Filter methods (chi-square for categorical, ANOVA F-value for numerical features)
4. Wrapper methods (RFE with cross-validation)
5. Embedded methods (L1 regularization, tree-based importance)
6. Stability selection across multiple subsamples
7. Compare model performance across different feature subsets
8. Create importance visualizations and document feature selection justifications
Basic prompt
Create the backend for a KPI dashboard for our sales team showing monthly revenue, sales growth, conversion rate, and top-performing products. Include year-over-year comparisons.
Advanced prompt
Design the backend to an executive KPI dashboard with these specifications:
1. Strategic layer: Company-wide KPIs with targets and variance (revenue, profit, customer growth)
2. Tactical layer: Department-specific metrics to be used with drill-down capabilities
3. Operational layer: Daily/weekly performance indicators that we can set conditional notifications on
4. Predictive elements showing forecasted performance against targets
5. Benchmark comparisons against industry standards where available
Basic prompt
Analyze our customer reviews using NLP techniques. Extract common themes and sentiments, identify the most frequently mentioned product features, and visualize the results.
Advanced prompt
Develop a comprehensive NLP pipeline for customer feedback analysis:
1. Preprocess text data (tokenization, lemmatization, stop word removal)
2. Implement sentiment analysis using a fine-tuned BERT model
3. Extract named entities (products, features, competitors) using spaCy
4. Perform topic modeling with BERTopic to identify evolving themes
5. Create aspect-based sentiment analysis for specific product features
6. Generate word embeddings to map semantic relationships
7. Implement trend analysis to track sentiment changes over time
8. Build an interactive visualization dashboard for exploring feedback insights
Basic prompt
Perform sentiment analysis on our customer support conversations. Categorize messages as positive, negative, or neutral, and identify common themes in negative feedback.
Advanced prompt
Implement a multi-layered sentiment analysis framework:
1. Use a fine-tuned transformer model for domain-specific sentiment classification
2. Implement aspect-based sentiment analysis to identify specific product/service elements
3. Analyze sentiment trends over time and correlate with product releases
4. Perform emotion detection beyond simple positive/negative (joy, anger, frustration)
5. Implement sarcasm and irony detection for more accurate sentiment scoring
6. Create customer sentiment profiles based on interaction history
7. Generate actionable insights and recommendations from sentiment patterns
8. Build an alert system for sudden sentiment shifts requiring immediate attention
Basic prompt
Analyze our sales time series data to identify trends, seasonality, and anomalies. Then forecast sales for the next 6 months using an appropriate time series model, accounting for historical patterns.
Advanced prompt
Implement an advanced time series analysis framework:
1. Decompose multiple time series into trend, seasonal, and residual components
2. Test for stationarity and apply appropriate transformations
3. Identify and handle outliers and structural breaks
4. Implement multiple modeling approaches (SARIMA, Prophet, exponential smoothing)
5. Add exogenous variables (marketing spend, promotions, competitor actions)
6. Perform cross-validation using time series split
7. Generate prediction intervals with varying confidence levels
8. Implement ensemble forecasting combining multiple models
9. Design interactive visualization for exploring forecasts with different parameters
This is a lot of text that basically translates to “build a plan and be deliberate.” Effective prompting for Hex's AI agent comes down to clear communication, structured thinking, and iterative refinement. Remember that the best results come from a partnership between your domain expertise/institutional knowledge and the AI's analytical and reasoning capabilities. You guide the analysis with well-crafted prompts, and the AI executes the technical work to help you reach conclusions faster.
If there’s anything glaringly obvious that I missed here, or you’re really proud of the agentic work you created in Hex, reach out to me here: ([email protected]). Happy Hex-ing!