15 Aug, 2025

7 MIN READ

The ultimate guide to semantic layers for AI

Asawari Samant
Asawari Samant

tl;dr – AI-powered analytics initiatives in enterprises often fail because they lack the business context required for enterprise-grade accuracy. A well-designed semantic layer system can fix this by encoding your organization’s metrics, definitions, and rules into a machine-readable model that teaches LLMs how to reason about your data and business. In this article, we cover what makes a good semantic layer, evaluate the current semantic layer tooling landscape and its shortcomings for the AI era, and describe how we are addressing this with PromptQL.

Why is my AI analyst confidently wrong?

The demand for AI-powered analysis is exploding as businesses push for more self-serve analytics, faster insights, and the ability to do more with less. But, most "AI analyst" tools are falling short.

Suppose you ask your AI analyst a simple question:

“Is our current WIP inventory at Seven Oaks trending low?”

Will it know how to answer? Probably not.
Will that stop it from giving you an answer? Definitely not.

The problem is that AI lacks the deep business context needed to interpret both your questions and the data behind them. Do you have to explain what “WIP” or “low” means in this particular context? Or even what “Seven Oaks” refers to in your company’s structure? Which systems and tables hold the authoritative metrics?

Without that context, even the most advanced AI can sound authoritative while being completely wrong. And in the enterprise, that kind of misplaced confidence is a liability.

Could I just manually add context?

You could… for a while.

The first instinct is to just feed the context in the prompt:

  • “By revenue, we mean net revenue excluding refunds and discounts.”
  • “Active user means a logged-in user who has transacted in the last 30 days.”

This can work in small, controlled cases. But it’s not scalable.

  • Will every analyst include the same definitions?
  • Will they use the same words and filters every time?
  • What happens when a definition changes?

Manual context injection is time-consuming, inconsistent, and impossible to govern across an entire business.

Can a semantic layer solve the AI accuracy problem?

Injecting context into every prompt doesn’t scale. To get consistent, high-quality answers, you need to move from prompt engineering to context engineering – and a semantic layer can be a valuable tool.

A semantic layer is a centralized model of your organization’s metrics, definitions, relationships, and business rules. It can be a shared, authoritative source of truth to teach LLM how to reason about your data and business.

When your LLM is paired with context via a semantic layer:

  • It uses the same definitions you do – “active user” means what you say it means, every time
  • It respects your business logic – calculations, filters, and rules are applied consistently
  • It eliminates ambiguity – there’s no room for AI to guess intent or hallucinate

And because everything is pulling from the same semantic model, your answers stay accurate, consistent, and trustworthy – no matter who’s asking.

What makes a good semantic layer for AI use cases?

Semantic layers have been around in one form or another for a long time, but many weren’t built with AI usage in mind.

So what should you look for in an AI-ready semantic layer that is more than a basic dictionary?

Easy to bootstrap

A semantic layer should make it simple to model your business.

Most organizations already have the raw ingredients – documentation, operating principles, database schemas, and BI definitions. You should be able to leverage those assets to stand up a working semantic layer in hours or days, not months.

Key capabilities to look for:

  • Bootstraps from existing sources – Ingest definitions from structured sources (e.g., database schemas) and unstructured sources (e.g., internal wikis) to automatically generate a starting point for your semantic model.
  • Flexible building – Support both declarative (YAML/DSL) and visual modeling so engineers and analysts can contribute without bottlenecks.
  • Work with diverse data backends – Connect seamlessly to multiple backends such as data warehouses, transactional databases, and APIs, enabling cross-source analytics without a massive centralization project.

When done right, rapid bootstrapping delivers quick early wins that build momentum and buy-in for your AI analytics program.

Learns from usage

A semantic layer should be a living system that evolves seamlessly with your business. Definitions change, metrics get refined, and new concepts emerge – the right semantic layer should absorb these updates quickly and safely.

AI analytics adds another advantage: a constant stream of user feedback. Every prompt, correction, or clarification signals how the system is used and where definitions need tuning. A modern semantic layer should capture those signals and automatically translate them into model updates, with technology handling the heavy lifting instead of slow, manual processes.

Key capabilities to enable this:

  • User feedback integration – Ingest feedback signals directly from user interactions (e.g., clarifications, overrides) to update
  • Version control and rollback – Safely modify definitions and revert if needed, with full change history.
  • Automated regression checks – Detect and flag unexpected changes in metric outputs before they impact production users.

When a semantic layer learns from usage, it becomes a living intelligence layer for your organization – continuously improving through real interactions.

More than just metrics and columns

Semantic layers started as a way to centralize and maintain metric definitions. But if you want an LLMs to reason about your business like a human analyst would, you need to go far beyond basic definitions.

The semantic layer must capture the full context of your business logic, including:

  • Formalized metrics – Complete with formulas, filters, and aggregation rules
  • Organizational concepts – Terms like “priority customer” or “core product” that carry specific meaning in your company
  • Relationships and hierarchies – How metrics, concepts, and entities connect and roll up across the business
  • Business rules – The constraints, policies, and logic that govern how metrics are calculated and used

