What is an AI/BI Genie space

This article introduces AI/BI Genie, an Azure Databricks feature that allows business teams to interact with their data using natural language. It uses generative AI tailored to your organization’s terminology and data, with the ability to monitor and refine its performance through user feedback.

Overview

Domain experts, such as data analysts, configure Genie spaces with datasets, sample queries, and text guidelines to help Genie translate business questions into analytical queries. After set up, business users can ask questions and generate visualizations to understand operational data. You can continuously update Genie’s semantic knowledge as your data changes and users pose new questions. For additional information about DatabricksIQ, see DatabricksIQ-powered features.

AI/BI Genie selects relevant names and descriptions from annotated tables and columns to convert natural language questions to an equivalent SQL query. Then, it responds with the generated query and results table, if possible. If Genie can’t generate an answer, it can ask follow-up questions to clarify before providing a response.

Example use cases

You can create different Genie spaces to serve various non-technical audiences. The following scenarios describe two possible use cases.

Example 1: Visualize opportunity status

A sales manager wants to get the current status of open and closed opportunities by stage in their sales pipeline. They can interact with the Genie space using natural language and automatically generate a visualization.

The following gif shows this interaction:

Gif with sample question, response, and auto-generated visualization

Example 2: Tracking logistics

A logistics company wants to use Genie spaces to help business users from different departments track operational and financial details. They set up a Genie space for their shipment facility managers to track shipments and another for their financial executives to understand their financial health.

How Genie generates a response

Genie uses a compound AI system to interpret business questions and generate answers. Instead of using AI models, which are simple statistical models, compound AI systems process tasks in AI applications by combining multiple interacting components. Compound AI systems are an increasingly common design pattern for AI applications because of their performance and flexibility. For more information, see The Shift from Models to Compound AI Systems .

When a user submits a question, Genie parses the request, identifies relevant data sources, and determines how to respond to the prompt. The instructions you provide, combined with Unity Catalog metadata, allow Genie to infer both business and technical logic. Genie intelligently filters example SQL queries, table and column metadata, and chat history to select the most relevant information for answering the request.

Genie uses the following components to generate responses:

  • Table metadata: Includes table names, descriptions, and defined primary key (PK) and foreign key (FK) relationships. Genie uses this data as it parses the request and converts the natural language prompt to SQL.
  • Column names and descriptions: Genie intelligently filters for relevant column names and descriptions to include.
  • Example SQL queries: Genie intelligently selects relevant SQL examples from Instructions.
  • SQL functions: All SQL functions that have been added in the space.
  • Instructions: The plain-text notes provided as General instructions are included as context.
  • Prompt and responses history: Prompts and responses from the current chat are included as context. If necessary, because of set token limits, the oldest parts of the chat record are excluded.

Note

Some table details, such as the owner and table size, are not included by default. To access this information, you can use views from the information schema available for all Unity Catalog catalogs. Default views may include unnecessary details, so creating a custom view on top of that can help focus on the specific information you need. For more information about what’s available in the information schema, see Information schema.

If Genie returns a query as a result, it runs on the designated SQL warehouse. Retries are handled automatically, and the SQL warehouse handles concurrency and scale.

What data should I use?

A Genie space can include one or more tables registered to Unity Catalog, including managed tables, external tables, foreign tables, and materialized views. AI/BI Genie uses the metadata attached to Unity Catalog objects to generate responses. Well-annotated datasets, paired with specific instructions that you provide, are key to creating a positive experience for end users.

Databricks recommends the following:

  • Curate data for analytical consumption: Layer views to reduce the number of columns and add use-case-specific information to increase response quality.
  • Minimize the number of tables and columns in a Genie space: Include only the tables and columns needed to answer questions for a given domain. Unnecessary tables or columns can cause Genie to provide confusing or incorrect answers or display an error message.
  • Define primary key (PK)/foreign key (FK) relationships: Use Unity Catalog to define PK/FK relationships so that Genie understands how your data is connected.

Trusted assets

Trusted assets convey an extra layer of assurance in the accuracy of a result to a space user. When the exact text of a parameterized example query or SQL function is used to generate a response, Genie marks the response as a Trusted asset. See Use trusted assets in AI/BI Genie spaces.

Chat threads

Most Genie space interactions take place in a chat window. Chat threads save a record of interactions for each user. Each chat thread maintains context about previous questions it has been asked. Genie uses context in the threaded chat history to learn as users ask follow-up questions to explore further or refocus a result set.

Users with at least CAN VIEW access to a space can view their own chat history. Users with at least CAN EDIT privileges can review all questions and answers in the space’s History tab.

Review responses

Most responses include a natural language explanation and a table showing the relevant result set. The precise response structure varies based on the question. All responses include the SQL query that was generated to answer the question.

Space users and authors can review the responses to their questions. They can rate each response with a thumbs-up or thumbs-down or ask for a response to be reviewed. Space editors and authors can review this feedback using the History icon History tab in the Genie space.

Evaluate responses with benchmarks

Benchmarks allow you to scale up testing and evaluation of individual responses in a Genie space. Unlike instructions, benchmarks are meant to evaluate, not inform, your Genie space. Genie does not use benchmark questions or example SQL to improve Genie’s context.

Using benchmarks, you can run a collection of test questions and use the responses to measure Genie’s accuracy. Optionally, you can include a SQL statement that returns the expected results. When the benchmark question runs, Genie’s response is compared to the results provided by the SQL statement and scored for accuracy. The question is marked for review if no SQL answer has been provided.

See Use benchmarks in a Genie space.

Privacy and security

Q: What model does Genie use?

Genie uses the Azure OpenAI model.

Q: What data is being sent to the model?

Genie spaces generate responses to natural language questions using metadata and instructions. Genie does not have access to row-level data.

To process responses, Genie uses the following:

  • The natural language prompt submitted by the user
  • Table names and descriptions
  • Column titles and descriptions
  • General instructions
  • Example SQL queries
  • SQL functions

Q: Does Azure OpenAI collect my data?

No. Databricks has opted into the exemption from abuse monitoring and human review program, under which Microsoft does not store any prompts and completions sent to the Azure OpenAI service. For more information, see Microsoft’s documentation.