
You've probably had this experience: you ask an AI assistant a straightforward question about your business, and the answer sounds confident and polished, but it’s completely wrong. Maybe it told you your ROAS was 4.2x when it was actually 2.1x. Or it confused net revenue with gross revenue. Or it counted refunds twice.
The root cause is almost always a lack of real-time, detailed context, and it's the reason most AI tools fail when they try to work with real ecommerce data.
At Triple Whale, we've spent the last three years solving this exact challenge through what we call the Context Engine. The Context Engine is the trust layer behind Moby, our AI, with a collection of capabilities that work together so it can reason about your business the way an experienced operator would.
At the heart of the Context Engine is a semantic layer.
Semantic layers aren’t new. Data teams have been using them for years to create consistent metric definitions across an organization. What is new is how we’ve built ours: structured specifically for LLMs and natively injected into Moby’s architecture at multiple stages.
Let's break down what our semantic layer actually is, how ours works, and why it matters for your business.
A semantic layer is a translation system that sits between your raw data and the tools that need to understand it. Think of it like a business-fluent interpreter.
Your database stores information in tables, columns, and rows. When someone asks "What were my ad spend numbers last month?", the system needs to know which table to look at, which column represents "ad spend," whether that includes organic spend or just paid, and whether "last month" means calendar month or rolling 30 days.
Without a semantic layer, AI tools are essentially guessing. They see column names like total_spend or net_revenue and make assumptions about what those mean. Sometimes the assumptions are right. Often, they're not. And in ecommerce, where metric definitions vary across platforms, businesses, and even teams within the same company, wrong assumptions lead to wrong decisions.
A well-built semantic layer dramatically reduces that ambiguity. It defines metrics, calculations, and relationships between data points so that when AI queries your data, it has a much clearer picture of what to look for and how to calculate it. The better the coverage and the more precise the mappings, the higher the quality of queries—and consequently the generated outputs.
And implementation matters too. Traditional data systems often require teams to spend weeks or months manually mapping schemas and defining relationships before anything works. Triple Whale’s semantic layer comes pre-built with deep ecommerce domain knowledge baked in. It works out of the box, and it’s been continuously refined over three years across thousands of stores.
You’re not starting from scratch or hiring a data team to configure it.
Here's what makes this tricky: generic AI tools are excellent at sounding right. Large language models can generate SQL queries, pull numbers from databases, and present findings in clean, confident language. The issue is that "plausible" and "accurate" are not the same thing.
Consider a metric like POAS (Profit on Ad Spend). If you ask a generic AI tool about your POAS, it might not even know what the acronym stands for in an ecommerce context. We've literally seen AI tools interpret it as something entirely unrelated. Even common metrics like MER (Marketing Efficiency Ratio) or blended ROAS have definitions that vary from one platform to another, and from one business to another.
Then there's the calculation problem. "Net sales" at your company might include or exclude gift cards, discounts, shipping costs, or returns depending on how your finance team defines it. "Ad spend" might include influencer payments at one brand and exclude them at another. A refund might show up on the return date in one table and the original order date in another, leading to mismatches that would confuse any tool that doesn't understand the nuance.
And the ambiguity doesn’t just exist within your company. It exists in the market at large. If an AI tool goes searching the web for how to calculate “MER” or “net revenue,” it will find multiple competing definitions. All equally valid in their own context, but none of them specific to your business and your data. Without a canonical definition locked in, the AI is essentially picking one at random and hoping it matches what you mean.
At Triple Whale, the Data Dictionary defines the canonical logic for every metric, and that logic is applied consistently everywhere: in your dashboards, in custom reports, in the SQL editor, and in Moby.
This is why throwing raw data at AI and hoping for the best doesn't work. The AI needs something more: a structured, consistent understanding of what the data means.
Triple Whale's semantic layer is built on two interconnected components: the Data Dictionary and the Data Ontology.
The Data Dictionary is where we define every metric in the system. Think of it as a living reference that goes far deeper than a glossary. Each entry includes:
When Moby needs to calculate your MER, it looks up the exact Triple Whale definition, knows which tables to query, and applies the correct formula every time.
This matters more than it might sound. We built the Data Dictionary after discovering that Moby's accuracy directly correlated with how well-defined the underlying metrics were.
Ambiguous metrics produced unreliable answers. Precisely defined metrics produced trustworthy ones. So we went through and defined everything, from the obvious (revenue, orders, sessions) to the nuanced (contribution margin, new vs. returning customer revenue, blended attribution metrics).
The Data Ontology maps how everything in your ecommerce business connects to everything else. It's a conceptual model of the ecommerce universe: stores, orders, customers, products, campaigns, ad sets, ads, and all the relationships between them.
Why does this matter? Well, real business questions almost always involve relationships. "How did my Meta campaigns perform for new customers last quarter?" touches campaigns, attribution, customer segmentation, and time-based filtering all at once.
Without an ontology that understands these relationships, the AI has to figure out which tables to join, how they connect, and what filters to apply. With the ontology, Moby 2 already knows the map.
The ontology also solves a practical problem: table selection. When you have dozens of data tables (as most real ecommerce analytics platforms do), one of the hardest parts of answering a question is figuring out where to look. The ontology gives Moby a tagging system that narrows down the relevant tables quickly, making it more proactive in resolving ambiguities and less likely to pull the wrong data.
The semantic layer is the foundation, but Triple Whale's Context Engine builds additional layers of intelligence on top of it.
All of this engineering serves one goal: giving you answers you can actually trust.
When you ask Moby "Why did my CPA increase last week?", here's what happens behind the scenes. The semantic layer translates your question into precise data queries using the Data Dictionary's metric definitions. The Ontology identifies the relevant tables and relationships. The structured retrieval system executes the query against your live data. The action log checks for recent changes to your campaigns. The benchmark data provides context on whether the CPA increase is an outlier or an industry trend. And the expert playbooks frame the analysis in a way that's actually actionable.
That's a lot of moving parts working together, but none of it would be reliable without the semantic layer holding it all together.
Building a semantic layer for ecommerce AI isn't something you can bolt on after the fact. It requires deep domain expertise, years of iteration, and constant validation against real business data. Triple Whale's Data Dictionary and Ontology represent over three years of accumulated ecommerce knowledge, built in collaboration with thousands of brands and validated against millions of queries.
Other platforms that offer AI features typically connect a language model to a database and hope for the best. That approach produces impressive demos, but unreliable results.
By deeply embedding the semantic layer into Moby’s architecture and grounding every formula in canonical definitions, we make AI trustworthy—and trustworthy AI is the only kind worth building on.
Want to see the Context Engine in action? Book a demo to learn how Moby can give you reliable, accurate insights into your ecommerce business.

