Skip to content

motherduckdb/analytics-agent-duckdb-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL is Dead, Long Live SQL : Engineering reliable analytics agents from scratch

PyCon DE & PyData 2026 — April 14, 11:45, Dynamicum [Ground Floor] 90-minute hands-on tutorial by Mehdi Ouazza and Dumky de Wilde

Repo structure

workshop/                      <-- START HERE
├── duckoffee.duckdb           # Dataset: a coffee-shop chain across 13 cities
├── skill.md                   # Agent instructions (semantic layer)
├── pyproject.toml             # Python deps: duckdb, pydantic-ai, fastmcp, openai
├── Makefile                   # make setup
└── (your code)                # agent_loop.py, agent_tools.py, mcp-server/, …

solutions/                     # Reference implementations for every part

site/                          # Slide deck (Next.js → GitHub Pages)
└── src/content/*.mdx          # One MDX file per part

.devcontainer/                 # Codespace / devcontainer (Python, uv, opencode)

All exercises happen inside workshop/. Clone the repo, cd workshop, and follow the slides.

Get started

1. Clone

git clone https://github.com/motherduckdb/analytics-agent-duckdb-workshop.git
cd analytics-agent-duckdb-workshop/workshop

2. Install tools

You need Python 3.10+, uv, and opencode:

# uv (fast Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh

# opencode (agentic CLI)
curl -fsSL https://opencode.ai/install | bash

# workshop Python deps
uv sync

3. Get your model key

Pick one:

Option How
MotherDuck-minted key (recommended) Go to motherduck.com/minter — pre-funded, no signup hassle
Bring your own key OpenRouter, Anthropic, or OpenAI — any provider that speaks the OpenAI chat API
export OPENROUTER_API_KEY="sk-or-v1-..."

4. Verify

python3 --version   # 3.10+
uv --version
duckdb --version
opencode --version

Bonus: Devcontainer (zero local install)

Don't want to install Python/uv/opencode? Open the repo in a GitHub Codespace — everything is pre-installed, you just bring your key.

gh codespace create --repo motherduckdb/analytics-agent-duckdb-workshop

Workshop outline

Part Topic Time
1 DuckDB from Python 10 min
2 Text-to-SQL & the agentic loop 15 min
3 Context: skill file + COMMENT ON 15 min
4 Deterministic tools with PydanticAI 20 min
5 Distribute via FastMCP 15 min

Links

License

Workshop materials for PyCon DE & PyData 2026.

About

Engineering reliable analytics agents from scratch with DuckDB, MCP and a semantic layer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors