CxDM
Governed Text-to-SQL • Format-Agnostic (OKF Native) • CxNF & CxDM Guardrails

Stop Guessing. Start Attesting.

Never trust critical enterprise analytics to probabilistic guesses. CxDM governs enterprise Text-to-SQL through format-agnostic contextual models (OKF-native), Contextual Normal Forms (CxNF), and deterministic CxDM Guardrails before a single query executes.

cxdm-engine — bundle:finance@sha:9f2c41
Trust: Human-reviewed
// Natural language inquiry:
"What is the net revenue by country for fiscal year 2025?"
Attested Computation & Guardrails Applied id: computation.net_revenue
SELECT nation, SUM(gross_amount - returns - discounts) AS total_revenue 
FROM analytics.fct_sales 
WHERE fiscal_year = 2025 AND is_deleted = FALSE AND tenant_id = :current_tenant
GROUP BY nation;
Injected: is_deleted = FALSE • Fan-out: Passed
Context read: 5 concepts • 0 row data to LLM
Run: End-User DB Credentials
Evolution of Data Architecture

The Paradigm Shift: From Storage to AI-Ready Context

Classical data modeling was invented decades ago with a single primary mission: to store and organize data efficiently. Contextual Data Modeling (CxDM) builds directly on top of physical databases to model data specifically for governed AI querying with deterministic guardrails.

STAGE 01

Conceptual Model

Defines high-level business entities and their relationships (Customer, Order, Account). Focuses on business domain boundaries.

Target: Business Domain
STAGE 02

Logical Model

Details entity attributes, normalization (3NF/Star Schema), relationships, and primary/foreign key structures without engine specifics.

Target: Schema Architecture
STAGE 03

Physical Model

Optimized for disk & memory storage: data types, partitions, B-Tree indices, tablespaces, and engine dialect constraints.

Target: Storage & Execution
STAGE 04 Enforceable

Contextual Model

Built atop physical schemas. Declares domain semantics, Contextual Normal Forms (CxNF0–CxNF5), attested metrics, and CxDM Guardrails (G01–G31).

Target: Governed AI Querying

Why Classical Modeling is Not Enough for LLMs

Databases store tables, foreign keys, and indexes, but they do not store business intent. A column named net_amt does not declare how discounts are calculated, which tenant filter is mandatory, or which join causes a 1:N fan-out trap.

CxDM bridges this semantic gap. While LLM generation is inherently probabilistic, CxDM's enforcement engine is strictly deterministic — every generated query is verified and rewritten against versioned Git bundles (OKF v0.3) before touching your database.

Traditional Text-to-SQL

Physical Schema + Prompt → LLM Guesses Query → Unchecked Execution (Silent Wrong Numbers)

Contextual Data Modeling (CxDM)

Physical Model + Meaning + Rules + CxDM Guardrails + Proof → Every Executed Query Verified Against the Bundle

Methodology Breakdown

The 4 Pillars of Contextual Data Modeling

Every CxDM knowledge bundle is structured around four enforceable facets.

1

Meaning — What is it?

Maintained under open Open Knowledge Format (OKF v0.3) specification as Git-native concept files, glossaries, schemas, and navigation descriptors. Zero vendor lock-in.

OKF bundles • Git-backed truth • navigation retrieval
2

Rules — How is it computed?

Attested Computation architecture. Verified financial calculations are never invented from scratch by AI; the model discovers attested formulas and binds typed parameters.

Attested Computations • Sandboxed Attesters • Zero guess
3

Constraints — What is permitted?

CxDM Guardrails by Design. Generated SQL is syntactically parsed at the AST level via sqlglot prior to execution: blocking join fan-out traps, enforcing table allowlists, and injecting mandatory governance predicates.

CxDM Guardrails • AST-level checks • mandatory predicates
4

Proof — How accurate is it?

Continuous Evaluation Quality Gates. Golden question test suites run against every changeset and candidate release; unverified models or regressing accuracy are automatically blocked from publication.

Golden evaluations • result-match checks • tamper-evident audit
Automated Bootstrap • CxDM Studio

