Genie Agents (Natural-Language Q&A)
Databricks · Databricks SQL & BI
Theory
A Genie Agent (called a Genie space until mid-2026, and listed as AI/BI Genie in older material) lets business users ask questions about data in plain English and get answers as SQL results and charts. An analyst sets it up for one subject area: they add the Unity Catalog tables or metric views, write instructions (business terms, such as "FY starts in April" or "active customer means an order in the last 90 days"), and add example SQL queries for tricky questions. Genie then turns each question into SQL, runs it on a SQL warehouse with the user's permissions, and shows the query so answers can be checked. Benchmarks and user feedback help the author improve accuracy.
Example: Priya, a regional manager, asks the Sales agent "top 3 cities by sales last month for Enterprise customers" and gets a table and bar chart without writing SQL.
Why we use it
Dashboards answer only the questions someone planned for. Genie Agents let non-technical users ask follow-up questions themselves, on governed data, while the data team controls the tables, definitions and example queries behind the answers.
When to use it
Use a Genie Agent for a focused domain with clean, well-described tables and clear business terms. Do not point it at hundreds of raw tables. For fixed KPIs everyone views daily, a dashboard is better; Genie complements dashboards for follow-up questions.
How it works
- Genie Agents → New
- Pick tables such as main.sales.orders and customers, click Create
- Add instructions, business terms and example SQL
- Test with real questions
- Are answers correct? Yes: Share the agent with business users. No: Add instructions or example SQL and retest.
- Review feedback and benchmarks regularly
Syntax
UI: Genie Agents → New → choose data sources → Create
Configure → Data (tables) | Settings (title, default warehouse, sample questions)
Instructions: text instructions, example SQL queries, SQL expressions → Share
Needs: pro or serverless SQL warehouse, SELECT on the dataExample
-- Example SQL added to the agent's instructions for "repeat customers"
SELECT c.city, COUNT(DISTINCT o.customer_id) AS repeat_customers
FROM main.sales.orders o
JOIN main.sales.customers c ON o.customer_id = c.customer_id
WHERE o.customer_id IN (
SELECT customer_id FROM main.sales.orders
GROUP BY customer_id HAVING COUNT(*) > 1)
GROUP BY c.city;
-- Text instruction examples:
-- 'Sales' means SUM(orders.amount) in INR.
-- Financial year starts on 1 April.
-- Segment values are Retail, SME, Enterprise.Key points
- Former name: Genie spaces (AI/BI Genie); renamed to Genie Agents in 2026
- Keep each agent focused on a small set of related, well-commented tables
- Instructions and example SQL improve accuracy more than adding more tables
- Users need access to the agent and SELECT on the underlying data
- Every answer shows the generated SQL so it can be checked
- Use benchmarks and thumbs up/down feedback to tune the agent