Himanshu Gaurav.nb
ENTERPRISE AI / Towards Data Experience

How to give AI agents the right business definitions and metrics: the SME multiplier on Databricks Genie

Databricks Genie lets subject matter experts pour KPI logic, instructions, example queries and spreadsheets into a Genie Agent, so business users stop waiting on scarce experts. Step-by-step, with limits and docs.

Originally published on Medium ↗ on 2025-09-21. Updated on 2026-12-02 to match the current Medium edition.

Summary. Databricks Genie is the natural-language layer of the Databricks platform, and a Genie Agent is a domain-specific chat interface where business users ask questions of governed data. A subject matter expert (SME) teaches a Genie Agent the same way they would onboard a new analyst: plain-text instructions, named metrics, worked examples and join rules, all entered in the Genie Agent editor with no code beyond optional SQL. Business users can then add their own spreadsheets to a conversation, flag wrong answers, and run multi-step investigations in Agent mode. This article walks through each of those steps, with the limits and the docs links, so the “why, what and how” of a business stops living in three people’s heads.

In every company I have worked with, business leaders want answers to the same three questions:

  • Why is this happening?
  • What does it mean for us?
  • How do we act on it?

Simple questions. Yet answering them is rarely simple.

The knowledge needed to answer them usually sits with a handful of subject matter experts who understand both the business context and the KPIs behind it. That creates three problems I see over and over.

Scarce SME bandwidth. If only a few people know the KPIs, their interpretation and the business logic behind them, scaling insight across the enterprise becomes hard.

Implementation bottlenecks. Even when an SME explains which KPI is needed, bringing it to life requires engineers from the data team, and there are never enough of them.

Tribal knowledge. Every time a seasoned SME leaves, years of contextual understanding leave with them.

Databricks Genie is the tool I now reach for to break that pattern. The rest of this article is the how.

The complete Databricks Genie context layer: Genie One, Genie Agents, Genie Ontology with modeled and learned knowledge, Unity Catalog, and where the subject matter expert and Genie Code fit.

How do I reduce ad hoc reporting requests to my data team?

Short answer: Turn the requests you answer most often into knowledge an agent can reuse, then send people to the agent first.

  1. Log a month of requests. Every ad hoc ask that reaches the data team goes in a sheet: who asked, the question, the tables used.
  2. Group them. In my experience most turn out to be variations of a short list of questions with different filters: a region, a week, a category.
  3. Write the top ones into a Genie Agent. Each recurring question becomes an example query, and each metric inside it becomes a SQL expression with synonyms.
  4. Benchmark them before launch so the agent’s answer matches the one the team used to send by hand.
  5. Make the agent the front door. Share it with the requesting teams, and have the first reply in the request channel link to it.
  6. Measure. The Monitor tab shows weekly questions and active users. The request log shows what still reaches the team, which becomes next month’s additions.

The data team’s job shifts from answering the same question again to curating the answer once.

How do I scale analytics without hiring more analysts?

Short answer: Change what analysts spend their time on. An analyst answering questions serves the people who can reach them. An analyst curating a Genie Agent serves everyone the agent is shared with.

  • Analysts and SMEs curate: definitions, example queries and benchmarks.
  • Business users self-serve through Genie One, which takes them to the right Genie Agent.
  • Agent mode handles multi-step “why” questions that used to take an analyst an afternoon.
  • Benchmarks and the Monitor tab keep quality visible as usage grows.

The scale comes from writing the knowledge down once, not from adding people to answer it. For how this works across many domains at once, with one Genie Agent per domain, see Part 2 of my Data Mesh series.

What is Databricks Genie, and what is a Genie Agent?

Short answer: Databricks Genie is the AI experience for users of the Databricks platform. It has three faces: Genie One, the simplified interface for business users; Genie Agents, the domain-specific chat interfaces that answer questions over governed data; and Genie Code, the coding assistant for technical users.

