> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exmergo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use a semantic layer

> Find the metrics your project defines, choose the right semantic backend, and author changes through reviewable plans. Check query support before running them.

**Outcome:** find the definitions your project already owns, then choose whether
to query them or change them. A catalog that can be read is not necessarily a
backend that can execute queries.

## 1. Identify the layer

| Your project uses | Where definitions live | Read next |
| - | - | - |
| dbt semantic models | MetricFlow YAML in the dbt project | [Semantic layer reference](https://docs.exmergo.com/dex/semantic-layers/overview.md) |
| dbt Cloud Semantic Layer | Hosted catalog and query API | [Hosted backend](https://docs.exmergo.com/dex/semantic-layers/overview.md#hosted-backend-api-dbt-cloud-semantic-layer) |
| Apache Ossie | Native YAML documents in the repository | [Ossie walkthrough](https://docs.exmergo.com/dex/guides/ossie-semantic-layer.md) |
| SLayer | Native model files in the repository | [SLayer support](https://docs.exmergo.com/dex/semantic-layers/overview.md#slayer-models-vendor-slayer) |
| Cube | Cube YAML model files in the repository | [Cube compatibility](https://docs.exmergo.com/dex/semantic-layers/cube.md) |

Use the configuration and extras for that backend. Keep the existing format as
the source of truth; choosing Dex does not require converting it to another one.

## 2. Inspect the catalog first

```bash theme={null}
dex explore semantic list
```

Read the available metrics, dimensions, entities, and physical mappings. The
mapping to warehouse columns matters: it connects semantic queries to profiling
and PII checks.

Ask your agent:

```text theme={null}
Use Dex to list the revenue metrics in this project's semantic layer.
Explain their dimensions and physical sources before running a query.
```

## 3. Query or author

**To answer a metric question**, use `explore semantic query` or
`explore semantic values` on a backend that supports it. Start with the names
returned by the catalog and the [semantic query reference](https://docs.exmergo.com/dex/semantic-layers/overview.md).

**To change definitions**, ask the agent to prepare a plan using `semantic
define|update|plan` for dbt semantic models, or the matching `semantic ossie`,
`semantic slayer`, or `semantic cube` command for native documents. Review the
plan and apply it through `transform apply`.

> [!WARNING]
>
> Hosted dbt Cloud semantic queries are outside Dex's cost guard. Understand that
> boundary before running them. Other backends have different query capabilities;
> reading a native document does not authorize a hosted catalog or query request.

## A complete local example

The [Apache Ossie walkthrough](https://docs.exmergo.com/dex/guides/ossie-semantic-layer.md) takes a native
layer from local files through catalog inspection, exploration, a drift baseline,
and authoring. It also explains the cases where metric queries are refused and
how to ask a governed warehouse question instead.

For exact schemas and validation limits, use the
[semantic layer reference](https://docs.exmergo.com/dex/semantic-layers/overview.md),
[Ossie compatibility](https://docs.exmergo.com/dex/semantic-layers/ossie.md), or
[Cube compatibility](https://docs.exmergo.com/dex/semantic-layers/cube.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.