All products

Write MotherDuck queries with AI

Turn a reporting question into DuckDB SQL and check the result against a known example. Keep the metric definition and join assumptions visible.

Write MotherDuck queries with AI once the number you need has an agreed meaning. Gross order value and cash retained after refunds can both be called sales in conversation. A query might run perfectly and still answer the wrong question. Ask for the measure in words before looking at the SQL.

The motherduck-query skill helps an agent write and inspect queries for the actual database. A small, known reporting period gives you a practical check on joins and filters. If one order becomes three rows after a join, that can be correct for item analysis and costly for a revenue total.

What it does

  • Translate an agreed metric into a query
  • Compare row counts before and after a join
  • Find the reason for a missing or unexpected result
  • Limit the test to a manageable period
  • Inspect a query for unnecessary work before repeating it

Install and use

  1. Use a compatible agent with authorised MotherDuck access. Read permission is sufficient for a standard report. Optional AI functions can send selected inputs to separate providers such as TypeSafe and may incur charges.
  2. Ask, “Calculate net sales for this known trading day. Show the number of orders and line items and explain how refunds enter the total.”
  3. Compare the result with the approved daily figure. If it differs, inspect intermediate rows before extending the query to a whole year.

FAQ

Source

Made by MotherDuck. Original skill: motherduck-query, published on GitHub under the MIT licence.

View on GitHub