TL;DR: Guides are versioned markdown docs stored in your MotherDuck warehouse that give AI agents business context automatically. The agent reads the guide before writing SQL, and context matters more than model size for accuracy.
Why agents need context in the warehouse
Point an AI agent at a database and it'll guess what your business terms mean. Garrett and Bev walk through how MotherDuck handles this: Guides are versioned markdown documents that live inside your warehouse as database objects, queryable in SQL. Think of them as a README for a new hire, except the agent actually reads them. Every natural language query that comes through the MotherDuck MCP server checks the guide before writing SQL, so you don't have to remember to point your agent at a YAML file or a skill.
Context beats model size
On the DABStep benchmark — hundreds of hard multi-step analytics questions — providing context about the data pushed correctness to nearly 100%, using a cheap Gemini Flash-class model rather than a frontier one. A smaller model with good context outperforms a bigger model without it. Bev also reports roughly 90th-percentile consistency when swapping between different agents that share the same guide.
How guides are organized
Topics work like folders. Organization-level guides hold shared definitions (MRR, churn, etc.), user-level guides hold personal preferences and experiments, and topics can nest. Reserved topics for flights/ and dives/ keep pipeline context separate from query context. Agents can write back into guides too — Bev has hers log every inference and assumption to a personal guide section so a human can review them and promote the good ones to the org level.
Manage guides as code
Guides are plain markdown, so git and CI work out of the box. Open a PR and a user-scoped copy of the guide deploys for testing; merge, and a GitHub Action pushes the org-level guide with the md_update_guide SQL function. The MCP workflows docs cover how agents connect. The demo walks through the full loop: a revenue question answered wrong without a guide, a guide defining cost-of-goods-sold rules, and the same question answered correctly after.



