WebinarAI, ML and LLMs

Empowering Data Teams: Smarter AI Workflows with Hex & MotherDuck

2025/11/14

TL;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:

  1. Column descriptions in your database
  2. Semantic models defining business metrics
  3. Rules files with business logic and SQL styling
  4. 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:

  1. Fuzzy search finds related dashboards
  2. Loads semantic model definitions
  3. Runs 20+ iterative SQL queries
  4. Creates charts, pivot tables, insights
  5. 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

PracticeWhy
Add column descriptions firstEasiest win, 5 minutes of work
Note join keys in descriptionsLLMs struggle with joins
Semantic models by departmentSales, Marketing, Operations
6-10 tables per semantic modelAvoid monolithic models
Start with gold tables, add rails laterIterate based on user questions

Related Videos

"The MCP Sessions - Vol 2: Supply Chain Analytics" video thumbnail

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

" The MCP Sessions Vol. 1: Sports Analytics" video thumbnail

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

"Building a Serverless Lakehouse with DuckLake" video thumbnail

2025-12-26

Building a Serverless Lakehouse with DuckLake

In this hands-on workshop, Jacob Matson walks through building a serverless lakehouse from scratch using DuckLake.

Webinar

Tutorial