Alex Kahn

Blog · · 1:55 video

Talking to your data: why natural language analytics needs a semantic layer

We built a tool that lets anyone on the team ask questions of company data in plain English. It only worked once we built a semantic layer that teaches the AI what our terms mean and how our datasets connect.

Summary

Natural language analytics lets anyone ask a question like “How are bookings trending week over week?” and get an instant answer, chart or forecast. It works easily on one simple dataset. It breaks when you connect datasets, because systems name the same thing differently (account_id in the CRM, sold_to_party in finance) and teams define metrics like revenue differently. No off-the-shelf tool can fix that, because the knowledge is implicit and lives in people’s heads. The fix is a semantic layer: a written definition of your terms, how datasets relate, and your business rules, which then becomes a composable knowledge layer any AI tool can use.

Key points

  • Asking data questions in plain English works well on one simple dataset.
  • It breaks when you join datasets: the same customer is account_id in the CRM and sold_to_party in finance.
  • Teams also define the same metric differently, like revenue or “active customer.”
  • Vendors can’t fix this automatically, because the knowledge is implicit, not written down.
  • A semantic layer makes it explicit: what terms mean, how datasets relate, and how the business calculates things.
  • Building it takes real effort from the people who hold the context, but the result works with any AI tool.

What natural language analytics can do

We just built a tool that lets us talk to our data. Anyone on our team can ask a question like “Which geographies tend to convert the most leads?” or “How are bookings trending week over week?” And it’ll instantly generate the answer for them. It can make charts and visuals on the fly, and we can even use it to start making predictions based on our historical data.

Screenshot of the natural language analytics tool. The question 'How are bookings trending week over week?' returns a written answer (bookings up 5.7% week over week) and a bar chart of weekly bookings for the last eight weeks.

One dataset is easy. Connecting many is hard.

So, when ChatGPT first came out, this was one of those use cases that everybody immediately jumped to. And it actually worked pretty well, as long as you were working with one relatively simple dataset. The problem comes when you need to start connecting different datasets, which is what pretty much every company needs to do.

Diagram titled 'Connecting many is hard.' The question 'Which region has the most leads?' points at a CRM leads table, which is linked to separate Finance, Marketing, Product and Support systems.

That’s because, for instance, in your CRM a customer might be referred to by account_id, and in your finance system that same customer might be called the sold_to_party.

Diagram titled 'Same customer. Two names.' A CRM accounts table keyed by account_id and a Finance billing table keyed by sold_to_party, with Acme Corp. highlighted in both.

It gets even messier when you realize that marketing and finance might have completely different definitions of something like revenue, or what counts as an active customer.

Diagram titled 'Same word. Two meanings.' Marketing revenue is $4.8M (closed-won bookings) while Finance revenue is $4.2M (recognized, net of credits), with a not-equal sign between them.

Why off-the-shelf tools can’t fix it

The reason a vendor or off-the-shelf tool can’t just fix this automatically is that your organization has spent years accumulating knowledge about how to interpret its own data. That’s implicit rather than explicit context, and no tool can understand it unless you teach it how to understand it.

Diagram titled 'The rules are unwritten.' Examples of implicit context: revenue is net of credits, fiscal year starts in February, partner deals count once, EMEA includes India, test accounts start with ZZ, churned means 90 days inactive. Label: implicit context, never written down. An off-the-shelf tool sits below, unable to see them.

The fix: a semantic layer

So we discovered that what we actually needed is something called a semantic layer. Basically, it’s a way of teaching the AI what all of our terms mean, how the different datasets relate to each other, and what rules our business uses to calculate things.

Diagram titled 'The semantic layer.' A semantic layer sits between AI above and the CRM, Finance and Marketing systems below. It holds terms (revenue, active customer, booking), relationships (account_id equals sold_to_party, lead to account) and rules (net of credits, partners count once, fiscal year starts in February).

More work than we expected, and worth it

That’s why building natural language analytics took a lot more effort than we first thought it would. We needed the people who keep all of this implicit context in their heads to sit down and define all of it for the machines. The good news is, now that we’ve done it, we have a composable knowledge layer that any AI tool can tap into.

Diagram titled 'Now any AI tool can use it.' Analytics chat, agents, dashboards and copilots all connect down to one shared semantic layer.