# Semantic layer and ontology

> When an agent answers with figures, it needs to know what "revenue" or "active customer" means in your company. A semantic layer fixes those definitions once, for dashboards and agents alike. An ontology links business entities and their vocabulary, domain by domain.

Two teams, two definitions of the same metric: the problem predates agents. An agent that writes its own queries against tables makes it worse. It guesses joins and filters, and returns figures that shift with the wording of the question.

The semantic layer defines metrics, dimensions, relationships and permissions in one place, and versions them. The agent asks for the metric; the layer writes the query and applies the permissions. The agent’s figures then match the reference dashboard.

The business ontology describes entities (customer, contract, site, order), how they relate and each domain’s vocabulary. It is kept domain by domain: a single company-wide model goes stale fast. It uses the words teams already use, and the agent repeats them in its answers.

In 2025, data vendors launched the Open Semantic Interchange initiative to agree on a common format for exchanging these definitions between tools. Accepted into the Apache Incubator in 2026, it is now called Apache Ossie.

**When**: Worth it when agents answer with figures or connect several systems. Not needed for a drafting or document search assistant. A complete company ontology written before any use case is costly and ages quickly; start from the metrics and entities a first use case needs.

**Trade-offs**: Fixing a definition forces teams to agree, which takes time. Without it, the agent gives different figures depending on how the question is asked.

## Where to start

- List the metrics the first use case needs
- Write their definitions with their owners
- Connect the agent to the semantic layer rather than to tables
- Add the business synonyms

## Common mistakes

- Letting the agent query raw tables
- Looking for a universal company model
- Forgetting to apply permissions at the metric level

## Metrics

- Gap between the agent’s figure and the reference dashboard
- Share of numeric questions served through the semantic layer
- Metrics defined with an owner

## Sources

- [Salesforce and Tableau, Ending semantic drift](https://www.tableau.com/blog/ending-semantic-drift-unified-business-logic-foundation)
- [Apache Ossie (incubating)](https://ossie.apache.org/)
- [DORA, AI-accessible internal data](https://dora.dev/capabilities/ai-accessible-internal-data/)
