Your AI has a data comprehension problem

You have built the pipeline. Your RAG system retrieves relevant documents. Your LLM generates fluent, confident answers. And yet, when your finance team asks “what was our net operating income across the Manchester portfolio last quarter?” the AI confidently returns a number that is wrong by 40%.

The problem is not retrieval. The problem is not the model. The problem is that your AI does not understand your data — it only reads it. It does not know that “NOI” in your system means gross rental income minus operating expenses excluding capital expenditure and debt service. It does not know that “Manchester portfolio” maps to a specific set of entity IDs across three different databases. It does not know that last quarter means your fiscal quarter, which starts in February.

This is the gap that a semantic layer fills. And if you are building AI applications on top of enterprise data, it is the most important architectural pattern you are probably ignoring.

What a semantic layer is (and is not)

A semantic layer is a structured abstraction that sits between your raw data and your AI. It defines business concepts — metrics, dimensions, relationships, and calculations — in a way that both humans and machines can understand unambiguously. It is not a data warehouse. It is not a view layer. It is a shared vocabulary that gives meaning to data.

In traditional BI, the semantic layer has existed for decades — tools like LookML, dbt metrics, and even OLAP cubes served this purpose. But those semantic layers were designed for SQL-literate analysts, not for LLMs. The new generation of semantic layers must be machine-readable, version-controlled, and rich enough to support natural language queries without ambiguity.

When we built the analytics capabilities for BTR Quant, our quantitative terminal for the build-to-rent industry, we learned this the hard way. Early versions let users query data in natural language, but without a semantic layer, the same question asked slightly differently would produce different results. “Vacancy rate” and “void rate” mean the same thing. “Revenue” might include or exclude service charges depending on who is asking. The semantic layer resolved these ambiguities permanently.

Without a semantic layer, every AI query is an exercise in interpretation. With one, it is an exercise in retrieval — and retrieval is a solved problem.

The architecture of a machine-readable semantic layer

A semantic layer for AI applications has four components. First, a concept registry that maps business terms to their technical definitions — column names, formulas, join paths, and valid filters. Second, a relationship graph that captures how concepts relate to each other (a property belongs to a portfolio, a portfolio belongs to a fund, a fund has investors). Third, a context resolver that translates natural language references into specific queries against the registry. Fourth, a validation engine that checks whether a generated query is semantically valid before executing it.

The concept registry is the foundation. Each entry defines a business metric with its calculation logic, valid dimensions, default aggregations, and access controls. When a user asks about “NOI,” the registry provides the exact formula, the tables involved, the join conditions, and the filters that should be applied by default. The LLM does not need to infer any of this — it looks it up.

This approach dramatically reduces hallucination on data queries. Instead of asking the model to reason about data structure, you give it a structured tool to call. The model’s job becomes intent parsing and parameter extraction, which LLMs are excellent at, rather than schema inference, which they are unreliable at.

Building your own semantic layer

Start with your most-queried metrics. In our experience across PMS and BTR Quant, roughly 20 core metrics account for 80% of all analytical queries. Define these first. For each metric, document the canonical calculation, the source tables, the valid dimensions (time, geography, entity), and the edge cases (how do you handle partial periods? What about vacant units?).

Store these definitions in a format your AI can consume — YAML or JSON schemas work well. Version-control them alongside your application code. Treat changes to the semantic layer with the same rigour as schema migrations — because that is effectively what they are, except for meaning rather than structure.

  • Map every synonym and abbreviation to its canonical term
  • Define hierarchies explicitly (property → portfolio → fund)
  • Include example queries with expected outputs for testing
  • Add temporal logic rules (fiscal year boundaries, reporting lag)

What this means for your team

If you are building AI on top of business data, a semantic layer is not optional — it is the difference between a demo that impresses and a product that delivers. The investment is significant upfront: you need domain experts and engineers working together to codify business knowledge that currently lives in people’s heads. But once built, it compounds. Every new AI feature you ship benefits from the same shared understanding. Every new team member inherits institutional knowledge that would otherwise take months to absorb. And every query your users run returns answers they can actually trust.