Data Governance · 3 min read

Google's context sets stop Gemini agents guessing what 'revenue' means

A Google Cloud walkthrough shows Gemini Enterprise returning a wrong second revenue figure without business context — and one sourced answer with Knowledge Catalog context sets enabled.

By Grace Kim627 words

Key takeaways

  1. Without business context, Gemini Enterprise reported two revenue figures, one subtracting returned orders twice.
  2. Knowledge Catalog connectors import Snowflake Horizon semantic views and Databricks Unity Catalog metric views via BigQuery Data Transfer Service jobs.
  3. A context set (Preview) in Knowledge Studio linked the imported models with nine links; a GitHub script creates it.
  4. Context sets and the Gemini Enterprise Knowledge Catalog integration in federated query mode are both in Preview.
  5. Agents search Knowledge Catalog per-user, so access to context sets and tables can be scoped to specific groups.
Google's context sets stop Gemini agents guessing what 'revenue' means
AI-generated

Google's own test of Gemini Enterprise against cross-cloud data produced two revenue figures. One was wrong. The culprit wasn't the SQL; it was the absence of business definitions.

Customer Engineer Praveen Kumar's walkthrough on the Google Cloud blog pairs the company's borderless Lakehouse — BigQuery querying Snowflake, Databricks and AWS Glue data in place — with Knowledge Catalog's context sets, so agents answer questions the way the business defines them rather than the way a language model improvises.

Why does the same question return two answers?

In the example, fictional retailer Cymbal Shop keeps orders and customers in Snowflake, loyalty members and app visits in Databricks. Finance defines revenue in a Snowflake semantic view — completed orders only. Marketing defines loyalty tiers in a Databricks metric view. Neither model says customer_id joins the two systems.

An agent that can query the tables but can't see those definitions has to decide what "revenue" means itself. Asked "What was our revenue by loyalty tier?" with the Knowledge Catalog integration turned off, Gemini Enterprise joined the tables correctly and then reported two figures: revenue from completed orders, and a "net revenue" that subtracted returned orders a second time. Double-counting the returns. Wrong number.

What fixes it?

Three moving parts, all in preview or production within Google's stack:

  • Semantic model imports. Knowledge Catalog's built-in connectors for Snowflake Horizon and Databricks Unity Catalog run as BigQuery Data Transfer Service jobs, importing semantic views and metric views with formulas, descriptions, synonyms and relationships into entry groups (the demo uses snowflake_horizon and databricks_unity).
  • A context set (Preview). Built in Knowledge Studio, it links the imported models — rather than copying them — to their Lakehouse tables, plus one business-rules document stating that customer_id connects Snowflake customers to Databricks loyalty members. A GitHub script in the lakehouse-solutions repository creates the set, its documents and all nine links.
  • Gemini Enterprise in federated query mode (Preview). This turns on the Knowledge Catalog integration automatically. The agent looks up context through Knowledge Catalog search — semantic and keyword matching, machine-learned re-ranking, built on Google Search technology — then queries the data through BigQuery.

One sentence of assistant configuration does the rest: "Before writing SQL, look up the source semantic model's own catalog entry (Snowflake or Databricks), not just the summary attached to the context set, and use its relationships and metric definitions."

With context enabled, the agent returned one revenue figure per tier, citing the NET_SALES metric from the Snowflake semantic view, the loyalty tiers from the Databricks metric view, and customer_id as the join key. A single figure, with provenance.

What should a data team actually take from this?

The demo is vendor-constructed, and the wrong-answer scenario is conveniently dramatic. Still, the failure mode is real: agents with table access and no semantic layer will guess, confidently.

Practical notes worth keeping:

  • Deterministic SQL: recreate Snowflake and Databricks definitions as BigQuery measures on a property graph, built on native BigQuery tables or Lakehouse Iceberg REST catalog tables. Queries reuse stored measures instead of rewriting formulas, and BigQuery adds the graphs to Knowledge Catalog automatically.
  • Put other cross-system rules — fiscal calendars, source-of-truth assignments — in context set documents.
  • Access is per-user: Gemini Enterprise searches Knowledge Catalog with each user's own credentials, so grant the context set and its tables only to the groups that should see them.

The connectors need read-only identities in Snowflake and Databricks; the grants and setup scripts are in the lakehouse-solutions GitHub repository. Everything runs as a project owner, and the whole flow took one blog post to document — which tells you the plumbing is now the easy part. The hard part remains deciding, once, what revenue means.

Google News: Data Engineering (Source)

Price tags

Share this article:

More from Grace Kim

Grace Kim

Show full bio

Market editor covering companies, deals and strategy in Analytics Digest is a professional daily at Analytics Digest.

81 articles

Read also

« Previous article