A Genie Agent (formerly called a Genie space) is a domain-specific natural-language chat interface in Databricks where users ask questions of their data and get back SQL, result tables and visualizations. Every query runs as the user, so Unity Catalog privileges, row filters and column masks apply automatically.

The part that matters for SMEs is the agent’s knowledge store: a collection of curated semantic definitions that enhances Genie’s understanding of your data. That knowledge store is where an expert pours in what they know.

Docs: Genie Agents overview and Genie Agent concepts.

What is an AI coworker, and how is it different from an AI assistant or an AI agent?

Short answer: An AI coworker is an AI agent that works inside your organization’s context. It knows your definitions, respects your permissions and leaves work that others can review.

  • An AI assistant answers when asked, using whatever general knowledge it has.
  • An AI agent takes multiple steps toward a goal: it plans, calls tools and checks its results.
  • An AI coworker is an agent that works inside your organization’s context. It knows your definitions, respects your permissions, and leaves work that others can review and build on.

Databricks describes Genie One as an AI coworker for business users. In Genie the three properties map to concrete features: the knowledge store holds the context, Unity Catalog enforces the permissions, and the Monitor tab, benchmarks and shared conversations make the work reviewable. That last part is why the subject matter expert’s role is ongoing rather than a one-time setup.

What is Genie Ontology, and how does it combine modeled and learned business context?

Short answer: Genie Ontology is the context layer behind Genie: a business-aware map of your organization that Genie One and Genie Code search before they answer. It holds two kinds of knowledge.

  • Modeled knowledge is what people define, govern and certify in Unity Catalog: Pages for business terms, metric views for KPIs, domains for business areas, and certification to mark trusted assets and deprecate outdated ones.
  • Learned knowledge is what Genie infers on its own: snippets of metric definitions, business rules and data relationships, extracted from existing dashboards, SQL queries, notebooks and Genie Agents, and refreshed as that work changes.

When the two conflict, modeled knowledge takes precedence. OntoRank, an authority-aware ranking algorithm, weighs source authority, certification, popularity and recency to choose the most trustworthy context for each question.

A learned snippet cannot be edited directly. To correct one, fix the asset it came from or define the concept as a Page or metric view. This is where the subject matter expert matters most: learned knowledge gives coverage on day one, and the expert turns the parts the business depends on into modeled knowledge. Databricks has also announced Ontology Manager, coming soon in Beta, with an interactive graph of entities and relationships and a review queue for promoting learned knowledge into Pages.

Docs: Genie Ontology and Announcing general availability of Genie Ontology.

How do I teach AI what our business terms and metrics mean?

Short answer: Write each business term as a governed Page, define each KPI once as a Unity Catalog metric view, and certify what the business should trust.

  1. Write a Page for each business term, with its definition, synonyms and a named owner.
  2. Define each KPI once as a Unity Catalog metric view.
  3. Group assets into domains that match how the business is organized.
  4. Certify what is trusted and deprecate what is outdated.
  5. Check what Genie learned. Click Genie Ontology under any answer to see the snippets it used, then correct the source or promote the concept to a Page.

How do subject matter experts give a Genie Agent their knowledge?

Figure 1: Genie as the SME multiplier. One expert’s knowledge, captured once, serves every business user who asks.
Figure 1: Genie as the SME multiplier. One expert’s knowledge, captured once, serves every business user who asks.

An SME teaches a Genie Agent through the Configure tab of the agent editor. No code is required for most of it. There are six places to put knowledge, and each maps to something the SME already knows.

  1. General instructions. Plain-text guidance for domain jargon, logic and formatting. “Fiscal year starts in February.” “Net sales excludes returns and employee discounts.” Each text block counts as one instruction.
  2. SQL expressions. Named Filters, Measures and Fields, each with a Name, Code, Synonyms and Instructions. This is where a KPI definition goes, written once as SQL so every team gets the same number.
  3. Example queries. A sample SQL statement paired with the business question it answers, with optional parameters and usage guidance that says when to use it.
  4. Joins. Explicit join conditions with a Relationship Type of Many to one, One to many or One to one, so the agent does not inflate totals on ambiguous joins.
  5. Table and column metadata. Descriptions and synonyms on tables and columns, plus the ability to hide columns the business should never see.
  6. Entity matching and format assistance. Distinct values of a column so “Pacific Northwest” resolves to the right region code, and formatting rules for how numbers come back.
