AI Context Layer

The AI context layer that makes agents trustworthy

Cube gives your AI agents a governed context layer — the context they need to answer correctly. Point an LLM at raw tables and it re-derives joins and metric logic on every prompt, so the same question returns different numbers. The context layer gives the agent certified metrics, dimensions, joins, and access rules to select from, so answers are consistent, governed, and explainable.

Just like these companies:

Logo of Brex companyLogo of Wix companyLogo of Webflow companyLogo of Intuit companyLogo of Alcon companyLogo of Tubi companyLogo of Drata companyLogo of Freshworks company

Components

What's in an AI context layer

The semantic layer at the core

Metrics, dimensions, joins, and access rules defined once and enforced — the governed shape and math the agent selects from instead of re-deriving it from raw tables.

Business concepts, rules, and modeling guidance

The glossary, business logic, and conventions the model alone doesn't capture — what a term means, the edge cases and exclusions that decide a correct answer, and how the data should be modeled and extended.

Lineage and external context

Every answer traces back to named definitions and their sources, and the agent can pull context from the tools around the warehouse — docs, tickets, incidents — over MCP Connectors.

Cube Evals

Test your agent like a production system

An agent answering business questions in production is a production system — and production systems have tests. Write eval cases (a question and its known-correct answer), run your agent against them on any branch, and get an objective accuracy score with a per-case breakdown of what failed and why. Change a model or an agent config, re-run, and catch the regression before it ships.

Read about Cube Evals

Model Context Protocol

Reach any agent over MCP

One governed model, every agent

Claude, ChatGPT, Cursor, or one you build — each queries the same governed model as a tool over MCP.

No per-agent rework

Define metrics and joins once; every connected agent inherits the same context without a separate integration.

Bring your own agent

If it speaks MCP, it can query Cube — your custom agents get the governed model for free.

MCP Connectors

Pull context from the tools your team already uses

Governed metrics answer what the numbers are; the why usually lives in a doc, a ticket, or an error tracker. MCP Connectors let the Cube agent pull that external context and use it in the same turn as a semantic-layer query — so answers stay grounded even when the context comes from outside the warehouse.

Read about MCP Connectors
MCP Connectors — the Cube agent pulling context from external tools like Notion, Linear, and Sentry

Why it works

The semantic layer is what makes the AI useful

Brex grounds its embedded agentic analytics on Cube's governed model, so answers stay consistent and scoped to each customer. Brex chose Cube over the dbt Semantic Layer and LookML.

The semantic layer is what makes the AI useful.
Dan MeshkovStaff Software Engineer, Brex

Frequently Asked Questions

A context layer is the governed layer between your data and AI agents. It gives an agent the business meaning it can't infer from raw tables — certified metric definitions, relationships, permissions, and lineage — and delivers that context at query time, usually over MCP. It's the semantic layer doing its job for agents: what makes their answers trustworthy enough to act on.
They're not alternatives — the context layer is the superset and the semantic layer is its governed core. A semantic layer defines your metrics, dimensions, joins, and access rules once (the shape and math an agent needs); a context layer wraps that core with business concepts and rules, guidance on how to model the data, lineage, and context from surrounding tools. Cube is both: the semantic layer is the foundation, and the context layer is everything an agent needs built around it.
Pointed at raw tables, an LLM re-derives joins, metric logic, and access rules on every prompt, so the same question returns different numbers and can surface data a user shouldn't see. A context layer lets the agent select from certified definitions and enforced permissions instead, which is what makes its answers consistent, governed, and safe to act on.
The semantic layer at its core (metrics, dimensions, joins, and access rules defined once and enforced), business concepts and rules (the glossary and business logic the model alone doesn't capture — definitions, edge cases, exclusions), modeling guidance (conventions for how the data is modeled and extended), lineage (every answer traced back to its sources), and external context from surrounding tools (docs, tickets, incidents over MCP Connectors).
It grounds the agent instead of letting it guess. Because the agent selects from governed definitions rather than re-deriving logic from raw tables, revenue means revenue every time — no drift between two phrasings of the same question — and every answer traces back to a named definition you can verify.

Teams grounding their agents on Cube

Brex
The future of reporting isn't a chart, it's an insight. Large language models are becoming a commodity — the LLM is the engine, but the semantic layer is the map. A well-modeled ontology is the difference between 'I don't understand that question' and a correct, contextualized answer with a chart and a clear explanation. Cube gives us the foundation to make that real for every customer.
Dan MeshkovStaff Software Engineer, BrexRead the Story
DrataDrata

Cube becomes our single source of truth for metric definitions and powers everything from customer-facing dashboards to AI-driven quarterly business reviews. CSMs gain back dozens of hours each quarter, enabled by Cube’s semantic layer and agentic analytics.

WebflowWebflow

We integrated Cube Cloud smoothly with ClickHouse, leveraging both for fast query‬ execution while maintaining the abstraction needed for different teams to access data‬ without diving into database-specific complexities.‬

AlconAlcon

Without Cube, our data analysts might have to write 20 different queries for a single core business metric. With Cube, that metric is defined once in the data model, and every downstream tool uses that definition along with the associated calculation logic.

Start building with Cube