# Conversational analytics on a semantic layer

> Conversational analytics on DataNature lets business users ask questions in plain language and get governed SQL, tables and charts. Accuracy improves with metadata enrichment, vector ingestion, categorical value ingestion and careful table selection, and answers use certified KPIs from the semantic layer.

Source: https://datanature.ai/solutions/conversational-analytics-semantic-layer
Publisher: Dlytica Inc. (DataNature is a Dlytica company)
Updated: 2026-11-05

Plain-language questions, governed SQL, consistent numbers

## Components

- **Voir Chat**: Natural-language questions to SQL
- **Semantic Layer**: Certified views and KPIs
- **Atlas**: Row and column security on every answer
- **BI**: Save answers as dashboards

## Steps

1. **Enrich metadata**: Describe tables and columns in business language.
2. **Ingest vectors**: Embed documentation and examples so the agent finds the right context.
3. **Ingest categorical values**: Teach the agent the real values in key columns, such as product names and regions.
4. **Select tables**: Limit the agent to relevant, certified tables to improve SQL accuracy.
5. **Ship**: Users ask questions; answers respect their access rights.

## Documentation

- [Conversational analytics](https://docs.datanature.ai/docs/business/ai-and-analytics/conversational-analytics)
- [Business semantics](https://docs.datanature.ai/docs/business/ai-and-analytics/business-semantics)

## Why do text-to-SQL tools give wrong answers?

They guess at joins and meanings. Grounding the agent in enriched metadata, real column values and certified KPIs removes most of the guessing.

## Will users see data they should not?

No. Every generated query runs with the user's own row and column permissions.

## Can answers become dashboards?

Yes. Save any answer to DataNature BI.

## Common questions

### Can executives ask data questions in plain language?

Yes, through Voir on the semantic layer, so answers use certified KPIs.

### How do we stop wrong numbers from AI?

Answers come from certified semantic views with lineage, not free-form SQL over raw tables.

## Implementation details

1. **Write cubes** as YAML in `semantic-models/cubes/`: a Gold table, measures as full aggregates (`SUM(net_amount)`), dimensions as columns, joins and time grains.
2. **Avoid one-to-many joins** in cubes; pre-aggregate in a dbt Gold model so sums are not inflated.
3. **Materialize popular cubes** as warehouse views and add a Refresh cubes node after Gold in the job.
4. **Set Cube Security** predicates per role, such as `branch_code = 'KTM'`.
5. **Connect a Voir twin** to the semantic layer; answers come from cubes over MCP instead of model-written SQL.
6. **Expose cubes to apps** through the REST endpoint `/semantic/query` with an API key; queries return up to 1,000 rows.