Figure 2: The interfaces where an SME pours in knowledge: instructions, SQL expressions, example queries and joins.
Figure 2: The interfaces where an SME pours in knowledge: instructions, SQL expressions, example queries and joins.

The limits worth knowing: an agent holds up to 100 instructions and 200 knowledge store snippets, where table descriptions, joins and SQL expressions all count toward the 200. Entity matching supports up to 120 columns with 1,024 distinct values each.

Is Genie perfect on day one? No. With feedback it matures like any new team member, except this one does not quit, forget or get overloaded. For the business the loop becomes:

  • Need a new KPI? Add it as a SQL expression.
  • Want to test a hypothesis? Ask the agent and refine.
  • Need to revisit the why, what and how behind a result? The context is already there.

Docs: Genie Agent knowledge store.

How do I write effective instructions for a Genie Agent without over-prompting?

Short answer: Write fewer, cleaner instructions and push everything else into structured knowledge. That is the single pattern I have seen separate agents that stay accurate from agents that drift.

Three rules from the Databricks guidance and from my own tuning sessions:

  1. General instructions cover only context that applies globally. If a rule applies to a subset of questions, it belongs in an example query, a SQL function or a table comment, not in the instruction block.
  2. Keep instructions free of conflicting or ambiguous information. Two instructions that define “active customer” differently will produce two answers. Resolve the conflict in the business before writing it into the agent.
  3. Prefer SQL expressions over prose for anything numeric. “Gross margin is revenue minus COGS” as text invites interpretation. The same definition as a Measure with synonyms is deterministic.

A practical test: if you cannot explain an instruction to a new analyst in one How can AI know which definition of a metric to use?

Make sure only one definition carries each name. Genie maps the words in a question to SQL expressions, metric views and synonyms; if two definitions share a name, it has to guess.

  1. Resolve conflicts in the business first. If finance and merchandising define “net sales” differently, that is a decision for them, not a prompt.
  2. Name legitimate variants distinctly, such as net_sales_finance and net_sales_merch, each with synonyms and an instruction saying when it applies.
  3. Store the definition as a SQL expression or in a metric view, never only in prose.
  4. Make it checkable. Genie shows the SQL behind every answer, so a user can see which definition ran, and benchmark questions catch it when the wrong one is chosen.sentence, it is not ready to be an instruction.

How do I use SQL expressions and example queries to teach a Genie Agent accurate SQL patterns?

Short answer: Use SQL expressions for the vocabulary and example queries for the grammar.

SQL expressions are reusable building blocks. A Measure named net_sales with the synonyms "net revenue" and "sales after returns" means any phrasing lands on one definition. A Filter named current_fiscal_year saves every user from re-explaining the fiscal calendar. A Field exposes a derived column such as customer_tenure_band.

Example queries show the agent how those blocks combine for the questions people actually ask. Pair each sample SQL with its question title, add parameters where the question has variables such as region or week, and fill in the usage guidance so the agent knows when the example applies.

My rule of thumb for a new agent: start with the ten questions the SME answers most often in email. Write each as an example query, extract the shared metrics into SQL expressions, then run them as benchmarks (covered below) before inviting business users.

How do I upload CSV, Excel, PDF, and image files to a Genie One conversation to blend external data with my organization’s tables?

Short answer: Drag the file into the Genie One or Genie Agent chat, or use the attachment control, then ask your question. Genie analyzes the file alongside governed tables, and the file stays private to your conversation.

Figure 3: Excel, the undisputed king of ad hoc business data.
Figure 3: Excel, the undisputed king of ad hoc business data.

Not all business data lives in the warehouse. Campaign trackers, local sales sheets, hand-curated reference lists and pilot results live on desktops and in email threads. Genie lets a user bring those files into the same conversation as governed tables.