"Who writes 200 tables?" — Bootstrap, Don't Type

Nobody writes 200 table contracts by hand. CxDM Studio automatically bootstraps draft bundles from database catalogs, SQL query logs, and dbt artifacts — domain experts only review and attest.

Bounded Context Architecture

One Bundle Per Business Domain

Finance and Sales can define "Revenue" differently without collision. Each business unit governs its own isolated OKF bundle with domain-specific metrics, join paths, and access policies.

Format-Agnostic Standard • Interoperable by Design

Works With Any Metadata Format — OKF-Native Reference

The MPG Catalog (M00–M49 → P01–P75 → G01–G31) and Contextual Normal Forms (CxNF0–CxNF5) form an abstract semantic contract. While Open Knowledge Format (OKF v0.3) is the canonical Git-native implementation, CxDM maps seamlessly onto Apache OSSIE, dbt YAML, OpenMetadata, DataHub, or relational catalogs.

OKF v0.3 (Native) Apache OSSIE dbt YAML OpenMetadata / JSON
Native Connectivity & Dialect Mastery

30+ Enterprise Databases. Exact Native Dialects.

Powered by Apache Arrow ADBC and native high-performance adapters, CxDM eliminates dialect mismatch by generating, optimizing, and validating SQL specifically for your target database engine.

Apache Arrow ADBC Architecture

Zero-copy columnar metadata ingestion and secure execution using modern Arrow Database Connectivity (ADBC) alongside enterprise-grade drivers like python-oracledb.

Dialect-Specific Generation

No generic or broken SQL. CxDM targets each database's native grammar, window functions, date math, and optimizer hints directly during synthesis.

AST Parsing & Normalization

Powered by deep AST transpilation (sqlglot), queries are strictly validated against engine syntax rules before touching database execution planes.

Seamlessly Connected Across Relational Databases, Lakehouses & Analytical Engines
PostgreSQL Oracle Database Snowflake ClickHouse DuckDB Trino / Presto Microsoft SQL Server Google BigQuery Databricks MySQL Apache Iceberg (via Trino / Spark) + 20 More Engines
AI-Ready Data Modeling Book Cover by Mahir M. Guluzade
Forthcoming
Foundational Technical Book

AI-READY DATA MODELING

Solving Enterprise Text-to-SQL Challenges with Contextual Data Modeling (CxDM) and Deterministic Guardrails

Author: Mahir M. Guluzade • Creator of CxDM

Drawing from over 23+ years of hands-on database administration, enterprise Data Lakehouse architectures, and critical financial data systems, this technical book establishes the definitive engineering framework for eliminating Text-to-SQL failure modes through contextual data modeling and deterministic guardrails.

Part I · The Problem
Why Enterprise Text-to-SQL Fails
Part II · Foundations
From Codd to Kimball & CxDM
Part III · MPG Catalog
50 M → 75 P → 31 CxDM Guardrails
Part IV · CxAL
CxDM Assurance Levels (CxAL0–CxAL5)
Part V · The Bundle
OKF v0.3, Evidence Import & Formats
Part VI · The Platform
Query Flow, Studio Governance & Evals
Part VII · Practice
End-to-End Lakehouse Worked Example
Appendices A–F
Auto-Generated MPG & Field Reference
MPG: M00–M49 • P01–P75 • G01–G31

Inside the Book: The Complete MPG Catalog (50 M → 75 P → 31 CxDM Guardrails)

7 Root-Cause Categories (A–G) • 8 Failure Groups (I–VIII)

Model problems (M01–M49, plus reserved M00 for query-only issues) are root causes; SQL generation problems (P01–P75) are query-time symptoms; and CxDM Guardrails (G01–G31) are the deterministic rules that intercept them.

