Skip to Content
Toucan AI Docs

The semantic layer in charts, dashboards and data apps

How charts, dashboards and data apps are computed from domains, what happens when a domain changes, and how to check a calculation with the data inspector.

Target audience: makers and admins who build charts, dashboards and data apps on domains.

TL;DR

  • A chart or data app built on a domain names metrics and dimensions; the semantic layer turns those names into a query, with the viewer's security applied.
  • One definition, everywhere: a change to a domain metric reaches every chart that references it.
  • A chart can declare its own local metric for a one-off need (code mode or MCP only). It does not follow later changes of the domain.
  • The data inspector shows, step by step, how a data app's numbers were computed: column types, data preparation, row- and column-level security, then the semantic layer.

How a chart uses a domain

A chart built on a domain stores three things:

  1. The domain it belongs to.
  2. The names of the metrics and dimensions in each slot, for example mrr on the value axis and start_month (by month) on the category axis.
  3. Display options: chart type, colors, labels.

It stores no joins and no table list, and no formula unless it declares a local metric: a metric of its own, for a need that makes no sense in the domain. For example, Toucan AI generates metrics with a date-range filter on the fly. Local metrics live in the chart's extra section, see Local metrics.

When the chart is displayed, each name is looked up in the chart first, then in the domain, and the semantic layer builds the query from the current definitions:

A chart can only use what its domain lists. It can't reach a table or a join the domain doesn't include, which keeps AI-generated charts inside what you curated.


When a domain changes

Domains have no draft: a change applies as soon as you save it.

You…Charts that reference it
Fix a metric's expression or filterShow the corrected values.
Change a label, unit or descriptionPick up the new text.
Add a metric or a fieldAre unchanged. New charts can use it.
Rename or delete a metric or a fieldShow an error naming what is missing, instead of wrong numbers, until you fix the chart or restore the name.

Before renaming or deleting a metric that is in use, check which dashboards and data apps rely on it. A chart that declares a local object with the same name keeps working.

Local metrics

A local metric is declared in the chart's extra section and is visible only to that chart. There is no button for it today: it is available in code mode, or through the Maker MCP when an agent builds a chart or a data app. When a local metric has the same name as a domain metric, the local one wins for that chart. That keeps the chart stable if someone later adds a domain metric with a name the chart already used.

A local metric is not updated when the domain changes: if its definition must change, fix it in every chart that declares it. When several charts use the same local metric, store it in the domain instead: create it there, then edit each chart to use the domain's metric. Nothing does this automatically yet.


Dashboards

Build a dashboard on one domain. A dashboard that covers several domains usually means the dashboard isn't focused enough, or the domains are too narrow. It isn't forbidden, and it can be justified.

Dashboard filters on charts built from a domain target a domain dimension, such as Region of the Sales domain, rather than a raw column. The values offered come from that dimension, through the semantic layer, so row- and column-level security apply to the filter's list too. For now, you link a filter to each chart it drives; applying it automatically to every chart that uses the dimension is not available. A filter on a dimension a chart's domain doesn't have leaves that chart unfiltered.


Data apps

A data app asks Toucan AI for data the same way a chart does: metrics and dimensions of a domain. The query runs as the person viewing the app, so their row- and column-level security apply. The app holds no key and never sees data the viewer isn't allowed to see.

When your agent builds a data app, it reads the domain with get_domain and uses its metric and dimension names. Building the app on domain metrics, rather than raw columns, is what keeps its numbers consistent with your dashboards. For what the domain doesn't hold, an app can also declare local metrics, which allows maximum customization.


Check a calculation with the data inspector

The data inspector shows how each number in a data app was computed, for the person viewing it. Use it when a value looks wrong, or to explain a figure to a stakeholder.

  1. Open the data app. Makers, admins and Pilots see a toolbar above it; explorers don't.
  2. Select Inspect. The panel lists the app's SDK calls: each request for data, with its time and status.
  3. Select a call. Point at it to highlight what it feeds in the app, or inspect an element of the app to find its call.
  4. Read its three tabs:
    • Query: the metrics, dimensions and filters the app asked for.
    • Pipeline: every step Toucan AI ran, grouped by stage, in execution order.
    • Response: the rows that came back.

The Pipeline tab is where the semantic calculation shows:

StageWhat it shows
Column typesConversions declared on the Data page, for example text to date.
Data preparationCleaning steps declared on the table.
Row-level securityThe filters applied for this viewer, and the user attribute values that decided them.
Column-level securityThe columns hidden from this viewer.
Semantic layerThe joins, filters, aggregations and calculations your metrics and dimensions became.

Each step is written in plain language, such as Filtered data to keep only rows where payment_status is paid. Steps decided by a user attribute show its value for the current viewer, and whether it was provided, a default value, or missing. Warnings, such as a date dimension whose column isn't a date, are listed with the pipeline.

The pipeline is computed fresh for each call, because access policies can change between two calls of the same query. When you raise a request on a data app, the inspected pipeline can be attached to it.


Next: The semantic layer for explorers

On this page