In Genie One, drag a file into the chat or use the attachment control. Supported types and limits as of the current docs:

  • CSV, Excel (.xlsx, .xls): under 200 MB each; multi-sheet workbooks supported, query a sheet by name
  • PDF: under 20 MB and 100 pages; Genie reads up to 4,000 characters per page
  • Images (PNG, JPG, JPEG): under 5 MB; larger images are downscaled
  • Word, PowerPoint: .docx, .ppt, .pptx
  • Markdown, text: under 20 MB

Up to 100 files per conversation, five per action. Uploaded files are private to the conversation and stored in a Unity Catalog managed volume.

In a Genie Agent, the same drag-and-drop works for CSV and Excel under 200 MB and 100 columns, up to 25 files per conversation. Two prerequisites: a workspace admin must leave “Upload data using the UI” enabled, and the user needs at least CAN VIEW on the agent.

Figure 4: Adding an Excel file to a Genie conversation so ad hoc data sits alongside enterprise tables.
Figure 4: Adding an Excel file to a Genie conversation so ad hoc data sits alongside enterprise tables.

What this gives the business:

  • Users explore their own spreadsheets side by side with official data in one question.
  • SMEs validate a candidate KPI against a quick extract without waiting weeks for a pipeline.
  • Knowledge trapped in orphaned spreadsheets becomes part of the analysis record instead of disappearing.

Docs: Upload files in Genie One and File upload in Genie Agents.

What data sources can Genie use for answers and analysis?

Short answer: Genie can use Unity Catalog tables, views and metric views attached to a Genie Agent, files a user uploads to a conversation, and documents in attached Unity Catalog volumes.

  • Unity Catalog tables, views and metric views attached to the Genie Agent, up to 50 per agent, with five or fewer recommended.
  • Files a user uploads to a conversation: CSV and Excel, plus PDF, Word, PowerPoint, images and text in Genie One.
  • Documents in Unity Catalog volumes attached to a Genie Agent, searched in Agent mode for answers that cite the source files.

Genie queries only what is attached, and always as the user asking, so Unity Catalog permissions apply to every source.

How do I enable Genie users to give feedback on answers so quality improves?

Short answer: Every Genie Agent response ends with the question “Is this correct?” and three choices: Yes, Fix it, or Request review. That is the feedback channel, and it is on by default.

What happens next is the part SMEs need to understand: the agent’s behavior does not change based on user feedback alone. Feedback is a signal to the agent’s authors, who close the loop in the Monitor tab.

  1. Review. The Monitor tab lists questions and responses, filterable by time, rating, user and status. A weekly digest shows message volume, active users and thumbs up and down.
  2. Fix. Open a bad response and choose Add as instruction to turn the correction into knowledge immediately.
  3. Mine. Analyze Agent Usage launches Genie Code, which reviews up to six months of messages and feedback and proposes context changes with citations to the source conversations. The author accepts or rejects each one.
  4. Suggest. When an author gives a thumbs-up or downloads results, Genie analyzes that query and may suggest new SQL expressions and joins for review.

Conversations marked Reviewable by agent managers can be opened by anyone with CAN MANAGE. Private conversations show only the prompts.

Docs: Monitor and improve a Genie Agent.

How do I test Genie Agent answers before rolling out to business users?

Short answer: Test Genie Agent answers with benchmarks before rolling out to business users. Add the questions they will ask, give each a reviewed SQL Answer, run the benchmark, and fix the knowledge store until the results are marked Good.

Benchmarks are the SME’s regression test. Add up to 500 questions with Add benchmark. For each, write or generate a SQL Answer and review it; only questions with a SQL Answer can be scored automatically.

Run them in Chat mode, which compares result sets against the SQL Answer and marks each response Good or Bad, or in Agent mode, which uses an LLM judge with an optional Evaluation note. Results land in the Evaluations tab with an accuracy figure per run. Open a run to compare Model output against Ground truth, and click Update ground truth when the model found a better answer. Genie Code can analyze a whole run and suggest context improvements.

