---
title: "Databricks metric views: is that enough for agents? | Rig"
description: "Databricks metric views give you a semantic layer in Unity Catalog. Here is what they cover, and what agents still need: a role, row limits and a log."
canonical: "https://rig.so/blog/databricks-context-layer-and-metric-views"
format: markdown
---

[Data context and governance](https://rig.so/blog/data-context)

# I wouldn't let an agent loose on a Databricks metric view and nothing else

Databricks metric views are metric definitions registered in Unity Catalog. Each one keeps measures separate from dimensions, so you can group and filter a measure at query time without rewriting the calculation, and you query them with SQL. They are the semantic layer inside the lakehouse. An agent that queries them also needs its own role and log.

By [Toby Mather](https://rig.so/blog/authors/toby-mather) · Published 20 November 2026

[Request an architecture diagram for your stack](https://rig.so/book-demo?offer=architecture_diagram&from=%2Fblog%2Fdatabricks-context-layer-and-metric-views)

## Key takeaways

- Databricks calls metric views the core implementation of Unity Catalog semantics. For most teams they are the Databricks semantic layer.
- A metric view is defined once over tables, views or queries, and the person asking picks the grouping at query time, where a standard view fixes it when you create it.
- Unity Catalog adds privileges, row filters, column masks, lineage and an audit log system table around the metric view.
- Genie Agents can attach metric views as data sources and check data access against each end user's own Unity Catalog permissions.
- An agent that connects with a shared login or a person's token looks like that login to Unity Catalog. Give every agent an identity, a scope and a log of its own.

1. 01**Lakehouse tables**
   
   Delta tables and views
2. 02**Metric views**
   
   Registered in Unity Catalog
3. 03**Gateway**
   
   Role, scope and log per agent
4. 04**Genie and other agents**
   
   Ask the questions

Metric views sit over lakehouse tables in Unity Catalog. Genie and other agents reach them through a gateway that knows which agent is asking.

## What is a Databricks metric view?

A metric view is an object in Unity Catalog that holds business metric definitions. You build it on source tables, views or queries, and you create it with SQL DDL or in Catalog Explorer, which validates the YAML definition as you write it.

Inside the definition you declare the source, the fields people can group and filter by (Databricks calls these dimensions), and the measures themselves. The modelling options include filters, star and snowflake schemas with multi-level joins, window measures and parameters. Databricks can also materialize common aggregations, and the query engine rewrites a query to use them when it can.

## How do measures and dimensions work when you query one?

Measures are kept apart from dimensions. A standard view bakes the aggregation and the grouping in when you create it, so revenue by month and revenue by region need two views. A metric view defines revenue once, and the person or tool asking picks the grouping at query time.

You query metric views from SQL editors, notebooks, dashboards, Genie Agents and alerts, and Databricks documents connections for external BI tools such as Power BI, Tableau and Sigma. An agent can ask for the measure by name and get the calculation your team approved, so it does not rebuild that calculation from raw columns.

## Is a metric view the same as a Databricks semantic layer?

In practice, yes: Databricks describes metric views as the core implementation of Unity Catalog semantics, and relationships between metric views are in Beta at the time of writing. If you search for a Databricks semantic layer, this is the object you will be pointed at.

A semantic layer is a dictionary of definitions for business numbers. It tells an agent what net revenue means. The agent also needs to know which of your other tables hold the contract terms, which column the sales team trusts, and that the finance schema is off limits to the marketing assistant. That map of systems, tables, joins and business terms is the context layer, and it sits around the metric views.

## What does Unity Catalog add for access, lineage and audit?

Unity Catalog is the governance layer built into Databricks. Its documentation lists access control through privileges, attribute-based policies, row and column filters and workspace bindings, lineage tracked from source data through to models and dashboards, and an audit log system table for data access and system activity.

Metric views inherit all of that. A user needs privileges on the metric view to query it, row filters and column masks on the sources still apply, and the audit log records the access.

Unity Catalog evaluates the identity that runs the query, and that is where agents cause trouble. If five agents share one service principal, or an agent connects with a person's token, the log shows that principal or that person, and you cannot tell which agent pulled the data.

## Why do AI agents need more than a metric view?

Genie is the first agent most Databricks teams try. A Genie Agent (formerly a Genie space) can attach up to 50 tables, views or metric views, and Databricks says data access is always evaluated with each end user's own Unity Catalog permissions. When a person asks Genie a question, the right identity is in place.

Agents that run on a schedule, or that a whole team shares in Notion, Slack or Claude, have no single person behind them. They need an identity of their own, a scope narrower than the person who set them up, a limit on how often they can call, and a log entry under their own name for every query. Databricks offers managed MCP servers that use the caller's Unity Catalog permissions. That works when the caller is a person, and leaves shared and scheduled agents with no caller identity at all.

Genie gives better answers on certified metric views than on raw tables. Our Genie how-to explains why and walks through the setup.

## How Rig does it

Rig connects to a Databricks SQL warehouse with a read-only identity, reads Unity Catalog and builds a context layer over your tables, joins and metric definitions. Queries run as Databricks SQL on your own compute. Rig Map holds that context next to your certified metrics, so an agent can find the right metric view and the tables around it before it writes a query.

Gateway adds the agent identity. Each agent gets its own role, copied from one you already trust and narrowed for that agent, plus its own token and a daily call cap. You control which datasets it reaches, which columns are masked and which rows it sees, and every call it makes appears in the audit log with the agent's name. Tables that filter rows per person stay closed to agents, because an agent has no personal identity to filter on. Cleo uses the same approach on its Redshift warehouse: its data team certifies metrics in Rig, and agents work through that governed layer.

## Tools and approaches

[Databricks metric views](https://docs.databricks.com/aws/en/uc-semantics/metric-views/)

Metric definitions in Unity Catalog, with measures separate from dimensions, created with SQL DDL or Catalog Explorer and queried with SQL.

[Unity Catalog](https://docs.databricks.com/aws/en/data-governance/unity-catalog/)

The governance layer built into Databricks: privileges, attribute-based policies, row and column filters, lineage and an audit log system table.

[Genie Agents](https://docs.databricks.com/aws/en/genie/set-up)

Natural-language question answering over attached tables, views and metric views, with data access checked against each end user's Unity Catalog permissions.

[dbt Semantic Layer](https://docs.getdbt.com/docs/use-dbt-semantic-layer/dbt-semantic-layer)

A cross-engine option that keeps metrics in the dbt project and serves them through MetricFlow, for teams where Databricks is one of several engines.

## Common questions

Is a metric view a table?

No. It is a definition registered in Unity Catalog over source tables, views or queries. Databricks can materialize common aggregations to speed up queries, and the definition stays the source of truth.

Do I need Unity Catalog?

Yes. Metric views are Unity Catalog objects, and Genie Agents only use data registered in Unity Catalog.

Can I use dbt metrics as well?

Yes. Some teams keep metrics in dbt for several engines and publish metric views for Genie and Databricks dashboards. Give each metric one owner and generate the other copy from it, so the two never disagree.

How does this compare to Snowflake semantic views?

They solve the same problem in different engines. A Snowflake semantic view is a schema-level object with logical tables, relationships, facts, dimensions and metrics, read by Cortex Analyst and Cortex Agents. A Databricks metric view lives in Unity Catalog and is read by Genie and Databricks dashboards.

Are metric views enough for AI agents to query safely?

They give agents correct definitions. Safe access also needs an identity per agent, a narrow scope, row limits and a log of every query, which is the job of a gateway in front of the warehouse.

## Related reading

[Data context and governance](https://rig.so/use-cases/data-context-and-governance)[Rig Map](https://rig.so/products/rig-map)[Gateway](https://rig.so/products/gateway)[Pointing Genie at raw tables is a fun way to get confident wrong answers](https://rig.so/blog/databricks-genie-semantic-layer)[Databricks MCP: named agents, logged calls](https://rig.so/mcp/databricks)[Databricks](https://rig.so/integrations/databricks)[If dbt holds the metrics, who decides who can query them?](https://rig.so/blog/dbt-semantic-layer-vs-warehouse-native-semantic-views)[Horizon and Unity Catalog still won’t tell you which agent ran the query](https://rig.so/blog/warehouse-governance-for-ai-agents)[Agent roles](https://rig.so/guides/agent-roles)[Cleo case study](https://rig.so/case-studies/cleo)

## Sources

Vendor documentation checked on 20 November 2026. Confirm current features and terms with the vendor.

- [Databricks metric views](https://docs.databricks.com/aws/en/uc-semantics/metric-views/)
- [What is Unity Catalog?](https://docs.databricks.com/aws/en/data-governance/unity-catalog/)
- [Create and manage a Genie Agent](https://docs.databricks.com/aws/en/genie/set-up)
- [Databricks managed MCP servers](https://docs.databricks.com/aws/en/generative-ai/mcp/managed-mcp)
- [Snowflake semantic views overview](https://docs.snowflake.com/en/user-guide/views-semantic/overview)

## About the author

[Toby Mather](https://rig.so/blog/authors/toby-mather), Co-founder and CEO, Rig. Toby co-founded Rig after seeing how hard it was for business teams and AI to work with complex internal data. He was previously co-founder and CEO of Lingumi and CPO at Novakid.

Talk to Rig

## See your stack drawn as one diagram

An architect drafts a one-page diagram of your warehouse, sources and access path, then offers a 30-minute walkthrough.

[Request an architecture diagram for your stack](https://rig.so/book-demo?offer=architecture_diagram&from=%2Fblog%2Fdatabricks-context-layer-and-metric-views)[Book a call with an architect](https://rig.so/book-demo?offer=architect_call&from=%2Fblog%2Fdatabricks-context-layer-and-metric-views)

---

- [This page as HTML](https://rig.so/blog/databricks-context-layer-and-metric-views)
- [Site map for language models](https://rig.so/llms.txt)
- [API and agent documentation](https://rig.so/developers)
