Semantic layers for AI database agents: stop making the model infer business meaning from table names
Table names are not business context.
An AI database agent can see orders, subscriptions, events, and users. That does not mean it knows what revenue means, which timestamp counts, or which joins are approved.
Production natural-language SQL needs a semantic layer, not just schema introspection.
The schema is only the map of storage
Database schemas describe how data is stored. Business questions ask what data means.
Those are different layers.
For example, “active customer” might exclude trials, internal accounts, refunded subscriptions, test tenants, or suspended workspaces. A model cannot reliably infer that from table names.
Related: Metric definitions for AI database agents.
What the semantic layer should provide
A useful AI database semantic layer gives the agent approved definitions before it generates or executes SQL.
It should include:
- business metrics and formulas,
- approved entities and relationships,
- safe joins and join grain,
- default filters and exclusions,
- freshness expectations,
- owner and review metadata,
- examples of valid questions and result shapes.
Related: Schema context for AI database agents.
Definitions should be enforceable
A semantic layer should not be a paragraph of advice the model may or may not follow.
Where possible, encode definitions in approved views, governed metrics, scoped tools, and result contracts. The model can choose the question path, but the infrastructure should keep it inside reviewed definitions.
Related: Query routing for AI database agents.
Show the definition behind the answer
When an agent answers a business question, the result should reveal which definition it used.
For example:
MRR was calculated from active paid subscriptions, excluding trials, internal accounts, and canceled subscriptions, using approved metric definition
mrr_v4.
That turns the answer from a confident guess into something a team can review.
Related: Tool result contracts for AI database agents.
Where Conexor fits
Conexor connects databases and APIs to MCP-compatible AI clients like Claude, ChatGPT, Cursor, n8n, and Continue.
The useful version is not “let the model inspect tables and hope.” It is AI-native database access with approved context, controlled scope, and evidence attached to every answer.