Skip to main content

Use value dictionaries to improve Genie's accuracy

Preview

This feature is in Public Preview.

This page explains how to improve accuracy in a Genie space by adding value dictionaries. Value dictionaries allow Genie to match values in a user's prompt to actual values in data to generate SQL queries that closely match the user's intent.

Overview

When a user asks a question in Genie, the phrasing is often conversational and can include errors such as misspellings. In these cases, the values in the prompt might not match the structure or values in the data. This can cause Genie to misinterpret the question and generate incorrect SQL.

For example, a user might ask:

"Show me car sales in Florida for Q1."

If the data uses state abbreviations (such as FL), and there isn't a value dictionary for that column, Genie might generate SQL that includes ILIKE '%Florida%', which returns no results.

Adding a value dictionary to the state column allows Genie to access representative values. With this context, Genie can recognize that FL corresponds to “Florida” and generate more accurate SQL.

Without value dictionary

With value dictionary

WHERE state ILIKE '%Florida%'

WHERE state = 'FL'

Value dictionaries help Genie return correct results by improving its ability to generate accurate SQL.

Requirements

  • Genie spaces must be enabled. See Manage Genie access.
  • The Genie Data Sampling preview setting is enabled by default. If necessary, a workspace admin can manage access to the preview from the Previews page. The preview must be set to On for Genie space authors to use value dictionaries.

Choose columns

Genie automatically creates value dictionaries for eligible columns as you add tables to the space. Tables with row filters or column masks are excluded. When a value dictionary has been added for a column, a Value dictionary tag appears in the column list view. If the space limit for value dictionaries is reached and you want to adjust which columns are included, you can manually select the columns. For instructions, see Manually select columns.

note

During the Public Preview, a Genie space supports value dictionaries on up to 30 columns. Each dictionary can include up to 1,024 distinct values that are less than 127 characters in length. When tables are added to a space, Genie automatically selects up to 30 eligible string columns and generates value dictionaries for them. You can also manually manage which columns should have value dictionaries enabled. See Manually select columns.

Manually select columns

Choose string columns that give Genie practical context when interpreting prompts, especially columns with categorical or consistently formatted values. Avoid free-text or unstructured content like user IDs, names, or reviews.

Value dictionaries are stored in your workspace's storage bucket.

To set which string columns include a value dictionary:

  1. Click Configure > Data in your Genie space.
  2. Click a table name to view its columns.
  3. Click the Edit Icon edit icon next to the column name.
  4. Click Advanced.
  5. Turn Build value dictionary on.
  6. To disable value dictionaries for a column, turn Build value dictionaries off. See Refresh or remove value dictionaries.

A string column with the value dictionary button on the right.

Refresh or remove value dictionaries

Refreshing a dictionary updates its stored values. Refresh the value dictionary if:

  • New values have been added to the column.
  • The format of existing values has changed.

To refresh a value dictionary, click the Kebab menu kebab menu in the column view, then Refresh sample values.

Refresh values or remove values options in the UI

How Genie uses value dictionaries

Genie uses your prompt, relevant table metadata and values, errors, and input code or queries when generating a response. If Genie uses a column with a value dictionary, the stored values help it to interpret prompts more accurately and generate better SQL. Value dictionaries improve Genie's accuracy but work best alongside clear example queries and instructions. See Curate an effective Genie space for more guidance.