My practice: every KPI the SME defines gets a benchmark question the same day. If the number in the benchmark drifts, the knowledge store needs attention before any user notices.

How do I configure Genie Agent to prefer a specific data model or metric view?

Short answer: I have not found a setting that ranks one source above another. You steer a Genie Agent toward a data model or metric view through what you attach to it and how you describe it.

  1. Attach only the model you want used. Genie does not query tables or functions that are not attached to the agent, so the most reliable preference is to leave the alternatives out.
  2. Remove overlap. If two attached tables can answer the same question, Genie has to choose. Remove unnecessary or overlapping tables and columns, and hide columns that are confusing.
  3. Use a metric view for KPIs. Metric views work well as Genie Agent sources because they pre-define the metrics, dimensions and aggregations.
  4. Describe sources the way users ask. Table and column descriptions should match how business users phrase their questions.
  5. Add an example query on the preferred source for each common question, so Genie can match the prompt to verified SQL.
  6. Benchmark it. Add a benchmark question whose SQL Answer reads the preferred source, and rerun it after every change.

How do I handle Genie Agent responses that contradict dashboard metrics due to data freshness differences?

Short answer: First check whether the two are reading data of different ages. An AI/BI dashboard keeps a result cache for up to 24 hours, so a dashboard tile can be older than the answer a Genie Agent gives for the same metric.

  1. Compare the timing before the logic. The dashboard cache can return results up to 24 hours old even when the underlying data has changed.
  2. Schedule the dashboard. A dashboard schedule is the reliable way to refresh its cache. Set it to run after the pipeline that loads the data finishes.
  3. Check materializations. If the metric view is materialized, queries that match the materialization use its last refresh, and that refresh runs on the schedule defined in the metric view. Align it with the same pipeline.
  4. Point both at one definition. When the dashboard and the Genie Agent read the same Unity Catalog metric view, timing is the only difference left to explain.
  5. Tell users which is which. Put the refresh time on the dashboard so a mismatch reads as timing and not as two versions of the number.

Docs: Dashboard caching and Metric view materialization.

How do I correct Genie when it infers the wrong metric from my data?

Short answer: Correct it in the conversation first, then make the correction permanent by defining the metric explicitly in the Genie Agent’s knowledge store or in Unity Catalog.

  1. Read the generated SQL to see which column or calculation Genie used.
  2. Clarify in the chat. A user can restate what the metric means, or choose Fix it under the response.
  3. Define the metric once. As the author, add it as a SQL expression with synonyms, or as a Unity Catalog metric view if dashboards share it. Prefer this over a text instruction.
  4. Add an example query for the question that went wrong.
  5. If the definition was learned by Genie Ontology, you cannot edit that snippet. Fix the asset it came from, or define the concept as a Page or metric view. Modeled knowledge takes precedence over learned knowledge.
  6. Add a benchmark so the wrong metric cannot quietly return.

How do I debug when a Genie agent ignores my custom instructions and produces incorrect responses?

Short answer: Assume the instruction is losing to something else in the agent’s context. Read the SQL Genie generated, then remove conflicts and replace prose with examples.

  1. Read the generated SQL. It shows what Genie actually did with your instruction.
  2. Start a new chat. Earlier messages in a conversation can influence later responses.
  3. Look for conflicts across instruction types. If a text instruction says to round to two decimals, the example SQL has to round to two decimals as well.
  4. Cut instructions. Too many instructions can reduce effectiveness, especially in longer conversations. Databricks advises using text instructions only as a last resort.
  5. Replace prose with structure. Turn the rule into an example query or a SQL expression.
  6. Simplify what Genie sees. Hide irrelevant columns, or create a simpler view.
  7. Lock it in with a benchmark once the response is right.

Docs: Troubleshoot Genie Agents.

How do I migrate KPIs from existing BI tools into Genie without losing their definitions?

