CertSafari
    Databricks Certified Context Engineer Associate· Lessons

    Domain 2 · Lesson 8/45

    Production-ready Genie spaces: instructions, trusted SQL and benchmarks

    Given a business domain, select and validate the instructions, sample questions, and trusted SQL assets that together produce a production-ready Genie space.

    18 min read
    2.25% of exam
    5 sources
    Published 22 Oct 2026
    Docs as of 17 Oct 2026

    What you will be able to do

    • Confirm the data, compute and permission prerequisites before you start curating a Genie space
    • Decide where each piece of business knowledge belongs: column metadata, SQL expressions, example SQL, a trusted asset or a text instruction
    • Write short global text instructions that never contradict the example SQL
    • Show a Genie space is production-ready by acting as its first user and scoring it with benchmark questions

    Key concept

    One home per piece of business knowledge — Each business fact goes into the most structured place that can hold it. Column meanings go into descriptions and synonyms, metrics into SQL expressions, hard questions into example SQL, logic that must not change into a SQL function, and only rules that apply everywhere into text instructions.

    1.Prerequisites: data, compute and permissions

    A Genie space is a natural-language chat interface. Data analysts configure it with Unity Catalog data, example SQL, instructions and trusted assets, and business users ask it questions in plain language. The current documentation calls these Genie Agents; they were formerly known as Genie Spaces, and this lesson uses "Genie space" throughout. No instruction or example can make up for a missing foundation, so check the foundation before you curate anything.

    Data comes first. Everything in the space must be registered to Unity Catalog, and one space can hold up to 50 tables, views or metric views. A space only queries the sources attached to it. If an instruction mentions a table that was never attached, Genie will not go and find that table.

    Compute has a hard rule and a recommendation. The rule is that the space must use a pro or serverless SQL warehouse; a classic warehouse is not an option. The recommendation is serverless, for the best performance. Pro is still supported, so "serverless only" is wrong too. When an author saves the default warehouse, that author's compute credentials are embedded in the space so every user can reach the warehouse. The embedded credentials cover the warehouse and nothing else. Each user's data access is still checked against their own Unity Catalog permissions.

    Permissions are needed by both authors and users. To create or edit a space you need:

    • the Databricks SQL workspace entitlement
    • CAN USE on at least one pro or serverless warehouse
    • SELECT on the data in the space
    • at least CAN EDIT on the space itself (creators automatically get CAN MANAGE)

    Two more conditions sit outside the space. An account administrator must enable partner-powered AI features at both the account and the workspace level. And if you later add SQL functions as trusted assets, every user who relies on them needs EXECUTE on those functions.

    Checkpoint 1 of 9· Check yourself

    A space's text instructions say "For product returns, use retail.sales.returns." That table is registered in Unity Catalog but was never attached to the space. A user asks about last month's returns. What happens?

    Checkpoint 2 of 9· Check yourself

    An author with SELECT on every table in a space saves its default warehouse. An analyst who lacks SELECT on one of those tables then asks a question that needs it. What happens?

    Checkpoint 3 of 9· Exam question

    A retail analytics team is finalizing compute settings before promoting their Genie space to production. Which SQL warehouse configuration satisfies the requirement for a Genie space, and which type does Databricks recommend for the best experience?

    Sources12

    2.Scope the domain and fix metadata before writing instructions

    Give each space one audience and one purpose. A space should answer questions about one topic for one group of users, not general questions across many domains. Aim for five or fewer tables, prejoin related tables into views or metric views, and hide columns that might confuse Genie. Which Unity Catalog objects to bring in is its own decision. Here the point is the order of work: settle the scope, then check the metadata of the objects in it.

    Genie gets column meaning mostly from metadata, which is why metadata is checked first. Genie reads Unity Catalog names and descriptions as the main description of the data (What a Genie agent reads from Unity Catalog). So while you scope the domain, read every column description in the space and inspect any AI-generated ones before you accept them. A column such as status_cd with no description, or an acronym like "FTE" that nothing links to a field, causes most early wrong answers. No instruction written later fixes that as directly as fixing the column.

    The fix belongs on the column. Add a description that says what the column contains, and add synonyms that link business jargon to the technical field. Descriptions and synonyms help Genie pick the right column for a question and write more accurate SQL. These space-level edits do not overwrite the metadata stored in Unity Catalog, so you can tune the space without changing the shared catalog. The other fixes miss the target. A long text instruction listing every acronym spends the scarce instruction space on something metadata does better. Example SQL that filters on status_cd teaches Genie a few query patterns, not what the column means. A table description can't attach a meaning to one specific column. And restricting permissions does nothing for accuracy.

    Checkpoint 4 of 9· Check yourself

    In a finance space, users who ask about "FTE" keep getting wrong answers. The figure lives in an undocumented column named emp_ratio, and other teams share the catalog, so it must not change for them. Which fix should the author make?

    Checkpoint 5 of 9· Exam question

    During review of a Genie space for the HR domain, an engineer finds that ambiguous columns like status_cd have no description and business acronyms like "FTE" are never mapped to their meaning. Business users keep phrasing questions that Genie cannot resolve to the correct column. Following the recommended configuration hierarchy, what should the engineer prioritize fixing first?

    Sources3

    3.One home for each piece of business knowledge

    Business knowledge has a type, and each type has one home in the space. When the same fact sits in two places, the copies drift apart. When a fact sits in the wrong place, Genie gets it less reliably. The order of preference is metadata first, then SQL, with text instructions last. Structured SQL definitions are more reliable and easier to maintain than plain-text guidance.

    Where each kind of business knowledge belongs in a Genie space
    Kind of knowledgeHomeWhy there
    What a column or table means; business synonymsAgent-level table and column descriptions, synonymsGenie uses metadata to understand the data before it writes any SQL
    Standard metrics, filters and dimensionsSQL expressions (measures, filters, dimensions) in the knowledge storeA reusable, structured definition of the business logic
    Hard-to-interpret or multi-part questionsExample SQL query, titled with the typical user phrasingGenie can use it directly or learn from it for similar questions
    Logic that must run the same way every time and stay hiddenSQL function registered in Unity Catalog (trusted asset)Genie calls it with parameters but cannot view or modify its SQL
    Rules that apply to every prompt, like a fiscal year starting in FebruaryGeneral text instructionsContext that should apply globally and fits no other format

    Example SQL works best when it captures logic that is specific to your organization. In the example below, an opportunity counts as pipeline only when it is tagged as pipeline and has not closed. Genie could not guess that rule from the column names. Give each example the title a user would most typically type, so Genie can match incoming questions to it.

    An example SQL query that teaches Genie an organization-specific rule for open pipelinesql
    -- 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;

    Recurring questions whose answer must be exactly right deserve a trusted asset. A trusted asset is a parameterized example query or a Unity Catalog SQL function that an author has verified, and Genie marks answers produced from it as verified (Trusted assets: parameterized queries and SQL functions). Pick a parameterized query when the same question keeps coming back with different values, such as a region or a date. Pick a SQL function when the logic is too complex for a parameterized query, or must never be shown or changed. A tax calculation is the typical case: Genie passes in the parameters but can neither read nor edit the SQL inside the function. A plain-language rule offers no such protection, and neither does a table description or a suggested query you accepted.

    Three different things get called "sample questions", and only one of them changes what Genie knows. The title of an example SQL query is part of the space's instructions. Common questions only appear on the chat landing page to show users what they can ask. Benchmark questions are used only for evaluation. Every example query, every SQL function and the whole general-instructions text block each count as one instruction, and a space allows 100 instructions in total.

    Checkpoint 6 of 9· Fill the gap

    In this example SQL query, an opportunity counts as open pipeline only if it is tagged as pipeline and has not closed. Which keyword fills the blank so the query follows that 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.forecastcategory = 'Pipeline'  ? 
        o.stagename NOT ILIKE '%closed%'
      GROUP BY ALL;

    Checkpoint 7 of 9· Exam question

    A finance team needs a tax calculation applied identically by Genie every time, regardless of how a question is phrased, and the logic must not be editable through natural-language instructions. Which trusted asset best satisfies this requirement?

    Sources321

    4.Global vs specific text instructions

    General text instructions apply to every prompt, which is why they should be short. If a rule only matters for some questions, put it next to those questions: in an example query, in a function, or in the relevant table's comments or metadata. Fiscal calendar definitions and output formatting are the kinds of rules that belong in general text. A long instruction block hurts, especially in longer conversations, because Genie may struggle to work out which guidance matters most.

    Vague instructions fail even when they sit in the right place. "Ask clarification questions when asked about sales" doesn't say when to ask or what to ask. A clarification instruction that works has four parts:

    1. A trigger condition: "When users ask about sales performance breakdown…"
    2. The missing details: "…but don't include time range, sales channel, or which KPIs…"
    3. The required action: "…you must ask a clarification question first…"
    4. An example question: "Please specify the time range and sales channel you are looking for."

    Put clarification rules at the end of the general instructions so Genie gives them priority.

    Summary formatting can only be controlled through text. Only text instructions affect the natural-language summaries Genie writes next to query results. Example SQL and SQL expressions have no effect on them. Collect summary rules, such as the response language or citing the tables used, in a section at the end headed "Instructions you must follow when providing summaries".

    No instruction may contradict another, whatever type it is. Genie is nondeterministic, and conflicting guidance makes unwanted answers more likely. If the text says to round decimals to two places, every example query must also round to two places. One example that rounds to four is enough to put two answers to the same question in front of Genie. Before you share the space, read the text instructions, the example SQL and the SQL expressions together and remove every conflict.

    Checkpoint 8 of 9· Check yourself

    Users of a sales space want Genie's written summaries in French, with the tables it used cited. The author has already given every example SQL query French column aliases, but the summaries still come back in English without citations. What should the author change?

    Sources23

    5.Validate as the first user, then score with benchmarks

    The author should be the space's first user. Ask the questions you expect business users to ask, and read the SQL Genie generates, not just the result table. If Genie misreads the data or the jargon, edit the generated SQL, run it, and save it with Add as instruction so it becomes an example query. Use Add as benchmark to keep the question as a test. Start with minimal instructions and a few questions, then grow the space from what testing and feedback show.

    Benchmarks show that a space is production-ready because they score accuracy against answers you already know are correct. A space can hold up to 500 benchmark questions. Cover the questions users ask most often, each phrased several different ways. That tests whether Genie copes with wording, not just with the one phrasing that matches an example title. Each benchmark runs as a new conversation that uses the space's instructions, example SQL and functions. Give each question a SQL Answer; a Unity Catalog SQL function can also serve as the gold-standard answer. Questions without a SQL Answer can't be scored automatically and need manual review.

    How a Chat mode benchmark run rates Genie's answer against the SQL Answer
    What Genie producedRating
    SQL that exactly matches the SQL AnswerGood
    The same result set, or the same data sorted differentlyGood
    Numeric values that round to the same 4 significant digitsGood
    An empty result set or an errorBad
    Extra columns compared with the SQL Answer's result setBad
    A different single-cell resultBad

    One failure is caused by the benchmark itself. Chat mode compares at most 5,000 rows of each result set. If a correct answer returns more rows in a different order, the truncated comparison can rate it Bad. Keep SQL Answers under 5,000 rows, or add an ORDER BY to both. Every Bad rating comes with an explanation of the mismatch. The Evaluations tab keeps a timestamped accuracy score for each run, so you can rerun the same benchmark set after every change to instructions or examples and check that accuracy went up.

    Checkpoint 9 of 9· Check yourself

    While testing a new HR space as its first user, an author sees Genie misread "attrition" and fixes the generated SQL so it returns the right figure. The author wants Genie to answer this question and similar ones correctly from now on. What should they do with the corrected query?

    Sources345

    Sources

    (5)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Genie Agents require a pro or serverless SQL warehouse.”
      ↩︎ Prerequisites: data, compute and permissions
      “Data access is always evaluated using each end user's own Unity Catalog permissions.”
      ↩︎ Prerequisites: data, compute and permissions
      “Common questions are optional examples of the types of questions users can ask.”
      ↩︎ One home for each piece of business knowledge
      “For optimal performance, Databricks recommends using a serverless SQL warehouse.”
      ↩︎ Exam trap 1
      “Genie does not query tables or Unity Catalog functions that are not attached, even if the agent's instructions or metadata reference them.”
      ↩︎ Exam trap 2
      “Genie does not query tables or Unity Catalog functions that are not attached, even if the agent's instructions or metadata reference them.”
      ↩︎ Checkpoint
      “These embedded credentials grant access to the warehouse only. Data access is always evaluated using each end user's own Unity Catalog permissions.”
      ↩︎ Checkpoint
    2. 2.
      “Agent users must have EXECUTE permission on any SQL functions used as trusted assets.”
      ↩︎ Prerequisites: data, compute and permissions
      “Genie cannot view or modify the SQL used in the function, making this approach well-suited for logic that should not be surfaced or changed.”
      ↩︎ One home for each piece of business knowledge
      “Each example SQL query, each SQL function, and the entire General instructions text block each count as one instruction.”
      ↩︎ One home for each piece of business knowledge
      “If an instruction is relevant only to a subset of prompts, it should be included as an example query or function”
      ↩︎ Global vs specific text instructions
    3. 3.
      “Genie uses Unity Catalog column names and descriptions to generate responses.”
      ↩︎ Scope the domain and fix metadata before writing instructions
      “Quality column descriptions and synonyms help Genie understand the column better, choose it for relevant questions, and write more accurate SQL.”
      ↩︎ Scope the domain and fix metadata before writing instructions
      “This metadata is scoped to your Genie Agent and does not overwrite metadata stored in Unity Catalog.”
      ↩︎ Scope the domain and fix metadata before writing instructions
      “Use text instructions only as a last resort when SQL expressions and examples cannot address the need.”
      ↩︎ One home for each piece of business knowledge
      “Too many instructions can reduce effectiveness, especially in longer conversations, because Genie might struggle to prioritize the most important guidance.”
      ↩︎ Global vs specific text instructions
      “if text instructions specify rounding decimals to two digits, then example SQL queries must also round to two digits.”
      ↩︎ Global vs specific text instructions
      “Add clarification question instructions at the end of your general instructions to help Genie prioritize this behavior”
      ↩︎ Global vs specific text instructions
      “You should be your agent's first user.”
      ↩︎ Validate as the first user, then score with benchmarks
      “Use text instructions only as a last resort when SQL expressions and examples cannot address the need.”
      ↩︎ Key concept
      “Only text instructions affect summary generation.”
      ↩︎ Exam trap 3
      “Only text instructions affect summary generation. SQL examples and SQL expressions don't influence how Genie creates summaries.”
      ↩︎ Checkpoint
    4. 4.
      “Benchmark questions should reflect different ways of phrasing the common questions your users ask.”
      ↩︎ Validate as the first user, then score with benchmarks
      “Any questions that do not include a SQL Answer require manual review to be scored.”
      ↩︎ Validate as the first user, then score with benchmarks
      “write SQL Answer queries that return fewer than 5,000 rows, or add an ORDER BY clause”
      ↩︎ Validate as the first user, then score with benchmarks
      “After you've made your corrections, run the query. Then, you can save it as an instruction to teach Genie how to answer in the future.”
      ↩︎ Checkpoint
    5. 5.
      “Genie does not use benchmark questions or SQL to improve its context.”
      ↩︎ Validate as the first user, then score with benchmarks
      “Genie does not use benchmark questions or SQL to improve its context.”
      ↩︎ Exam trap 4

    Ready to test yourself?

    Practise Databricks Certified Context Engineer Associate in quiz mode.

    Spotted a mistake, or was something unclear? Tell us.