Semantic Layer
An abstraction layer that translates complex database structures into business-friendly terms and metrics.
In Depth
A semantic layer (also called a metrics layer or business layer) is an abstraction between raw database tables and end users that maps technical database structures to business-friendly concepts. It defines metrics (how to calculate revenue, churn, etc.), dimensions (how to slice data), and relationships in business terms. For example, it might map the column "amt_usd" to the business metric "Revenue" and define the calculation logic. Semantic layers ensure consistency—everyone calculates "Monthly Active Users" the same way. Tools like dbt metrics, Looker's LookML, AtScale, and Cube.js provide semantic layer capabilities. For AI database interfaces, semantic layers dramatically improve text-to-SQL accuracy by providing business context.
How AI for Database Helps
AI for Database builds an internal semantic layer from your schema, table descriptions, and usage patterns to ensure accurate query translation.
Related Terms
Ready to try AI for Database?
Query your database in plain English. No SQL required. Start free today.