Short answer: Export the metric definitions, not the dashboards. A Tableau calculated field or a Power BI DAX measure is already a business definition; the migration is translating each into one of two Unity Catalog constructs.

  1. Unity Catalog metric views for metrics that must be shared across dashboards and agents. Define measures and dimensions once in the catalog, and point both AI/BI dashboards and the Genie Agent at the same view.
  2. SQL expressions in the Genie Agent for metrics that only matter inside that domain’s conversations. Faster to create, scoped to the agent.

Either way, keep the business description and synonyms with the metric. That is the part BI tools usually drop and the part Genie needs most.

How do I configure Genie Agent mode for multi-step investigations versus simple Q&A?

Short answer: Ask the question in Agent mode in a Genie Agent. It builds a research plan, runs several SQL queries and returns a report with citations that explains why the metric moved.

Figure 5: An Agent mode report in a Genie Agent, showing the research plan, the queries run and the cited result.
Figure 5: An Agent mode report in a Genie Agent, showing the research plan, the queries run and the cited result.

Answering “what happened” is retrieval. Answering “why” is investigation. Agent mode, formerly called Research Agent, lets users get answers to complex, exploratory questions in a Genie Agent. It creates and refines a research plan, runs multiple SQL queries, iterates on what it finds, and delivers a comprehensive report with citations, visualizations and supporting tables.

Three questions it is built for:

  • Why did sales drop in the Northwest? Agent mode correlates weather events, inventory shortages and promotion effectiveness instead of returning one number.
  • What drove the churn spike last quarter? It works across customer interactions, loyalty usage and service tickets to surface drivers.
  • How should we respond? It names the levers the data supports: pricing, campaign timing, assortment.

Because it draws on the SME’s knowledge store, the governed tables and any files added to the conversation, the report reads less like a dashboard export and more like a note from an analyst who knows the business.

The bigger picture

Short answer: For me the most powerful part of Genie is not the model. It is what the setup represents:

  • A way to scale SME wisdom without burning the SMEs out.
  • A safeguard against losing critical knowledge when people move on.
  • A bridge between business curiosity and data execution.
  • A home for the one-off spreadsheets that quietly run day-to-day decisions.

Genie does not replace people. It multiplies their impact, so the why, what and how of a business sharpens over time instead of walking out the door.

Key takeaways

  • A Genie Agent’s knowledge store is where SME knowledge lives: instructions, SQL expressions, example queries, joins, metadata and entity matching, up to 100 instructions and 200 snippets.
  • Keep instructions global and conflict-free; put numeric logic in SQL expressions.
  • Users can add CSV, Excel, PDF and image files to a conversation and analyze them alongside governed tables.
  • Feedback does not retrain the agent by itself; authors close the loop in the Monitor tab, with Genie Code proposing changes.
  • Benchmarks are the regression test for every KPI definition.
  • Agent mode turns “what happened” into “why, and what next.”

FAQ

Can a business user set up a Genie Agent without SQL?

Yes for instructions, descriptions, synonyms and entity matching. SQL expressions, example queries and benchmark answers need SQL, but Generate SQL in the editor drafts them for review.

Does uploading a spreadsheet make it visible to others?

No. Uploaded files are private to the conversation and the uploader, stored in a Unity Catalog managed volume.

Does a thumbs-down change the agent’s answers?

Not on its own. It flags the response for the author, who can convert the correction into an instruction or accept Genie Code’s suggested changes.

What is the difference between Genie One and a Genie Agent?

Genie One is the simplified entry point for business users across data and AI. A Genie Agent is a domain-specific agent with its own knowledge store that Genie One can call.

Is Agent mode the same as Deep Research?

Databricks calls the feature Agent mode; it was formerly named Research Agent. It is the multi-step investigation mode inside a Genie Agent.

Thanks for reading. Let’s connect on LinkedIn.

More articles: Towards Data Experience

Author: Himanshu Gaurav, himanshugaurav.com

Note: all opinions expressed here are my own and do not reflect the views of any organization I am affiliated with.