Quill
Make semantic layer AI friendly

CLI

Make semantic layer AI friendly

Copies the Quill CLI's install command: curl -fsSL https://quill.co/install.sh | shView as MarkdownThe whole page, as plain Markdown.

1. Create the virtual table

quill schema create --name transactions \
  --sql "SELECT id, organization_id, category, status, amount, created_at FROM public.orders" \
  --tenant-fields organization_id

2. Give columns business names

quill schema update --name transactions \
  --sql "SELECT id AS order_id, organization_id, category AS product_line, status AS order_status, amount AS order_total_usd, created_at AS ordered_at FROM public.orders" \
  --tenant-fields organization_id

3. Describe the business logic

quill schema update --name transactions \
  --description "One row per order. order_total_usd is the order total in US dollars. Revenue is the sum of order_total_usd for orders whose order_status is 'completed'. Refunded and processing orders never count as revenue." \
  --tenant-fields organization_id

4. Ask the agent

# The agent reads the description
quill schema show --name transactions

# and filters revenue to completed orders
quill report create --dashboard Sales --name "Monthly revenue by product line" \
  --datasources transactions \
  --group-rows-by transactions::ordered_at --date-bucket month \
  --group-columns-by transactions::product_line \
  --aggregations sum:transactions::order_total_usd \
  --filters transactions::order_status=completed \
  --chart-type stacked \
  --date-field transactions::ordered_at \
  --dashboard-filters Category=transactions::product_line