What you will be able to do
- List the Unity Catalog metadata and space configuration a Genie agent reads when it writes SQL
- Connect a Genie accuracy symptom (fan-out joins, a misread column, a mismatched value format, a wrong metric) to the metadata element that is missing or poorly specified
- Rank candidate fixes by impact, preferring metadata and SQL over text instructions and choosing between a Unity Catalog fix and an agent-scoped fix
- Recognise when space limits or conflicting guidance rule out a fix that would otherwise rank highest
Key concept
Metadata-driven SQL generation — A Genie agent writes SQL by choosing table and column names, descriptions, key relationships and sample values from Unity Catalog, plus the agent's own configuration. When an answer is wrong, the cause is usually one of those inputs that is missing, vague or misleading, so the fix is to correct that input.
1.What a Genie agent reads before it writes SQL
A Genie agent (formerly called a Genie space) can only be as accurate as the metadata it is given. When a business user asks a question, Genie works out which data sources are relevant and puts together context from several places. It then writes a read-only SQL query against the agent's warehouse. Genie does not look at your data model and understand it the way an analyst would. It picks the names, descriptions and relationships that seem to match the words in the question. If a column has no description, or two columns look alike, or a key relationship was never declared, Genie is left to guess.
| Input | What it contributes | Where it is maintained |
|---|---|---|
| Unity Catalog table metadata | Table names, descriptions, and defined primary key (PK) and foreign key (FK) relationships | Unity Catalog |
| Column names and descriptions | Genie filters these for the columns relevant to the question | Unity Catalog, optionally overridden per agent |
| Knowledge store context | Agent-level descriptions, synonyms, join relationships, SQL expressions, prompt matching | The Genie agent only |
| Example SQL queries | Reference answers that Genie selects when relevant | The Genie agent |
| SQL functions | All functions added to the agent | Unity Catalog, attached to the agent |
| Instructions | Plain-text General instructions | The Genie agent |
| Prompt and response history | The current chat; the oldest parts are excluded when token limits apply | The conversation |
These inputs fall into two layers, and the difference matters when you choose a fix. Unity Catalog comments are attached to the securable object itself, including individual table columns, so every tool that reads the catalog sees them. The knowledge store is a collection of semantic definitions that belongs to one agent: local table and column descriptions, synonyms, join relationships, SQL expressions and prompt matching. Changes in the knowledge store never write back to the catalog. By default, an agent's table description shows the Unity Catalog description. An author can edit it for that agent and click Reset to go back to the catalog version.
Genie can only reach the objects that are attached to the agent. Genie does not query a table or Unity Catalog function that is not attached under the agent's Sources, even if an instruction names it. If the answer to a question depends on a table that was never attached, no amount of better metadata on the attached tables will fix it.
Checkpoint 1 of 9· Match them up
Match each Genie input to how it behaves when the agent writes SQL
Tap a term, then the definition that fits it.
Unity Catalog comments live on the catalog object, so every consumer sees them. Knowledge store edits apply only to that one agent. To fix a description for every consumer, change it on the Unity Catalog object. Genie can only use attached sources, so better metadata on other tables won't fix a question that needs an unattached table.
“Knowledge store configurations are scoped to the agent and do not affect Unity Catalog metadata.”Source: docs.databricks.com
2.Inflated totals point to missing join metadata
A total that is an exact or near multiple of the right answer is a sign of a join problem, not a column problem. Genie learns how tables relate from two places. The first is the primary key and foreign key relationships declared in Unity Catalog. The second is the join relationships defined in the agent's knowledge store. If neither exists, Genie infers a join, and it cannot know that one order row matches many line-item rows. Summing a column from the "one" side after joining to the "many" side counts that value once per matching row.
The fix is to declare the relationship, with its cardinality stated. Genie uses the PK and FK constraints from Unity Catalog. Any link those constraints don't cover has to be added by hand in the agent's Joins configuration, with the relationship marked One-to-One, One-to-Many or Many-to-Many. Once Genie knows that orders to order_line_items is One-to-Many, it has what it needs to avoid fanning out the order-level amounts.
The fixes that look similar all leave the cause in place. A better description of amount is accurate but doesn't change how the join multiplies rows. A synonym for "revenue" only helps Genie choose the column, which it already chose correctly. An instruction to never join the two tables breaks every legitimate question that needs line-item detail. An example query that corrects the total after the join covers only the questions that match it. Unmatched questions keep producing inflated results.
Checkpoint 2 of 9· Check yourself
No primary key or foreign key constraint links orders to order_line_items in Unity Catalog, and revenue questions that join the two tables keep returning inflated totals. Which change fixes the cause for every question that uses this join, not just some of them?
The inflation happens because the join repeats each order once per line item. Declaring the relationship with One-to-Many cardinality tells Genie how the tables fit together. An example query only helps questions that match it, an instruction against joining breaks questions that need line-item detail, and a better description doesn't change how the join multiplies rows.
“Join relationships: Defined table relationships for accurate JOIN statements.”Source: docs.databricks.com
Checkpoint 3 of 9· Exam question
A Genie space joins an orders table to an order_line_items table. When users ask for total revenue, Genie's generated SQL joins the two tables and sums the amount column from orders, producing a total several times larger than the true value because each order has multiple line items. Which configuration change addresses this?
Correct answer: A — Define the join between orders and order_line_items with explicit One-to-Many cardinality.
- A. Correct. The inflated total is a classic fan-out from joining a one-side table to a many-side table without declared cardinality. Explicitly defining the relationship as One-to-Many lets Genie generate SQL that avoids double-counting
orders.amount. - B. Incorrect. Genie is already correctly locating the
amountcolumn when generating SQL; the failure is a join fan-out issue, not a term-to-column mapping issue that a synonym would fix. - C. Incorrect. A single example query patches one scenario but does not teach Genie the general join behavior; every new revenue-related question would still risk the same fan-out unless the underlying relationship is fixed.
- D. Incorrect. Forbidding the join entirely would break legitimate questions that genuinely need line-item detail from
order_line_items, rather than fixing the aggregation logic. - E. Incorrect. Clarifying what
amountmeans does not address why joining toorder_line_itemsmultiplies the row count before the sum is applied.
3.Wrong columns and empty filters point to column and value metadata
When Genie filters on the wrong column, it usually means two columns look interchangeable to it. Consider a customers table with created_at and updated_at columns and no descriptions. Both are timestamps, and both could plausibly answer "how many customers signed up last month". Genie picks columns by their names and descriptions. With nothing to tell the two apart, it will sometimes pick updated_at. The best fix is a column description that states exactly what each column records: created_at is the signup time and updated_at is the last time the row was modified. Descriptions are worth the effort because they help Genie understand a column, choose it for the right questions and write more accurate SQL.
Rewriting general instructions doesn't fix this. An instruction that tries to list every date question a user might ask will never be complete. It also becomes one more global instruction that Genie has to weigh against the rest. Sample date values don't fix it either, because both columns hold the same kind of value. Declaring a relationship between two columns of the same table doesn't help, because relationships describe how tables join to each other.
A different symptom is a filter that runs on the right column but returns nothing. That happens when users describe a value differently from the way it is stored. Say a country column stores ISO-style codes such as AUS, USA and GBR, and users type "Australia". Genie filters country = 'Australia' and gets an empty result. Genie picked the right column, so better column-level wording won't help. The missing information is at the value level: Genie needs to know how the terms users type correspond to the values actually stored. That is the job of prompt matching. Format assistance gives Genie representative values so it can see the pattern, for example three-letter uppercase codes. Entity matching supplies curated lists of distinct values for the columns users are likely to name, such as countries or states. The most direct fix is to supply that value mapping explicitly, for example "Australia" maps to AUS.
| Fix | What it tells Genie | Symptom it resolves |
|---|---|---|
| Column description | What a column records, precisely | Genie filters or aggregates the wrong one of two similar columns |
| Column synonym | Other business words that refer to the column | Users name the column with a term Genie doesn't recognise |
| Prompt matching (format assistance, entity matching) | What the stored values look like and which values exist | Filters on the right column return empty results because the user's term differs from the stored value |
Prompt matching can also be missing without anyone switching it off. If a table has a row filter, Genie excludes the whole table from prompt matching. A column mask excludes only the masked columns. So if value matching fails on one governed table while working elsewhere, check its row filters before you write new instructions.
Checkpoint 4 of 9· Check yourself
Users ask for "orders shipped to Australia". The generated SQL filters country = 'Australia' on the correct column, but the country column stores codes such as AUS, USA and GBR, so the result is empty. Which change fixes this?
Genie already chose the right column, so the gap is at the value level. Prompt matching, along with an explicit value mapping, tells Genie that "Australia" corresponds to the stored value AUS. Synonyms and descriptions only help Genie choose a column. Uppercasing turns the value into "AUSTRALIA", which still doesn't match.
“Prompt matching allows Genie to match values that are most relevant to the user's question and correct spelling issues in user prompts.”Source: docs.databricks.com
Checkpoint 5 of 9· Check yourself
A customers table has created_at and updated_at columns and neither has a description. Questions about monthly signups sometimes produce SQL that filters on updated_at. What is the highest-impact fix?
Genie chooses columns by their names and descriptions, so a precise description tells the two similar columns apart. Both columns hold the same kind of values, so sample values don't help. Joins describe how tables relate to each other. A list of date questions in an instruction will never be complete.
“Quality column descriptions and synonyms help Genie understand the column better, choose it for relevant questions, and write more accurate SQL.”Source: docs.databricks.com
Checkpoint 6 of 9· Exam question
A Genie space is registered against a Unity Catalog table containing a country column that stores values like "AUS", "USA", and "GBR". Users frequently type full country names such as "Australia" in natural-language questions, and Genie fails to apply the correct filter, returning empty or incorrect results. Which configuration change will most directly fix this?
Correct answer: A — Add an example-value mapping tying "Australia" to the stored code "AUS" for the country column.
- A. Correct. Genie matches user-typed business terms against column values using configured example values (a value dictionary). Mapping "Australia" to the stored code "AUS" directly resolves the mismatch between natural-language input and the actual stored data.
- B. Incorrect. The problem is not that Genie fails to find the
countrycolumn itself — it already targets that column. A synonym for the column name does not help Genie translate the typed value "Australia" into the stored code "AUS". - C. Incorrect. Uppercasing input would not solve a semantic mismatch between a country name ("Australia") and an unrelated ISO-style code ("AUS"); there is no textual transformation that bridges the two without an explicit mapping.
- D. Incorrect. Warehouse size affects query execution speed, not whether Genie can correctly translate a business term into the right stored value. This is a metadata/semantic problem, not a compute problem.
- E. Incorrect. A single hard-coded example query only teaches Genie one specific filter value; it does not generalize to other country names users might type, and it does not document the mapping as reusable metadata the way an example-value dictionary does.
Checkpoint 7 of 9· Exam question
A Unity Catalog table has columns created_at and updated_at with no descriptions. When users ask "how many customers signed up last month," Genie sometimes filters on updated_at instead of created_at, producing incorrect counts. What is the highest-impact fix?
Correct answer: A — Add column descriptions noting created_at is signup time, updated_at is last-modified time.
- A. Correct. The ambiguity is purely semantic: two similarly named timestamp columns with no documentation of what each represents. Column descriptions give Genie the business meaning it needs to pick the right column for "signed up".
- B. Incorrect. Sample date values do not clarify which column represents signup versus modification; the values in both columns look the same (dates), so a value dictionary does not resolve the ambiguity.
- C. Incorrect. Enumerating every possible phrasing does not scale and does not address the root cause, which is that the columns themselves are undocumented.
- D. Incorrect. Renaming columns is a schema change outside typical metadata configuration and is unnecessary when a column description can resolve the ambiguity without touching the underlying table.
- E. Incorrect.
created_atandupdated_atare two attributes of the same row, not two separate tables needing a join relationship; cardinality configuration is not applicable here.
4.Wrong business numbers point to missing SQL definitions
Sometimes the joins and columns are right and the number is still wrong. In that case Genie usually doesn't know how the business defines the metric. "Open pipeline", "active customer" and "gross margin" each carry rules that column names don't reveal. Genie fills the gap with general knowledge, which may differ from your company's definition. The fix depends on how complex the definition is. A metric, filter or dimension that is used often should become a SQL expression in the knowledge store. A multi-part question with organisation-specific logic should get a complete example SQL query.
-- Return our current total open pipeline by region.
-- Opportunities are only considered pipelines if they are tagged as such.
SELECT
a.region__c AS `Region`,
sum(o.amount) AS `Open Pipeline`
FROM
sales.crm.opportunity o
JOIN sales.crm.accounts a ON o.accountid = a.id
WHERE
o.forecastcategory = 'Pipeline' AND
o.stagename NOT ILIKE '%closed%'
GROUP BY ALL;Without this example, a question about "pipeline" would most likely sum every opportunity. The forecastcategory = 'Pipeline' rule is the kind of organisation-specific logic that example queries are meant to capture. When a matching question arrives, Genie can run the example as it is. When a similar question arrives, Genie borrows its structure.
A SQL expression. "Active customers" is a common business term that Genie should reuse across many questions, and SQL expressions are reusable definitions for exactly that. Text instructions should not define metrics or filters that can be written in SQL. A single example query would cover only questions phrased like it.
Checkpoint 8 of 9· Fill the gap
This example query teaches Genie the company's own definition of "open pipeline", which the column names alone don't reveal. Which column completes the filter that encodes that business rule?
-- Return our current total open pipeline by region.
-- Opportunities are only considered pipelines if they are tagged as such.
SELECT
a.region__c AS `Region`,
sum(o.amount) AS `Open Pipeline`
FROM
sales.crm.opportunity o
JOIN sales.crm.accounts a ON o.accountid = a.id
WHERE
o. ? = 'Pipeline' AND
o.stagename NOT ILIKE '%closed%'
GROUP BY ALL;At this company, an opportunity only counts as pipeline if its forecast category is tagged 'Pipeline'. That rule is specific to the organisation, so Genie can't guess it from general knowledge. Without the example, Genie would most likely add up every opportunity. The stagename filter, which drops closed deals, is a separate condition in the same query.
Source: docs.databricks.com5.Ranking fixes by impact
Once you have a diagnosis, you choose among fixes that each look like they would help. Two rules decide the ranking. Structured context beats prose: descriptions, join relationships, SQL expressions and example SQL rank above text instructions, which should only be used when SQL and examples can't address the need. Fix the problem where it starts: an error caused by Unity Catalog metadata is best corrected in Unity Catalog when other consumers of that table would also benefit.
Text instructions rank last because of how they scale. General instructions apply to every prompt, and too many of them can reduce effectiveness, especially in long conversations, because Genie may struggle to prioritise the guidance that matters most. Guidance that applies only to some questions belongs somewhere more specific: an example query, a function, or comments and metadata on the relevant table. Text instructions are the right tool for global behaviour, such as a fiscal year that starts in February or a rounding rule.
| Fix in Unity Catalog when… | Fix in the agent's knowledge store when… |
|---|---|
| The description is missing or wrong for every consumer of the table | The wording is specific to this agent's audience or domain |
| You own the table or have the privileges to edit its comments | You can edit the agent but not the underlying table |
| An ALTER on the table won't disrupt the pipelines and jobs that use it | You need fast iteration without touching shared objects |
A fix made at the source carries a cost. Saving a comment in Unity Catalog runs an ALTER command, which can disrupt pipelines and jobs. AI-generated comments can produce descriptions for every column quickly, but the model writes them from the schema and column names. That makes it least reliable in exactly the case at hand, where two columns have similar names. Review every suggestion and accept it only if it matches what you would have written yourself.
Limits can rule out a fix that would otherwise rank first. The capacity caps covered in Genie space limits count against different budgets. Each example query, each function and the whole General instructions block counts toward 100 instructions. Table descriptions, join relationships and SQL expressions count toward 200 knowledge store snippets. If the snippet budget is already used up, a new SQL expression may be impossible.
Two changes still work when the snippet budget is full, because both move the definition out of the snippet-counted items. A view that pre-joins related tables lets the agent attach one object in place of several, so the join relationships between them (each a snippet) are no longer needed and there is one table description instead of several. A metric view is a Unity Catalog object whose definition declares the joins, dimensions and measures itself, so metrics such as revenue are pre-defined in the data object rather than added to the agent as SQL expressions. Moving a definition into a Unity Catalog comment works for a different reason: column descriptions are not among the items that count toward the 200-snippet limit. Each route fits a different gap. Use a view or metric view when the gap is a join or a metric, and a comment when the gap is the meaning of a column.
Conflicts can rule out a fix too. If an example query rounds to four decimals and an instruction says two, adding more guidance on either side just adds to the contradiction. Resolve the conflict first.
Rank a fix by whether the failing questions now pass, not by how plausible it sounded. After the change, re-run the benchmark questions that exposed the gap, using the approach from Validating a Genie space with benchmark questions. Genie does not use benchmark questions or SQL as context, so a benchmark that now passes reflects the metadata change. It is not the result of Genie having seen the answer.
Checkpoint 9 of 9· Match them up
An agent author is weighing fixes in five situations. Pair each situation with the change that ranks highest for it.
Tap a term, then the definition that fits it.
Text instructions are for global behaviour only. A metadata error that affects every consumer is best fixed in Unity Catalog, and agent-specific wording belongs in the knowledge store. If the snippet budget is used up, a new SQL expression is not possible, so a view or a catalog comment is the change you can still make. When guidance conflicts, adding more guidance only adds to the contradiction.
“Text instructions are only for context that should be applied globally and do not fit into the other formats.”Source: docs.databricks.com
Sources
(7)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Table names, descriptions, and defined primary key (PK) and foreign key (FK) relationships.”
↩︎ What a Genie agent reads before it writes SQL“combined with relevant Unity Catalog comments, metadata, and sample values from selected columns”
↩︎ What a Genie agent reads before it writes SQL“Genie does not use benchmark questions or SQL to improve its context.”
↩︎ Ranking fixes by impact“Genie selects relevant names and descriptions from annotated tables and columns to convert natural language questions to an equivalent SQL query.”
↩︎ Key concept“Knowledge store configurations are scoped to the agent and do not affect Unity Catalog metadata.”
↩︎ Checkpoint - 2.
“All knowledge store configurations are scoped to your Genie Agent and do not affect Unity Catalog metadata or other Databricks assets.”
↩︎ What a Genie agent reads before it writes SQL“The default table description shows the Unity Catalog metadata associated with your data asset.”
↩︎ What a Genie agent reads before it writes SQL“Join relationships: Defined table relationships for accurate JOIN statements.”
↩︎ Inflated totals point to missing join metadata“Format assistance provides representative values for all eligible columns, helping Genie understand data types and formatting patterns.”
↩︎ Wrong columns and empty filters point to column and value metadata“Entity matching provides curated lists of distinct values for up to 120 columns where users are likely to reference specific entries”
↩︎ Wrong columns and empty filters point to column and value metadata“Row filter: Genie excludes the entire table from prompt matching.”
↩︎ Wrong columns and empty filters point to column and value metadata“Focus on providing samples that highlight logic that is unique to your organization and data”
↩︎ Wrong business numbers point to missing SQL definitions“documented in the relevant table as comments or metadata”
↩︎ Ranking fixes by impact“Knowledge store snippets (200 per agent): Table descriptions, join relationships, and SQL expressions (measures, filters, and dimensions) share this limit.”
↩︎ Ranking fixes by impact“Text instructions, example SQL queries, SQL functions, column descriptions, and prompt matching settings do not count toward this limit.”
↩︎ Ranking fixes by impact“This helps Genie match user terminology to actual data values.”
↩︎ Exam trap 2“Text instructions are only for context that should be applied globally and do not fit into the other formats.”
↩︎ Checkpoint - 3.
“Genie does not query tables or Unity Catalog functions that are not attached, even if the agent's instructions or metadata reference them.”
↩︎ What a Genie agent reads before it writes SQL - 4.https://docs.databricks.com/aws/en/commentsOfficial docs
“You can also add comments to table columns.”
↩︎ What a Genie agent reads before it writes SQL“Saving comments triggers an ALTER SQL command, which can disrupt Databricks pipelines and jobs.”
↩︎ Ranking fixes by impact - 5.https://www.databricks.com/blog/data-dialogue-best-practices-guide-building-high-performing-genie-spacesSecondary source
“Genie respects primary and foreign keys defined in Unity Catalog, but you must manually configure any missing links in the Joins tab.”
↩︎ Inflated totals point to missing join metadata“This prevents Genie from generating queries that explode row counts or accidentally double-count metrics.”
↩︎ Inflated totals point to missing join metadata“Explicitly stating if a relationship is One-to-One, One-to-Many, or Many-to-Many is critical.”
↩︎ Exam trap 1 - 6.
“Genie uses Unity Catalog column names and descriptions to generate responses.”
↩︎ Wrong columns and empty filters point to column and value metadata“Quality column descriptions and synonyms help Genie understand the column better, choose it for relevant questions, and write more accurate SQL.”
↩︎ Wrong columns and empty filters point to column and value metadata“Prompt matching allows Genie to match values that are most relevant to the user's question and correct spelling issues in user prompts.”
↩︎ Wrong columns and empty filters point to column and value metadata“For example, use SQL expressions to define revenue, active_customers, gross_margin, or recent_sales.”
↩︎ Wrong business numbers point to missing SQL definitions“Avoid using text instructions to define metrics, filters, or query patterns that can be expressed through SQL.”
↩︎ Wrong business numbers point to missing SQL definitions“Use text instructions only as a last resort when SQL expressions and examples cannot address the need.”
↩︎ Ranking fixes by impact“Too many instructions can reduce effectiveness, especially in longer conversations, because Genie might struggle to prioritize the most important guidance.”
↩︎ Ranking fixes by impact“Inspect any AI-generated descriptions for accuracy and clarity, and use them only if they align with what you would manually provide.”
↩︎ Ranking fixes by impact“Metric views are particularly effective for Genie Agents because they pre-define metrics, dimensions, and aggregations.”
↩︎ Ranking fixes by impact“if text instructions specify rounding decimals to two digits, then example SQL queries must also round to two digits.”
↩︎ Ranking fixes by impact“Use text instructions only as a last resort when SQL expressions and examples cannot address the need.”
↩︎ Exam trap 3“This metadata is scoped to your Genie Agent and does not overwrite metadata stored in Unity Catalog.”
↩︎ Exam trap 4 - 7.
“Comments are powered by a large language model (LLM) that takes into account object metadata, such as the table schema and column names.”
↩︎ Ranking fixes by impact