You've probably had this experience: you ask an AI assistant a straightforward question about your business, and the answer sounds confident and polished, but it’s completely wrong. Maybe it told you your ROAS was 4.2x when it was actually 2.1x. Or it confused net revenue with gross revenue. Or it counted refunds twice.
The root cause is almost always a lack of real-time, detailed context, and it's the reason most AI tools fail when they try to work with real ecommerce data.
At Triple Whale, we've spent the last three years solving this exact challenge through what we call the Context Engine. The Context Engine is the trust layer behind Moby, our AI, with a collection of capabilities that work together so it can reason about your business the way an experienced operator would.
At the heart of the Context Engine is a semantic layer.
Semantic layers aren’t new. Data teams have been using them for years to create consistent metric definitions across an organization. What is new is how we’ve built ours: structured specifically for LLMs and natively injected into Moby’s architecture at multiple stages.
Let's break down what our semantic layer actually is, how ours works, and why it matters for your business.
A semantic layer is a translation system that sits between your raw data and the tools that need to understand it. Think of it like a business-fluent interpreter.
Your database stores information in tables, columns, and rows. When someone asks "What were my ad spend numbers last month?", the system needs to know which table to look at, which column represents "ad spend," whether that includes organic spend or just paid, and whether "last month" means calendar month or rolling 30 days.
Without a semantic layer, AI tools are essentially guessing. They see column names like total_spend or net_revenue and make assumptions about what those mean. Sometimes the assumptions are right. Often, they're not. And in ecommerce, where metric definitions vary across platforms, businesses, and even teams within the same company, wrong assumptions lead to wrong decisions.
A well-built semantic layer dramatically reduces that ambiguity. It defines metrics, calculations, and relationships between data points so that when AI queries your data, it has a much clearer picture of what to look for and how to calculate it. The better the coverage and the more precise the mappings, the higher the quality of queries—and consequently the generated outputs.
And implementation matters too. Traditional data systems often require teams to spend weeks or months manually mapping schemas and defining relationships before anything works. Triple Whale’s semantic layer comes pre-built with deep ecommerce domain knowledge baked in. It works out of the box, and it’s been continuously refined over three years across thousands of stores.
You’re not starting from scratch or hiring a data team to configure it.
Here's what makes this tricky: generic AI tools are excellent at sounding right. Large language models can generate SQL queries, pull numbers from databases, and present findings in clean, confident language. The issue is that "plausible" and "accurate" are not the same thing.
Consider a metric like POAS (Profit on Ad Spend). If you ask a generic AI tool about your POAS, it might not even know what the acronym stands for in an ecommerce context. We've literally seen AI tools interpret it as something entirely unrelated. Even common metrics like MER (Marketing Efficiency Ratio) or blended ROAS have definitions that vary from one platform to another, and from one business to another.
Then there's the calculation problem. "Net sales" at your company might include or exclude gift cards, discounts, shipping costs, or returns depending on how your finance team defines it. "Ad spend" might include influencer payments at one brand and exclude them at another. A refund might show up on the return date in one table and the original order date in another, leading to mismatches that would confuse any tool that doesn't understand the nuance.
And the ambiguity doesn’t just exist within your company. It exists in the market at large. If an AI tool goes searching the web for how to calculate “MER” or “net revenue,” it will find multiple competing definitions. All equally valid in their own context, but none of them specific to your business and your data. Without a canonical definition locked in, the AI is essentially picking one at random and hoping it matches what you mean.
At Triple Whale, the Data Dictionary defines the canonical logic for every metric, and that logic is applied consistently everywhere: in your dashboards, in custom reports, in the SQL editor, and in Moby.
This is why throwing raw data at AI and hoping for the best doesn't work. The AI needs something more: a structured, consistent understanding of what the data means.
Triple Whale's semantic layer is built on two interconnected components: the Data Dictionary and the Data Ontology.
The Data Dictionary is where we define every metric in the system. Think of it as a living reference that goes far deeper than a glossary. Each entry includes:
When Moby needs to calculate your MER, it looks up the exact Triple Whale definition, knows which tables to query, and applies the correct formula every time.
This matters more than it might sound. We built the Data Dictionary after discovering that Moby's accuracy directly correlated with how well-defined the underlying metrics were.
Ambiguous metrics produced unreliable answers. Precisely defined metrics produced trustworthy ones. So we went through and defined everything, from the obvious (revenue, orders, sessions) to the nuanced (contribution margin, new vs. returning customer revenue, blended attribution metrics).
The Data Ontology maps how everything in your ecommerce business connects to everything else. It's a conceptual model of the ecommerce universe: stores, orders, customers, products, campaigns, ad sets, ads, and all the relationships between them.
Why does this matter? Well, real business questions almost always involve relationships. "How did my Meta campaigns perform for new customers last quarter?" touches campaigns, attribution, customer segmentation, and time-based filtering all at once.
Without an ontology that understands these relationships, the AI has to figure out which tables to join, how they connect, and what filters to apply. With the ontology, Moby 2 already knows the map.
The ontology also solves a practical problem: table selection. When you have dozens of data tables (as most real ecommerce analytics platforms do), one of the hardest parts of answering a question is figuring out where to look. The ontology gives Moby a tagging system that narrows down the relevant tables quickly, making it more proactive in resolving ambiguities and less likely to pull the wrong data.
The semantic layer is the foundation, but Triple Whale's Context Engine builds additional layers of intelligence on top of it.
All of this engineering serves one goal: giving you answers you can actually trust.
When you ask Moby "Why did my CPA increase last week?", here's what happens behind the scenes. The semantic layer translates your question into precise data queries using the Data Dictionary's metric definitions. The Ontology identifies the relevant tables and relationships. The structured retrieval system executes the query against your live data. The action log checks for recent changes to your campaigns. The benchmark data provides context on whether the CPA increase is an outlier or an industry trend. And the expert playbooks frame the analysis in a way that's actually actionable.
That's a lot of moving parts working together, but none of it would be reliable without the semantic layer holding it all together.
Building a semantic layer for ecommerce AI isn't something you can bolt on after the fact. It requires deep domain expertise, years of iteration, and constant validation against real business data. Triple Whale's Data Dictionary and Ontology represent over three years of accumulated ecommerce knowledge, built in collaboration with thousands of brands and validated against millions of queries.
Other platforms that offer AI features typically connect a language model to a database and hope for the best. That approach produces impressive demos, but unreliable results.
By deeply embedding the semantic layer into Moby’s architecture and grounding every formula in canonical definitions, we make AI trustworthy—and trustworthy AI is the only kind worth building on.
Want to see the Context Engine in action? Book a demo to learn how Moby can give you reliable, accurate insights into your ecommerce business.

Body Copy: The following benchmarks compare advertising metrics from April 1-17 to the previous period. Considering President Trump first unveiled his tariffs on April 2, the timing corresponds with potential changes in advertising behavior among ecommerce brands (though it isn’t necessarily correlated).