This richer context turns the semantic layer from a static reference into a reasoning framework – giving AI the same mental model your best analysts already use.

Drives execution – not passive dictionary

A semantic layer can’t stop at a human-readable definition. It needs to be in a machine-readable format that LLMs can consume – and it’s most powerful when that context flows directly through to execution.

When the semantic layer is wired into the execution path, definitions aren’t just “reference material” – they actively shape how queries are built and run. For example, an AI asking for “active users in the last fiscal quarter” shouldn’t just get the definition of active user and fiscal quarter; it should trigger a query that applies the correct filters, joins, aggregations and access control automatically.

Key capabilities to look for:

  • Direct integration with SQL, GraphQL, or API calls so definitions are enforced at query time
  • Query pushdown so filters, aggregations and access control logic are executed at the data source for performance and scalability
  • Support for diverse execution options:
  • GraphQL for flexible, nested queries
  • SQL for analytics and BI workloads
  • APIs (MCP) for orchestrating queries across multiple systems
  • Custom engines for AI-native query patterns

When done right, the semantic layer becomes the connective tissue between your business context and your execution engine – ensuring every AI-driven query runs with the right logic, every time.

Can I use traditional semantic layer tools for AI?

The term “semantic layer” gets applied to a wide range of tools with varying capabilities. Broadly, they fall into three categories:

Standalone semantic layers
Independent modeling layers that define metrics and logic outside a BI platform.
Example: dbt Semantic Layer, Cube

Bootstraps well from structured sources but needs work for unstructured context. Good at metrics and lineage; weaker on business rationale. Integrates with SQL engines, but may not support other querying modalities.

Embedded semantic layers in BI tools
Modeling built into the BI platform’s own engine.
Example: LookML in Looker, Power BI Semantic Model

Fast to set up, but limited to the BI platform they embed in. Usually captures metrics well but are dashboard / report-centric.

Data catalogs with semantic features
Governance and documentation platforms with some modeling.
Example: Atlan, Alation

Great for ingesting glossaries and relationships; good for data governance use cases. Passive in execution, so AI can’t enforce definitions.

Here is a summarized view of how the tools do on the criteria:

Category

Easy to build

Easy to maintain

Captures rich context

Drives execution

Standalone semantic layers 

🟢

🔴

🟡

🟢

Embedded in BI tools

🟢

🔴

🟡

🟢

Data catalogs 

🟡

🔴

🟢

🔴

🟢 strong fit |  🟡 mixed / conditional fit |  🔴 weak fit

Will today’s semantic layers actually improve AI accuracy?

Probably not. They can help in narrow, static use cases where context rarely changes. But for dynamic, enterprise-wide AI analytics that tackle real business questions, they require too much work to build and maintain, and won’t deliver the multi-million-dollar impact leaders expect.

How PromptQL engineered an AI-ready semantic layer?

At Hasura, we’ve spent the last decade solving enterprise data access – making it seamless, fast, and secure to query the right data. We didn’t set out to build a semantic layer, but our mission to simplify access through metadata-driven APIs led us there naturally.

You can read about Hasura's journey to AI-ready semantic layer here.

But the tl;dr is that our decade of work on metadata-driven APIs naturally evolved into a unified semantic supergraph auto-bootstrapped from sources – paired with a distributed query engine to deliver a secure, federated, enterprise-wide data access layer.

When the AI era arrived, this architecture became a technological advantage. The only missing piece was teaching LLMs how to use our metadata to reason about business questions. The result: the perfect AI-native semantic layer.

Unified semantic supergraph

  • Encodes business definitions and logic as reusable, versioned definitions
  • Stores schema, relationships, auth rules, and constraints in YAML metadata
  • Bootstraps from any source – database schemas, wikis, BI definitions
  • Fully version-controlled with an SDLC-friendly workflow

Distributed execution engine

  • Executes directly via GraphQL, SQL, or APIs, enforcing definitions at query time
  • Supports query pushdown and federation across multiple systems
  • Operates in a closed-loop feedback cycle – query outcomes feed back into the metadata to improve accuracy over time

This is the architecture behind PromptQL – delivering enterprise-grade AI accuracy for analytics and automations at some of the world’s largest companies.

The takeaway

If you want AI analytics and automations that are accurate and drive real business outcomes, you need a semantic layer – but most existing approaches won’t cut it.

To be viable for AI use cases, your semantic layer must be easy to bootstrap, effortless to maintain, and tightly integrated with a feedback loop from real usage. Without that, you’re investing in a glorified dictionary that will never deliver on its promise.


Reach out to learn more about PromptQL's semantic layer approach and how it can finally fix enterprise AI's "confidently wrong" problem →  request demo


Blog
15 Aug, 2025
PromptQL Logo

© 2025 Copyright Hasura, Inc. All Rights Reserved.