AI/BI Genie Agents · Topic 1 of 2
Genie Agents Purpose and Setup
Databricks Data Analyst Associate: what Genie Agents are, curating Unity Catalog data, warehouse choice, instructions, example SQL and trusted assets.
- 5 min
- Genie Agents were formerly Genie spaces; they answer plain language questions with generated SQL.
- Data must be in Unity Catalog; an agent holds up to 50 tables, views or metric views.
- Only pro or serverless SQL warehouses run Genie; classic is not supported.
What it is
An AI/BI Genie Agent (formerly a Genie space) lets business users ask questions about data in plain language. Genie turns each question into SQL, runs it on a SQL warehouse and returns a table, a chart or a short text answer. Users can ask follow-up questions in the same conversation.
An analyst builds the agent for one business domain, such as sales or support. The analyst chooses the data, writes the context that explains the business, and vets the queries that must always be answered the same way.
How it works
Components of an agent
| Component | What it does |
|---|---|
| Data | Unity Catalog tables, views or metric views the agent may query, up to 50 |
| SQL warehouse | The compute that runs generated SQL; pro or serverless |
| General instructions | Text rules that apply to every question, such as fiscal year or term meanings |
| Example SQL queries | Vetted queries for common or tricky questions, optionally with parameters |
| SQL functions | Unity Catalog functions the agent can call for fixed logic |
| Join relationships and SQL expressions | Saved joins, plus named filters, measures and fields |
| Settings | Title, description, default warehouse and common questions |
Genie only queries the data attached to the agent. A table named in an instruction but not attached is never queried.
Curating the data
Keep the agent focused on one domain with a small, clean set of tables or views. Good table and column comments in Unity Catalog help Genie pick the right columns, and the agent can add its own column descriptions and synonyms. Hide columns users never need.
Views and metric views are useful when the raw tables need joins or business logic first. They also let the author expose only the columns that belong to the domain.
Choosing the SQL warehouse
A Genie Agent needs a pro or serverless SQL warehouse, and Databricks recommends serverless for performance. The author needs CAN USE on the warehouse to set it as the default.
Sample questions and instructions
Sample questions are set as common questions in the agent settings. They appear on the chat landing page and show users what the agent can answer, so they should be realistic questions the data supports.
General instructions should be short, specific and global. A rule that applies to only some questions, such as how to calculate churn, belongs in an example SQL query, a SQL function or a column comment instead.
When you create an agent, Genie Code (Databricks Assistant) can suggest table descriptions and example queries. Genie can also suggest popular queries from workspace query history, which the author accepts, edits or rejects.
Trusted assets
Trusted assets are the example SQL queries and SQL functions that the author has vetted. When Genie answers a question with one of them, the user gets a verified answer instead of newly generated SQL.
Parameters make an example query reusable. A parameter is written as a colon and a name, and has a data type such as String, Date or Integer.
-- Example SQL query: revenue for one region
SELECT order_month, SUM(revenue) AS revenue
FROM sales.gold.monthly_revenue
WHERE region = :region
GROUP BY order_month
ORDER BY order_month;
Users need EXECUTE on any SQL function used as a trusted asset. Only users with at least CAN EDIT on the agent can add or remove trusted assets.
How the exam asks about this
- "Executives must get the exact same revenue number every time they ask." Add a vetted, parameterized example SQL query as a trusted asset.
- "Genie misreads 'active customer' across many questions." Add the definition to the general instructions or as a SQL expression.
- "Which compute can a Genie Agent use?" A pro or serverless SQL warehouse, serverless recommended.
What to remember for the exam
- Genie Agents were formerly Genie spaces; they answer plain language questions with generated SQL.
- Data must be in Unity Catalog; an agent holds up to 50 tables, views or metric views.
- Only pro or serverless SQL warehouses run Genie; classic is not supported.
- Common questions on the landing page act as sample questions for users.
- Trusted assets are vetted example SQL queries (with parameters) and SQL functions.
- Keep instructions global and short; put question specific logic in example queries or functions.
Do not attach every table in a catalog "to be safe". A large, unfocused set of tables makes Genie more likely to pick the wrong table or column.
Common mistakes
Writing logic only in instructions. Long instructions that try to explain every calculation are less reliable than an example SQL query that shows the exact logic. Use instructions for global rules and example queries for specific ones.
Naming an unattached table. Genie never queries a table that is not attached to the agent, even if an instruction mentions it. Add the table or a view over it.
Expecting trusted assets to be any saved query. Only the agent's own example SQL queries and SQL functions count as trusted assets. A query saved elsewhere in the workspace is not one until it is added to the agent.
Check yourself
What makes a Genie answer a verified answer?
Genie answered with a trusted asset, which is a vetted example SQL query or SQL function that the author added to the agent.
Which SQL warehouse types can a Genie Agent use?
Pro or serverless SQL warehouses, and Databricks recommends serverless for performance.
Where should a rule that applies to only one kind of question go?
In an example SQL query, a SQL function or a column description, because general instructions apply to every question.
Topic 1 of 2 in AI/BI Genie Agents
Test yourself on AI/BI Genie Agents
The full Databricks Data Analyst Associate question bank has 600 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Databricks. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.