Create the Bakehouse Sales Assistant
A dashboard answers the questions that you planned for. A Genie Agent answers ad hoc questions. A Genie Agent is a domain-specific chat interface where business users ask questions in natural language, such as "Which franchise sells the most?", and the agent returns the SQL query, a results table, and a visualization. Point it at the same franchise_sales_metrics metric view, and it answers from the same measure definitions that the dashboard uses. Genie Agents were formerly known as Genie Spaces.
Previous page | What carries forward |
|---|---|
The governed |
Requirements
Confirm the following before you start:
- Partner-powered AI features enabled for the account and the workspace. An account admin manages this. See Partner-powered AI features.
- The Databricks SQL workspace entitlement.
CAN USEon a pro or serverless SQL warehouse.SELECTon the data that the agent uses. The data must be registered in Unity Catalog.CAN EDITon the agent to change its settings. Agent creators haveCAN MANAGE.
Create the agent
Create the agent on the metric view, then set its title, instructions, and common questions before you share it.
Start a new agent
Click Genie Agents in the sidebar, and then click New in the upper-right corner.
Connect the metric view
In the data dialog, browse to starterjourney_catalog > bakehouse_gold, select franchise_sales_metrics, and then click Create.
The metric view already carries the join and the franchise field, so you don't need to add the silver tables separately. Genie Code launches automatically when you create an agent. It reads the data and suggests context, such as table descriptions and example queries. Review the suggestions, and keep the ones you want.
Set the title and warehouse
Click Configure > Settings. Set Title to Bakehouse Sales Assistant, and set Default warehouse to a SQL warehouse, such as Starter Warehouse.
The agent embeds the warehouse's compute credentials, so that all users can reach the warehouse. Unity Catalog still evaluates data access with each user's own permissions.
Describe the agent
In Configure > Settings, edit Description to explain what the agent does, what it can answer, and what it can't. The description supports Markdown.
Add general instructions
Open the Instructions panel, and add these general instructions:
"Sales" and "revenue" both mean Total Sales. Use Sales Date as the time dimension for any trend or over-time question. Franchise means the franchise name. When asked for the top or best franchise, rank by Total Sales.
The metric view already has the synonyms revenue and sales for total sales, and AOV for average order value. Keep the ranking and time-dimension rules in the instructions, because a field name can't express them. Best practices recommend text instructions only when SQL expressions and example queries can't express the rule.
Add common questions
In Configure > Settings, add these to Common questions:
- Which franchise had the highest total sales?
- What are total sales by product?
- Show total sales by day.
Validate an answer
In the chat, ask: "Which franchise had the highest total sales?" Confirm that the top franchise matches the top bar in the franchise chart on your dashboard.
Share the agent
Click Share, and enter the group of business users who need the agent, such as data-analysts-starter-journey. Click Add, and set its permission level to CAN RUN for business users. Curators need at least CAN EDIT to change instructions, and CAN MANAGE to monitor conversations. Then click Copy link.
Troubleshooting
These entries cover access, the permissions that shared users need, and answers that differ from the dashboard.
Genie is unavailable or disabled
Partner-powered AI features must be enabled for the account and the workspace. An account admin controls this setting.
A shared user gets an empty answer
Data access uses the viewer's own Unity Catalog identity. A question about data that the user can't access returns an empty response. Grant SELECT on franchise_sales_metrics. Users don't need SELECT on the source tables that it reads.
The answer disagrees with the dashboard
Both surfaces read the same metric view, so check the question's time window and any filters on the dashboard. If Genie keeps choosing the wrong field, add an instruction that names the field.
Next steps
-
- Organize assets with domains, subdomains, and Pages
- Organize the dashboard and the agent with a domain, a subdomain, and Pages
-
- Genie Agents
- Learn how to set up, tune, monitor, and share Genie Agents