AI Builders: Building a text-to-SQL agent

Weights & Biases · Intermediate ·📊 Data Analytics & Business Intelligence ·1mo ago

Key Takeaways

Builds a text-to-SQL agent using LLM-powered SQL generation workflow and Marimo notebook

Original Description

Writing SQL has long been one of the biggest barriers standing between business users and the data they need. In this episode of AI Builders, we build a text-to-SQL analytics agent inside a Marimo notebook using DuckDB, Plotly, and an LLM-powered SQL generation workflow, then layer in observability and tracing and discuss what it takes to evolve the prototype into a production-ready reporting application. If you're a developer interested in building practical AI-powered analytics and reporting applications, this video is for you. Use the blog post and GitHub repo below to follow along and start experimenting. 💻 GitHub repo: https://github.com/rratshin-wandb/ai-builders 📘 Blog post: https://wandb.ai/wandb_fc/ai-builders/reports/Building-a-text-to-SQL-agent--VmlldzoxNzAyMDIwNQ NOTE from Russ: Second episode of the AI Builders series of YouTube videos "for developers who love to build and are having a great time bringing the wonders of AI into our applications." While this video does include mention of Weights & Biases products, the intro sequence should not be branded. Video will be linked to from a W&B blog post and GitHub repo. Thank you! ⏳Timestamps: 0:00 — Introduction and motivation for a text-to-SQL agent 1:39 — Diving into the agent notebook 2:08 — Overview of the project star schema and data model 2:23 — System prompt design and JSON output format 2:58 — Agent class design and function walkthrough 3:56 — Building Plotly charts from LLM-returned chart config 4:32 — Invoking the agent and inspecting results in Marimo 5:36 — Tracing and observability 6:28 — Monitoring and the path to production
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related Reads

📰
Half of Data Engineering Jobs on LinkedIn Aren't Real
Understand the discrepancy between reported data engineering job growth and actual job availability on LinkedIn
Dev.to · DataDriven
📰
Evolutionary Data Through Schemaboi: Achieving Forward, Backwards, and Sideways Compatibility
Learn how Schemaboi achieves forward, backwards, and sideways compatibility for evolutionary data through self-contained schemas in file headers
InfoQ AI/ML
📰
How Morphohack Helped Me Recover €678,000 in Lost Crypto Assets
Learn how Morphohack helped recover €678,000 in lost crypto assets using data science techniques
Medium · Data Science
📰
10 awk and sed Techniques Every Data Analyst Should Know for Data Cleaning and Transformation
Learn 10 essential awk and sed techniques for efficient data cleaning and transformation as a data analyst
Medium · Data Science

Chapters (9)

Introduction and motivation for a text-to-SQL agent
1:39 Diving into the agent notebook
2:08 Overview of the project star schema and data model
2:23 System prompt design and JSON output format
2:58 Agent class design and function walkthrough
3:56 Building Plotly charts from LLM-returned chart config
4:32 Invoking the agent and inspecting results in Marimo
5:36 Tracing and observability
6:28 Monitoring and the path to production
Up next
6-Phase SQL Roadmap 2026 | Data Analytics & Engineering | #shorts
SCALER
Watch →