M03 Homonyms Across Domains
→ P19, P32 • G06, G16, G23
M07 Missing Foreign Keys & Cardinality
→ P01, P02 • G13, G14
M09 Undocumented Composite Keys
→ P04, P13 • G14
M20 Implicit Currency or Minor Units
→ P66, P75 • G24
M22 Undeclared Non-Additive Measures
→ P25–P27 • G07, G20
M25 Mixed Grain in One Table
→ P01, P24 • G13, G20
M33 Undocumented History Tables (SCD2)
→ P05, P17, P18 • G17
M46 Unmarked Tenant & Jurisdiction Columns
→ P20, P21 • G16
+ 42 more root causes (M00–M49) deterministically enforced by 31 CxDM Guardrails (G01–G31) M00–M49
CxAL0 – CxAL5

CxDM Assurance Levels (CxAL): Measuring & Governing AI Autonomy

Defines 6 verifiable assurance levels (CxAL0 Baseline to CxAL5 Audit-ready) combining declared model contracts and golden eval proofs to govern how many P01–P75 failure modes are blocked and what SQL autonomy the AI is granted.

CxAL0 · Baseline
SQL Safety (21/75 P)
CxAL1 · Structural
Joins & Keys (36/75 P)
CxAL2 · Governed
Tenant & PII (47/75 P)
CxAL3 · Semantic
Codes & Time (63/75 P)
CxAL4 · Metric-safe
Math & Grain (73/75 P)
CxAL5 · Audit-ready
Signed & Verified (75/75 P)
Colophon Panthera pardus tulliana

The animal on the cover of AI-Ready Data Modeling is a Caucasian leopard (Panthera pardus tulliana). This majestic apex predator is native to the Caucasus region, including the rugged mountains of Ordubad in the Republic of Azerbaijan. Characterized by its striking pale yellow to deep golden coat adorned with distinct black rosettes, the Caucasian leopard is perfectly adapted to camouflage within rocky terrains and subalpine meadows.

As solitary and nocturnal creatures, these leopards are exceptionally elusive, relying on their acute senses to hunt prey such as wild bezoar goats and Asiatic mouflons. Tragically, due to habitat fragmentation, poaching, and prey depletion during the 20th century, their population severely declined. Today, the Caucasian leopard is critically endangered and strictly protected under regional and international Red Lists. Intensive conservation efforts and camera-trap monitoring in Azerbaijan's Zangezur National Park have fortunately recorded a gradual return of these magnificent big cats to their ancestral territories.

Get notified on release & request the MPG Catalog & CxAL Spec Receive early chapters, the MPG problem catalog, and CxAL architectural pre-prints.
Notify Me

Why does traditional Text-to-SQL fail in enterprise?

Standalone LLM SQL generation is inherently insufficient for trustworthy enterprise analytics.

Silent Wrong Numbers

The query executes without syntax errors, but a 1:N join fan-out or omitted soft-delete filter silently doubles SUM() totals—the failure mode data leaders fear most.

Probabilistic Hallucinations

In complex business domains and multi-table schemas, LLMs generate what looks plausible, not what is contractually attested. Ask twice, get two different numbers.

Ungoverned Exposure

Traditional tools send raw table rows or sensitive metadata to external LLMs and execute unvetted, arbitrary SQL queries directly against internal databases.

Zero Audit & Lineage

No deterministic proof behind AI outputs. Enterprises cannot verify which concepts were read, which business rule ran, or prove compliance to auditors.

Enterprise-Grade Security Architecture

Built from the ground up to comply with strict central bank, fintech, and enterprise audit standards.

No Row Data to LLM

No table rows or query results ever reach the LLM. Metadata and value-list exposure are strictly governed per bundle and per AI provider.

User-Scoped Execution

Queries execute strictly using the end-user's DB credentials. The AI cannot access what the user lacks permissions for.

Git-backed Audit Lineage

Changes governed via Git branches and MR approvals. Every answer is deterministically tied to a specific bundle@sha.

Deployable 100% On-Premise

Deployable 100% air-gapped on-premise via Docker/Kubernetes with local LLM runners (vLLM/Ollama) or governed enterprise AI gateways.

Bring Governed AI to Your Enterprise Data

Schedule a technical deep dive and discover how CxDM makes enterprise Text-to-SQL auditable, safe, and reliable.

Direct inquiries: [email protected]
domain: cxdm.dev • status: ready for enterprise pilot