Empowering Data Teams: Smarter AI Workflows with Hex & MotherDuck
2025/11/14TL;DR: Learn how to build AI-powered analytics workflows using MotherDuck and Hex—including generating column descriptions with AI, semantic modeling, and creating a "compounding context engine" that improves over time.
The Key Insight: Context is King
LLMs don't know your business data. The most important thing for accurate AI analytics is building context:
- Column descriptions in your database
- Semantic models defining business metrics
- Rules files with business logic and SQL styling
- Endorsed assets marking trusted tables
Generating Column Descriptions with AI
MotherDuck's prompt() function generates descriptions directly in SQL. The workflow involves:
- Getting a table summary for AI context
- Generating AI descriptions focused on business purpose
- Applying descriptions to your schema with COMMENT statements
Pro tip: Tell the AI to focus on business purpose, not statistics. Avoid descriptions like "contains integers from 1-100"—that's already in the schema.
Read Scaling for Concurrent Users
MotherDuck's read scaling gives each Hex user their own DuckDB instance:
- Configure in Settings → Instance Size
- Choose fleet size (up to 16 ducklings)
- Eliminates noisy neighbor problems
- Pay only for what you use
Hex's Three Pillars for AI Workflows
1. Agentic Notebook Agent
For data teams (SQL/Python savvy):
- Cursor-like experience in notebooks
- Creates, edits, modifies cells automatically
- Builds execution plans for complex analyses
2. Conversational Self-Serve (Threads)
For business users:
- Chat interface—no code visible
- References existing assets (dashboards, models)
- Everything is notebook-backed (can convert threads to projects)
3. Semantic Modeling Workbench
Build trusted metrics and dimensions:
- AI-assisted semantic model creation
- Define joins, relationships, business logic
- Models become context for LLMs
Demo: From Question to Dashboard
User prompt: "Break down our marketing opportunities"
What happens automatically:
- Fuzzy search finds related dashboards
- Loads semantic model definitions
- Runs 20+ iterative SQL queries
- Creates charts, pivot tables, insights
- Generates a complete notebook
Converting to production:
- Thread → Project (for data team review)
- Project → Dashboard (drag-and-drop app builder)
- Dashboard → Semantic Model (close the loop)
Context Studio: Monitoring & Improvement
Track how users interact with AI:
- Conversation volumes and top users
- Actual prompts being submitted
- Which queries hit semantic models vs raw tables
- Identify hallucinations and gaps
Rules files allow you to define business definitions (like what "Revenue" or "Active customer" means) and SQL style preferences in markdown format.
Best Practices
| Practice | Why |
|---|---|
| Add column descriptions first | Easiest win, 5 minutes of work |
| Note join keys in descriptions | LLMs struggle with joins |
| Semantic models by department | Sales, Marketing, Operations |
| 6-10 tables per semantic model | Avoid monolithic models |
| Start with gold tables, add rails later | Iterate based on user questions |
Related Videos
2026-01-21
The MCP Sessions - Vol 2: Supply Chain Analytics
Jacob and Alex from MotherDuck query data using the MotherDuck MCP. Watch as they analyze 180,000 rows of shipment data through conversational AI, uncovering late delivery patterns, profitability insights, and operational trends with no SQL required!
Stream
AI, ML and LLMs
MotherDuck Features
SQL
BI & Visualization
Tutorial
2026-01-13
The MCP Sessions Vol. 1: Sports Analytics
Watch us dive into NFL playoff odds and PGA Tour stats using using MotherDuck's MCP server with Claude. See how to analyze data, build visualizations, and iterate on insights in real-time using natural language queries and DuckDB.
AI, ML and LLMs
SQL
MotherDuck Features
Tutorial
BI & Visualization
Ecosystem


