<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ArisynData</title>
    <description>The latest articles on DEV Community by ArisynData (@arisyndata).</description>
    <link>https://dev.to/arisyndata</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3640833%2F877a0e7c-a59f-4ed3-baac-6bf99ad9c964.jpg</url>
      <title>DEV Community: ArisynData</title>
      <link>https://dev.to/arisyndata</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arisyndata"/>
    <language>en</language>
    <item>
      <title>Beyond SQL Accuracy: Building Evidence Chains for AI Data Agents</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Thu, 20 Aug 2026 03:10:07 +0000</pubDate>
      <link>https://dev.to/arisyndata/beyond-sql-accuracy-building-evidence-chains-for-ai-data-agents-3mfp</link>
      <guid>https://dev.to/arisyndata/beyond-sql-accuracy-building-evidence-chains-for-ai-data-agents-3mfp</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl7z7tf8fqncl2vbilef2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl7z7tf8fqncl2vbilef2.jpg" alt=" " width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AI data agents are getting good at producing executable SQL.&lt;/p&gt;

&lt;p&gt;That is useful, but executable SQL is not the same thing as a correct business answer.&lt;/p&gt;

&lt;p&gt;A query can compile, run successfully, return real rows, and still answer the wrong question because the agent selected the wrong metric definition, source table, relationship, grain, time field, or filter.&lt;/p&gt;

&lt;p&gt;For production systems, this creates a different engineering requirement:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;An AI data agent should not only generate an answer. It should preserve the evidence that produced it.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article explores how to treat that evidence as a first-class artifact rather than an explanation generated after the fact.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 1. Why SQL Accuracy Is an Incomplete Target&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Consider this question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What was net revenue by region last quarter?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The agent generates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;region&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;invoice_amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;net_revenue&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;invoices&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;
    &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;invoice_date&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="s1"&gt;'2026-04-01'&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;invoice_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="s1"&gt;'2026-07-01'&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;region&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The query is valid.&lt;/p&gt;

&lt;p&gt;But suppose the enterprise definition is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Net Revenue
=
Recognized Revenue
-
Refunds
-
Credits
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and regional attribution is based on the billing account rather than the customer master.&lt;/p&gt;

&lt;p&gt;The SQL engine cannot detect this error.&lt;/p&gt;

&lt;p&gt;From the database's perspective, the query is correct.&lt;/p&gt;

&lt;p&gt;From the business's perspective, it is wrong.&lt;/p&gt;

&lt;p&gt;That gives us two different validation layers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SQL Validity
=
Can this query execute?

Business Validity
=
Does this query represent the intended business question?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Production AI analytics needs both.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 2. The Failure Surface Is Larger Than SQL Generation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A useful way to model an AI data query is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question
   ↓
Semantic Resolution
   ↓
Source Selection
   ↓
Relationship Selection
   ↓
Filter / Time Resolution
   ↓
SQL Generation
   ↓
Execution
   ↓
Answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An error can occur at any stage.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Semantic Resolution
Revenue → Invoice Amount       ❌

Source Selection
invoices                       ✓

Relationship Selection
invoice.customer_id → customer ✓

Time Resolution
invoice_date                   ❌

SQL Generation
Valid SQL                      ✓

Execution
Success                        ✓
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we evaluate only the final SQL syntax or execution status, the system appears healthy.&lt;/p&gt;

&lt;p&gt;The real failure happened much earlier.&lt;/p&gt;

&lt;p&gt;This is why AI data agents need &lt;strong&gt;evidence chains&lt;/strong&gt;, not just query logs.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 3. What Is an Evidence Chain?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An evidence chain records the artifacts and decisions that connect a user question to the final answer.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Question
      │
      ▼
Business Definition
      │
      ▼
Source Data
      │
      ▼
Relationships
      │
      ▼
Filters / Time Rules
      │
      ▼
Generated SQL
      │
      ▼
Execution Result
      │
      ▼
Final Answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal is not to create another verbose chain-of-thought log.&lt;/p&gt;

&lt;p&gt;The goal is to preserve &lt;strong&gt;verifiable system artifacts&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That distinction matters.&lt;/p&gt;

&lt;p&gt;Internal model reasoning is probabilistic and may not be suitable as an audit artifact.&lt;/p&gt;

&lt;p&gt;A metric identifier, relationship identifier, SQL query, data-source identifier, and execution result are inspectable.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 4. Evidence Should Be Structured&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of storing only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;question
sql
answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;store a structured evidence object.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"question"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"What was net revenue by region last quarter?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"semantic_resolution"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"metric_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"net_revenue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"metric_version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dimensions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"billing_region"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"sources"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"orders"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"refunds"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"billing_accounts"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"relationships"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"relationship_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rel_orders_billing_account"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"from"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"orders.billing_account_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"to"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"billing_accounts.account_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"trusted"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"field"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settlement_date"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"period"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"last_quarter"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"sql"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"query_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"q_8271"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"execution"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"result_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"r_4412"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"success"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"validation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"passed"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the answer has provenance.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 5. Capture Evidence During Execution, Not Afterward&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common anti-pattern is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Agent generates answer
2. User asks "Why?"
3. LLM generates an explanation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That produces a narrative, not necessarily provenance.&lt;/p&gt;

&lt;p&gt;The model may describe what it believes happened.&lt;/p&gt;

&lt;p&gt;A stronger implementation captures evidence as each stage executes.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;evidence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Evidence&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;metric&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;resolve_metric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;evidence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;metric_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;metric&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;
&lt;span class="n"&gt;evidence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;metric_version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;metric&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;

&lt;span class="n"&gt;dimension&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;resolve_dimension&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;evidence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dimensions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dimension&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;relationship_service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_trusted_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;metric&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;metric&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;dimensions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dimension&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;evidence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;relationship_ids&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;relationship_ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;sql&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;generate_sql&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;metric&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;metric&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;dimensions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dimension&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;relationship_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;evidence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sql&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sql&lt;/span&gt;

&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sql&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;evidence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execution_status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;
&lt;span class="n"&gt;evidence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The evidence object is built from actual system events.&lt;/p&gt;

&lt;p&gt;That makes it much more useful for debugging and audit.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Semantic Evidence
&lt;/h2&gt;

&lt;p&gt;The first layer is semantic resolution.&lt;/p&gt;

&lt;p&gt;If the user asks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What was revenue last quarter?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the system should be able to show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Term:
Revenue

Resolved Metric:
Net Revenue

Version:
3.2

Definition:
Recognized Revenue - Refunds - Credits
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This matters because business terms are often ambiguous.&lt;/p&gt;

&lt;p&gt;The SQL may be technically perfect while using the wrong definition.&lt;/p&gt;

&lt;p&gt;A metric version is particularly important.&lt;/p&gt;

&lt;p&gt;If Revenue v3.1 and v3.2 differ, the evidence chain should preserve which version generated the answer.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 7. Source Evidence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next question is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Which data actually contributed to the answer?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;orders
refunds
billing_accounts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A production evidence record may also include fields:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"source"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"orders"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fields"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"billing_account_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"recognized_amount"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"settlement_date"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes it possible to inspect whether the agent used an authoritative source rather than merely a semantically similar table.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 8. Relationship Evidence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Multi-table queries require another layer of provenance.&lt;/p&gt;

&lt;p&gt;Suppose the query joins:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;orders
   ↓
billing_accounts
   ↓
region
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The evidence should preserve why that path was selected.&lt;/p&gt;

&lt;p&gt;At minimum:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"relationship_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rel_orders_billing_account"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"from"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"orders.billing_account_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"to"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"billing_accounts.account_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"trusted"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More advanced systems could include relationship evidence such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Database Constraint
Naming Similarity
Value Inclusion
Uniqueness
Business Validation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important point is that the agent is not silently inventing a join.&lt;/p&gt;

&lt;p&gt;The relationship is inspectable.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 9. Filter and Time Evidence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Filters are easy to overlook because they often appear as simple SQL predicates.&lt;/p&gt;

&lt;p&gt;But they can completely change the business answer.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"last quarter"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;might resolve to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026-04-01 → 2026-06-30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;settlement_date
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;rather than:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;invoice_date
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The evidence record should preserve both.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"time_resolution"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"business_period"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"last_quarter"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-04-01"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"end"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-06-30"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"field"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settlement_date"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes temporal interpretation auditable.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 10. Query Evidence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The SQL itself remains critical evidence.&lt;/p&gt;

&lt;p&gt;But do not treat SQL as the entire explanation.&lt;/p&gt;

&lt;p&gt;SQL is the executable consequence of upstream decisions.&lt;/p&gt;

&lt;p&gt;A useful query record might include:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"query_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"q_8271"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sql_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sha256:..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"generated_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-08-20T09:15:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"metric_version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"relationship_ids"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"rel_orders_billing_account"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes the query reproducible and connects it to the semantic and relationship state used during generation.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 11. Execution Evidence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Execution success is useful evidence, just not sufficient evidence.&lt;/p&gt;

&lt;p&gt;Capture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Execution Status
Duration
Rows Returned
Data Source
Query Timestamp
Result Identifier
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Potentially:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"duration_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;842&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"rows_returned"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"result_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"r_4412"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This lets the system distinguish:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bad SQL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Valid SQL + Wrong Business Interpretation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;## 12. Validation Should Check the Chain&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of asking only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Did the SQL execute?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;validation can inspect several layers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;### Semantic Validation&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Was an approved metric definition used?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;### Source Validation&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Were authorized and current data sources used?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;### Relationship Validation&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Were joins based on trusted relationships?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;### Filter Validation&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Were required business filters applied?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;### Query Validation&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Did the SQL pass syntax and safety checks?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This produces a richer validation object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"semantic"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"passed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sources"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"passed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"relationships"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"passed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"filters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"passed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sql"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"passed"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;## 13. Why LLM-as-a-Judge Cannot Be the Only Validator&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A second model can review generated SQL.&lt;/p&gt;

&lt;p&gt;That is useful.&lt;/p&gt;

&lt;p&gt;But consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent:
Revenue = invoice_amount

Judge:
The SQL correctly sums invoice_amount.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both models agree.&lt;/p&gt;

&lt;p&gt;Both can still be wrong relative to the enterprise definition.&lt;/p&gt;

&lt;p&gt;Language models are good at evaluating logical consistency inside the context they receive.&lt;/p&gt;

&lt;p&gt;They cannot recover enterprise truth that is missing from that context.&lt;/p&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;You cannot verify a data answer with language alone.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Verification needs grounded evidence from semantic definitions, metadata, relationships, executed SQL, and query results.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 14. Evidence Chains Improve Debugging&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose an answer is reported as incorrect.&lt;/p&gt;

&lt;p&gt;Without structured evidence, the debugging workflow may be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Reproduce Prompt
↓
Inspect Agent Logs
↓
Inspect SQL
↓
Guess What Went Wrong
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With evidence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Semantic Resolution      PASS
Source Selection         PASS
Relationship Selection   FAIL
Filter Resolution        PASS
SQL Validation           PASS
Execution                PASS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The engineering team immediately knows where to investigate.&lt;/p&gt;

&lt;p&gt;This is especially valuable because many production NL2SQL failures happen before SQL generation.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 15. Evidence Chains Improve Evaluation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Evidence also makes offline and online evaluation more granular.&lt;/p&gt;

&lt;p&gt;Instead of only measuring:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Exact SQL Match
Execution Accuracy
Final Answer Accuracy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;teams can measure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Metric Resolution Accuracy
Source Selection Accuracy
Relationship Selection Accuracy
Filter Resolution Accuracy
Trusted Relationship Usage
SQL Validation Pass Rate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This turns a monolithic accuracy score into a diagnostic system.&lt;/p&gt;

&lt;p&gt;If final-answer accuracy drops, the team can determine which layer caused the regression.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 16. Evidence as an API Object&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Evidence should not exist only in the UI.&lt;/p&gt;

&lt;p&gt;It can be part of the agent API.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"answer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"metric"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Net Revenue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;27300000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"currency"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"USD"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"evidence"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"metric"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"net_revenue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3.2"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

    &lt;/span&gt;&lt;span class="nl"&gt;"sources"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"orders"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"refunds"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"billing_accounts"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;

    &lt;/span&gt;&lt;span class="nl"&gt;"relationships"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"rel_orders_billing_account"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;

    &lt;/span&gt;&lt;span class="nl"&gt;"query_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"q_8271"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

    &lt;/span&gt;&lt;span class="nl"&gt;"validation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"passed"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now downstream systems can choose how much evidence to expose.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 17. Progressive Disclosure in the UI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most business users do not want to read SQL after every question.&lt;/p&gt;

&lt;p&gt;So the default UI can remain simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Net Revenue
$27.3M

✓ Evidence available
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Why this answer?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can reveal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Metric Definition
Source Data
Relationships
Filters
SQL
Validation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Different users can inspect different levels.&lt;/p&gt;

&lt;p&gt;An executive may stop at the answer.&lt;/p&gt;

&lt;p&gt;An analyst may inspect the metric and filters.&lt;/p&gt;

&lt;p&gt;A data engineer may inspect joins and SQL.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 18. Evidence Is Stronger Than Explanation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There is an important difference between:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Explainable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Inspectable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An LLM can generate a convincing explanation.&lt;/p&gt;

&lt;p&gt;An inspectable system exposes the artifacts that actually produced the answer.&lt;/p&gt;

&lt;p&gt;For enterprise data, inspectability is often the stronger trust mechanism.&lt;/p&gt;

&lt;p&gt;The user does not have to believe the explanation.&lt;/p&gt;

&lt;p&gt;They can inspect the evidence.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 19. A Practical Evidence Pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A simplified architecture could look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Question
      │
      ▼
Semantic Resolver
      │
      ├── metric_id
      └── dimension_ids
      │
      ▼
Relationship Resolver
      │
      └── relationship_ids
      │
      ▼
Context Builder
      │
      ▼
SQL Generator
      │
      └── query_id
      │
      ▼
SQL Validator
      │
      ▼
Query Executor
      │
      └── result_id
      │
      ▼
Answer Generator
      │
      ▼
Evidence Object
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every stage contributes structured evidence.&lt;/p&gt;

&lt;p&gt;The evidence object becomes the trace that connects the original question to the final answer.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 20. What Should Be Stored?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At minimum:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question ID
User Question
Resolved Metric + Version
Resolved Dimensions
Source Tables / Fields
Relationship IDs
Filters
Time Interpretation
Generated SQL / Query ID
Execution Result ID
Validation Status
Timestamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Depending on governance requirements, also consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Semantic Model Version
Relationship Model Version
Data Snapshot / Query Timestamp
Authorization Context
Agent Version
Model Version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes answers reproducible even as the system evolves.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## 21. A Better Definition of Production Readiness&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For a prototype, this may be enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question → SQL → Answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For production enterprise AI, a stronger standard is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question
→ Governed Interpretation
→ Trusted Data Path
→ Executable Query
→ Traceable Result
→ Evidence-Backed Answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The difference is not cosmetic.&lt;/p&gt;

&lt;p&gt;It changes how the system can be trusted, evaluated, debugged, audited, and improved.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI data agents are rapidly improving at generating SQL.&lt;/p&gt;

&lt;p&gt;But SQL generation is only one stage in a much larger correctness problem.&lt;/p&gt;

&lt;p&gt;A production system should be able to answer two questions:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What is the answer?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What evidence produced that answer?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That evidence should include the business definition, source data, relationships, filters, SQL, execution result, and validation state.&lt;/p&gt;

&lt;p&gt;Not because every user wants to inspect every detail.&lt;/p&gt;

&lt;p&gt;But because enterprise trust should be based on something stronger than model confidence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A trustworthy data agent does not just return a number. It preserves the chain of evidence that makes the number verifiable.&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Reasoning Tax: Why AI Data Agents Waste Tokens Relearning Your Schema</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Tue, 18 Aug 2026 02:52:49 +0000</pubDate>
      <link>https://dev.to/arisyndata/the-reasoning-tax-why-ai-data-agents-waste-tokens-relearning-your-schema-3mp6</link>
      <guid>https://dev.to/arisyndata/the-reasoning-tax-why-ai-data-agents-waste-tokens-relearning-your-schema-3mp6</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fixg0xkba5ontz6nynx2w.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fixg0xkba5ontz6nynx2w.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If your data agent has to rediscover metric definitions, table relationships, and trusted query paths on every request, you are spending LLM reasoning on knowledge your system should already have.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI data agents are becoming increasingly capable.&lt;/p&gt;

&lt;p&gt;A modern agent can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;retrieve schemas;&lt;/li&gt;
&lt;li&gt;interpret business terms;&lt;/li&gt;
&lt;li&gt;identify candidate tables;&lt;/li&gt;
&lt;li&gt;infer joins;&lt;/li&gt;
&lt;li&gt;generate SQL;&lt;/li&gt;
&lt;li&gt;validate queries;&lt;/li&gt;
&lt;li&gt;execute them;&lt;/li&gt;
&lt;li&gt;explain the result.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That looks like progress.&lt;/p&gt;

&lt;p&gt;But from an engineering perspective, there is an uncomfortable question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;How much of this work is genuinely new reasoning, and how much is the agent repeatedly rediscovering facts the enterprise already knows?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That repeated work creates a hidden cost: &lt;strong&gt;the reasoning tax&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## A Typical Data Agent Does Too Much at Query Time&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Consider this question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What was revenue by customer last quarter?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A typical agent pipeline may look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Question
      ↓
Intent Detection
      ↓
Schema Retrieval
      ↓
Business Term Resolution
      ↓
Candidate Table Selection
      ↓
Relationship Discovery
      ↓
Join Path Selection
      ↓
Metric Construction
      ↓
SQL Generation
      ↓
SQL Validation
      ↓
Execution
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the user asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Show customer revenue for Q2.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The analytical intent is almost identical.&lt;/p&gt;

&lt;p&gt;But many implementations repeat most of the pipeline.&lt;/p&gt;

&lt;p&gt;The agent may again retrieve schemas, resolve Revenue, identify Customer, compare join paths, and choose the reporting date.&lt;/p&gt;

&lt;p&gt;This is wasteful because much of that information is not query-specific.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Separate Query-Time Reasoning From Reusable Knowledge&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A useful engineering distinction is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Reusable Enterprise Knowledge
vs.
Query-Specific Reasoning
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;### Reusable Enterprise Knowledge&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue = Recognized Revenue

Customer = canonical customer entity

Revenue Date = recognition_date

Customer → Order = trusted relationship

Order → Revenue = validated query path
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These should not be probabilistically reconstructed on every request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;### Query-Specific Reasoning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What is the user asking?

Does "last quarter" mean fiscal or calendar quarter?

Should results be grouped by customer or customer segment?

Is the user asking for a comparison?

What should be investigated next?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These genuinely depend on the current request.&lt;/p&gt;

&lt;p&gt;The design principle is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Retrieve the known. Reason about the unknown.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;strong&gt;## Why the Reasoning Tax Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are three immediate engineering consequences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;### 1. Token Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose schema retrieval returns 30 tables, each with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;table descriptions;&lt;/li&gt;
&lt;li&gt;columns;&lt;/li&gt;
&lt;li&gt;data types;&lt;/li&gt;
&lt;li&gt;comments;&lt;/li&gt;
&lt;li&gt;sample values.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent may receive thousands of tokens before reasoning even starts.&lt;/p&gt;

&lt;p&gt;If every query repeatedly includes the same structural information, token consumption scales with query volume.&lt;/p&gt;

&lt;p&gt;A rough model is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total Token Cost
≈
Requests
×
(Context Tokens + Reasoning Tokens + Output Tokens)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reducing repeated context has a direct effect on cost.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;### 2. Latency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Agent workflows often involve multiple model or tool calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Retrieve
→ Classify
→ Resolve
→ Plan
→ Generate
→ Validate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even if each step takes only a small amount of time, the total latency accumulates.&lt;/p&gt;

&lt;p&gt;If a trusted metric definition can be returned from a deterministic service in milliseconds, there is little value in asking an LLM to infer it again.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;### 3. Inconsistency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Repeated reasoning also introduces variability.&lt;/p&gt;

&lt;p&gt;One request may produce:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue → invoice_amount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue → recognized_revenue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue → order_amount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model may be behaving reasonably in all three cases.&lt;/p&gt;

&lt;p&gt;The architecture is simply asking it to repeatedly solve an ambiguous problem.&lt;/p&gt;

&lt;p&gt;Govern the definition once and retrieve it consistently.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Schema Retrieval Is Necessary, but It Is Not Enough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common NL2SQL architecture is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question
   ↓
Embedding Search
   ↓
Relevant Tables
   ↓
LLM
   ↓
SQL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is much better than sending the entire warehouse schema.&lt;/p&gt;

&lt;p&gt;But table retrieval still leaves unresolved questions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Which metric is authoritative?

Which entity is canonical?

Which relationship is trusted?

Which date field should be used?

Which join path is safe?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Retrieval that returns only schema is still forcing the LLM to reconstruct business knowledge.&lt;/p&gt;

&lt;p&gt;A richer query context should return something closer to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;question&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;revenue&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;by&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;customer&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;last&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;quarter"&lt;/span&gt;

&lt;span class="na"&gt;metric&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;revenue&lt;/span&gt;
  &lt;span class="na"&gt;definition&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;recognized_revenue&lt;/span&gt;
  &lt;span class="na"&gt;aggregation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;SUM&lt;/span&gt;

&lt;span class="na"&gt;dimensions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;customer&lt;/span&gt;

&lt;span class="na"&gt;time&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;field&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;recognition_date&lt;/span&gt;

&lt;span class="na"&gt;tables&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;customer&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;sales_order&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;finance_revenue&lt;/span&gt;

&lt;span class="na"&gt;trusted_path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;customer&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;sales_order&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;finance_revenue&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the LLM is not discovering the data model.&lt;/p&gt;

&lt;p&gt;It is using it.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Precompute Relationship Knowledge&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Relationship inference is a major source of unnecessary query-time reasoning.&lt;/p&gt;

&lt;p&gt;Suppose the agent needs to connect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Payment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It may discover several candidate paths:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer → Order → Invoice → Payment

Customer → Account → Payment

Customer → Contract → Invoice → Payment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the organization has already validated the first path for this analytical scenario, there is no reason to compare all three paths again.&lt;/p&gt;

&lt;p&gt;Relationship knowledge can be discovered ahead of time using evidence such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Primary / Foreign Keys
Column Naming
Value Overlap
Uniqueness
Inclusion Ratio
Historical Query Patterns
Business Validation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A = order.customer_id
B = customer.customer_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A useful signal is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Inclusion(A → B)
=
|distinct(A) ∩ distinct(B)|
---------------------------
|distinct(A)|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Relationship candidates can then move through:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Discovered
    ↓
Candidate
    ↓
Validated
    ↓
Trusted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Query-time agents should preferentially retrieve the trusted result.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Move Metric Resolution Out of the Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Metric definitions are another common source of repeated reasoning.&lt;/p&gt;

&lt;p&gt;Instead of embedding this in every system prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;When the user says revenue, use recognized_amount
from finance_revenue unless...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;maintain a governed metric object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"metric"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"revenue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"aggregation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SUM"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"table"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"finance_revenue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"column"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"recognized_amount"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"time_field"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"recognition_date"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"active"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get_metric_definition("revenue")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and receives the current definition.&lt;/p&gt;

&lt;p&gt;This has several advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one definition across agents;&lt;/li&gt;
&lt;li&gt;easier versioning;&lt;/li&gt;
&lt;li&gt;easier auditing;&lt;/li&gt;
&lt;li&gt;less prompt complexity;&lt;/li&gt;
&lt;li&gt;fewer tokens;&lt;/li&gt;
&lt;li&gt;less ambiguity.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;## Build Query Context Before Calling the LLM&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A useful architecture is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                User Question
                     │
                     ▼
          ┌────────────────────┐
          │ Context Resolver   │
          ├────────────────────┤
          │ Business Terms     │
          │ Metrics            │
          │ Metadata           │
          │ Relationships      │
          │ Trusted Paths      │
          └─────────┬──────────┘
                    │
                    ▼
             Trusted Context
                    │
                    ▼
                  LLM
                    │
             Reason / Generate
                    │
                    ▼
                   SQL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The LLM receives only what is relevant.&lt;/p&gt;

&lt;p&gt;This changes the role of the model.&lt;/p&gt;

&lt;p&gt;Before:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LLM = Data Discovery + Business Interpretation + Reasoning + SQL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Data Layer = Known Enterprise Facts

LLM = Intent + Reasoning + SQL / Analysis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;## A Simple Context Resolver&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Conceptually, the resolver could work like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;build_query_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;concepts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;resolve_business_terms&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;metrics&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_metric_definitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;concepts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;entities&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_business_entities&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;concepts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;metadata&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_relevant_metadata&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;metrics&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;entities&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;entities&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;relationships&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_trusted_relationships&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tables&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;metrics&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;entities&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;entities&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;metadata&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;relationships&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;relationships&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;build_query_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;sql&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate_sql&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact implementation will vary.&lt;/p&gt;

&lt;p&gt;The architectural point is that the model does not have to infer every layer of enterprise knowledge itself.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Cache Stable Knowledge at the Right Level&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not all knowledge changes at the same frequency.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Table Schema
→ changes occasionally

Metric Definition
→ changes occasionally

Trusted Relationship
→ changes occasionally

User Question
→ changes every request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This suggests different caching and refresh strategies.&lt;/p&gt;

&lt;p&gt;A system might maintain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Metadata Cache
Semantic Cache
Relationship Cache
Query Context Cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with invalidation triggered by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Schema Change
Metric Version Change
Relationship Update
Governance Update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is more efficient than treating every query as a completely new reasoning problem.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## MCP Can Expose the Known Layer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For agent-based architectures, MCP can provide a clean interface to reusable enterprise knowledge.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get_metric_definition

get_business_entity

get_table_metadata

get_trusted_relationships

get_query_context
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent workflow becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question
   ↓
Agent
   ↓
MCP Tools
   ↓
Enterprise Data Intelligence
   ↓
Trusted Context
   ↓
LLM Reasoning
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MCP does not remove the need for semantic or relationship intelligence.&lt;/p&gt;

&lt;p&gt;It gives agents a standardized way to access it.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Do Not Confuse Precomputation With Hard-Coding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Moving knowledge out of query-time reasoning does not mean freezing the data model.&lt;/p&gt;

&lt;p&gt;Enterprise knowledge changes.&lt;/p&gt;

&lt;p&gt;Schemas evolve.&lt;/p&gt;

&lt;p&gt;Metrics change.&lt;/p&gt;

&lt;p&gt;Relationships change.&lt;/p&gt;

&lt;p&gt;The reusable layer therefore needs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Discover
   ↓
Detect Change
   ↓
Evaluate Impact
   ↓
Validate
   ↓
Version
   ↓
Publish
   ↓
Invalidate Cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The objective is not:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Never reason about the data model again.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Do not reason about the same established data knowledge on every request.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;strong&gt;## Measure the Reasoning Tax&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Teams can make this problem observable.&lt;/p&gt;

&lt;p&gt;Useful metrics might include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;### Context Tokens per Query&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Average tokens sent before generation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;### Reasoning Calls per Query&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Average LLM calls required before SQL execution
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;### Schema Candidates per Query&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;How many tables / columns must the model evaluate?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;### Relationship Resolution Rate&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;% of queries using prevalidated relationships
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;### Metric Resolution Rate&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;% of business metrics resolved without LLM inference
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;### Time to First SQL&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question received
→
Executable SQL generated
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These metrics can reveal whether the agent is spending most of its time solving analytical problems or reconstructing the enterprise data model.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## The Optimization Target Changes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common optimization question is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Which model gives the best SQL accuracy?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That still matters.&lt;/p&gt;

&lt;p&gt;But production systems should also ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How much unnecessary reasoning are we forcing the model to perform?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A more capable model may hide poor architecture by successfully reasoning through large amounts of noisy context.&lt;/p&gt;

&lt;p&gt;That does not make the architecture efficient.&lt;/p&gt;

&lt;p&gt;The better system may be the one that gives the model less to figure out.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI agents are good at reasoning.&lt;/p&gt;

&lt;p&gt;Reasoning is also probabilistic, expensive, and slower than deterministic lookup.&lt;/p&gt;

&lt;p&gt;So use it where it adds value.&lt;/p&gt;

&lt;p&gt;If Revenue already has a governed definition:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;retrieve it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If Customer already has a canonical entity:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;retrieve it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If a join path is already trusted:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;retrieve it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Then let the model solve the genuinely new problem:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;what the user is asking and how to analyze it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next generation of enterprise data agents may not win by thinking harder.&lt;/p&gt;

&lt;p&gt;They may win by knowing what they no longer need to think about.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>data</category>
      <category>sql</category>
    </item>
    <item>
      <title>Why Every AI Agent Shouldn't Have to Rediscover Your Data Model</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Fri, 14 Aug 2026 10:23:00 +0000</pubDate>
      <link>https://dev.to/arisyndata/why-every-ai-agent-shouldnt-have-to-rediscover-your-data-model-3fn9</link>
      <guid>https://dev.to/arisyndata/why-every-ai-agent-shouldnt-have-to-rediscover-your-data-model-3fn9</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxaajxm2iqkzleu6huc6g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxaajxm2iqkzleu6huc6g.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enterprise AI is moving toward a multi-agent architecture.&lt;/p&gt;

&lt;p&gt;Instead of one general-purpose assistant, organizations are starting to build specialized agents for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sales;&lt;/li&gt;
&lt;li&gt;finance;&lt;/li&gt;
&lt;li&gt;operations;&lt;/li&gt;
&lt;li&gt;customer support;&lt;/li&gt;
&lt;li&gt;analytics;&lt;/li&gt;
&lt;li&gt;management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That creates an engineering problem that is easy to miss.&lt;/p&gt;

&lt;p&gt;If every agent independently receives database schemas, retrieves metadata, learns metric definitions, discovers join paths, and builds its own interpretation of the business, then every new agent becomes another data-modeling project.&lt;/p&gt;

&lt;p&gt;The result is not only duplicated engineering work.&lt;/p&gt;

&lt;p&gt;It is duplicated &lt;strong&gt;enterprise understanding&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A better architecture is to separate agent reasoning from shared data intelligence.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## The Problem With Agent-Local Data Knowledge&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A simple data agent often looks something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
  ↓
Agent
  ├── System Prompt
  ├── Schema Retrieval
  ├── Metric Definitions
  ├── Join Instructions
  ├── SQL Tool
  └── LLM
        ↓
    Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a single proof of concept, this is reasonable.&lt;/p&gt;

&lt;p&gt;Now imagine five teams building five agents:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sales Agent
Finance Agent
Supply Chain Agent
Support Agent
Analytics Agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each team has to solve the same problems:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Which tables are relevant?

What does "Customer" mean?

Which definition of Revenue is authoritative?

How should Customer connect to Order?

Which data source should be trusted?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The implementation may be different, but the underlying enterprise knowledge is largely the same.&lt;/p&gt;

&lt;p&gt;If that knowledge lives inside each agent, duplication begins immediately.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Example: Five Agents, Three Definitions of Revenue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose an enterprise contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sales_order.total_amount
finance_invoice.invoice_amount
finance_revenue.recognized_amount
payment.received_amount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A sales agent might map:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue → sales_order.total_amount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A finance agent might use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue → finance_revenue.recognized_amount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An analytics agent might retrieve:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue → finance_invoice.invoice_amount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All three agents may generate syntactically correct SQL.&lt;/p&gt;

&lt;p&gt;All three queries may execute successfully.&lt;/p&gt;

&lt;p&gt;But the organization now has three AI systems answering the same business question differently.&lt;/p&gt;

&lt;p&gt;The problem is not LLM reasoning.&lt;/p&gt;

&lt;p&gt;The problem is that business meaning was implemented locally inside each agent.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Business Knowledge Should Be an Enterprise Dependency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Agent-specific knowledge and enterprise-wide knowledge should be separated.&lt;/p&gt;

&lt;p&gt;An agent may legitimately own:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;task instructions;&lt;/li&gt;
&lt;li&gt;workflow logic;&lt;/li&gt;
&lt;li&gt;persona;&lt;/li&gt;
&lt;li&gt;tool selection;&lt;/li&gt;
&lt;li&gt;planning strategy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But definitions such as these should not be duplicated:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
Revenue
Active Customer
Inventory Balance
Gross Margin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same applies to data relationships:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
   ↓
Order
   ↓
Invoice
   ↓
Payment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are enterprise data assets.&lt;/p&gt;

&lt;p&gt;They should be reusable dependencies.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Thick Agents vs. Thin Agents&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A thick agent contains a large amount of enterprise-specific intelligence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent
├── LLM
├── Business Semantics
├── Metrics
├── Schema Knowledge
├── Relationship Knowledge
├── Business Rules
├── Query Logic
└── Tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates coupling.&lt;/p&gt;

&lt;p&gt;If the Revenue definition changes, multiple agents may need to change.&lt;/p&gt;

&lt;p&gt;If a trusted join path changes, multiple prompts or tools may need to be updated.&lt;/p&gt;

&lt;p&gt;If the organization switches models, important business knowledge may be buried inside model-specific implementation.&lt;/p&gt;

&lt;p&gt;A thinner design looks different:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent
├── LLM
├── Task Logic
├── Planning
└── Tools
      ↓
Shared Data Intelligence
├── Business Semantics
├── Metrics &amp;amp; Dimensions
├── Metadata
├── Trusted Relationships
└── Query Context
      ↓
Enterprise Data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the agent does not need to rediscover the enterprise every time it answers a question.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## What Should the Shared Data Layer Expose?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The shared layer does not have to be one monolithic service.&lt;/p&gt;

&lt;p&gt;It can expose several reusable capabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;### 1. Metadata Retrieval&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"table"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sales_order"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"columns"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"order_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"customer_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"order_date"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"total_amount"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But raw metadata alone is not enough.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;### 2. Business Semantics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The agent should be able to resolve:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"recognized revenue"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;into something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;metric&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;revenue&lt;/span&gt;
&lt;span class="na"&gt;definition&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;recognized revenue&lt;/span&gt;
&lt;span class="na"&gt;aggregation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;SUM&lt;/span&gt;
&lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;table&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;finance_revenue&lt;/span&gt;
  &lt;span class="na"&gt;column&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;recognized_amount&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This definition can then be reused by every authorized agent.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;### 3. Relationship Discovery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose the agent needs Customer and Payment data.&lt;/p&gt;

&lt;p&gt;It should not have to guess the join path from raw schemas.&lt;/p&gt;

&lt;p&gt;A relationship service could return:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
   ↓ customer_id
Order
   ↓ order_id
Invoice
   ↓ invoice_id
Payment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;along with evidence or confidence information.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"customer"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"sales_order"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"invoice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"payment"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"trusted"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;### 4. Query Context&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of sending an entire warehouse schema into the prompt, the agent can receive only the relevant context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question
   ↓
Resolve Business Concepts
   ↓
Retrieve Relevant Metadata
   ↓
Retrieve Trusted Relationships
   ↓
Generate Query Context
   ↓
LLM
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This reduces unnecessary context and gives the model more targeted information.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Why Schema Retrieval Alone Is Not Enough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common pattern today is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question
   ↓
Embedding Search
   ↓
Relevant Tables
   ↓
LLM
   ↓
SQL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful.&lt;/p&gt;

&lt;p&gt;It solves the problem of sending thousands of tables to the model.&lt;/p&gt;

&lt;p&gt;But it does not answer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Which metric definition is authoritative?

Which relationship is trusted?

Which business entity does this table represent?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Retrieval answers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What looks relevant?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A shared data intelligence layer must also answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is valid for this business question?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That distinction matters more as the number of agents grows.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Relationship Knowledge Should Be Evidence-Based&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enterprise relationships are often not fully represented by foreign keys.&lt;/p&gt;

&lt;p&gt;A relationship engine can use several signals:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Database constraints
Naming similarity
Value overlap
Uniqueness
Inclusion relationships
Validated business mappings
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, if:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A = order.customer_id
B = customer.customer_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can calculate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Inclusion(A → B)
=
|distinct(A) ∩ distinct(B)|
---------------------------
|distinct(A)|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A high inclusion ratio can provide evidence that &lt;code&gt;A&lt;/code&gt; references &lt;code&gt;B&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But discovered relationships should not automatically become business truth.&lt;/p&gt;

&lt;p&gt;A safer lifecycle is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Discovered
    ↓
Candidate
    ↓
Validated
    ↓
Trusted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Agents should preferentially consume trusted relationships rather than independently inventing joins.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## MCP Fits Here — But It Is Not the Data Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MCP gives agents a standardized way to discover and call tools.&lt;/p&gt;

&lt;p&gt;That makes it a natural interface for shared data capabilities.&lt;/p&gt;

&lt;p&gt;For example, an enterprise data MCP server could expose tools such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get_metric_definition()

get_table_metadata()

discover_relationships()

get_query_context()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An agent could then call:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent
  ↓
MCP
  ↓
Shared Data Intelligence Services
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But MCP itself does not determine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What Revenue means

Which customer definition is authoritative

Which join path is trusted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those decisions come from the data intelligence behind the interface.&lt;/p&gt;

&lt;p&gt;A useful distinction is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;MCP standardizes access. Shared data intelligence standardizes understanding.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;strong&gt;## Centralization Does Not Mean Static Knowledge&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Moving enterprise knowledge into a shared layer solves duplication, but it creates another responsibility:&lt;/p&gt;

&lt;p&gt;the shared knowledge must stay current.&lt;/p&gt;

&lt;p&gt;Enterprise systems continuously change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;New tables
New columns
New metrics
New business rules
New relationships
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the shared layer needs its own lifecycle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Discover
   ↓
Detect Change
   ↓
Evaluate Impact
   ↓
Validate
   ↓
Version
   ↓
Publish
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Otherwise the organization simply replaces many stale agent configurations with one stale central configuration.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## What Happens When a Metric Changes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue v1
=
SUM(invoice_amount)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;changes to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue v2
=
SUM(recognized_amount)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With agent-local knowledge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sales Agent → update
Finance Agent → update
Analytics Agent → update
Management Agent → update
Support Agent → maybe update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Someone has to discover every dependency.&lt;/p&gt;

&lt;p&gt;With shared semantics:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue Definition
       ↓
Version Update
       ↓
Shared Data Intelligence
       ↓
All Authorized Agents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The enterprise changes the definition once.&lt;/p&gt;

&lt;p&gt;Agents consume the updated version.&lt;/p&gt;

&lt;p&gt;That is a much cleaner dependency model.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Shared Data Intelligence Also Reduces Agent Coupling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There is another benefit.&lt;/p&gt;

&lt;p&gt;Agent frameworks are changing quickly.&lt;/p&gt;

&lt;p&gt;Organizations may switch between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;models;&lt;/li&gt;
&lt;li&gt;orchestration frameworks;&lt;/li&gt;
&lt;li&gt;agent runtimes;&lt;/li&gt;
&lt;li&gt;application interfaces.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Business knowledge should survive those changes.&lt;/p&gt;

&lt;p&gt;If metric definitions, data relationships, and business mappings are independent of the agent implementation, agents become easier to replace.&lt;/p&gt;

&lt;p&gt;That suggests an architectural principle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agents = Replaceable Compute / Reasoning

Enterprise Data Intelligence = Durable Knowledge
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The enterprise should own its understanding of itself.&lt;/p&gt;

&lt;p&gt;Not the current agent framework.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## A Practical Multi-Agent Data Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A simplified architecture might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;               Sales Agent
                    │
              Finance Agent
                    │
             Analytics Agent
                    │
             Operations Agent
                    │
                    ▼
        ┌──────────────────────┐
        │ Shared Data          │
        │ Intelligence Layer   │
        ├──────────────────────┤
        │ Business Semantics   │
        │ Metrics &amp;amp; Dimensions │
        │ Metadata             │
        │ Relationships        │
        │ Trusted Query Paths  │
        └──────────────────────┘
                    │
                    ▼
             Enterprise Data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The shared layer does not replace agents.&lt;/p&gt;

&lt;p&gt;It makes them thinner.&lt;/p&gt;

&lt;p&gt;It does not replace the LLM.&lt;/p&gt;

&lt;p&gt;It gives the LLM a consistent representation of the enterprise.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first generation of enterprise agents focused on making individual agents more capable.&lt;/p&gt;

&lt;p&gt;The multi-agent era creates a different engineering problem:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How do many agents share one consistent understanding of enterprise data?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If every agent independently discovers schemas, defines metrics, and guesses relationships, organizations will create duplicated logic and inconsistent answers.&lt;/p&gt;

&lt;p&gt;The better pattern is separation of concerns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agents reason.

Shared data intelligence defines what the enterprise means.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Models will change.&lt;/p&gt;

&lt;p&gt;Agents will change.&lt;/p&gt;

&lt;p&gt;Frameworks will change.&lt;/p&gt;

&lt;p&gt;Your enterprise should not have to rediscover its own data model every time they do.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>data</category>
      <category>sql</category>
      <category>llm</category>
    </item>
    <item>
      <title>Semantic Drift: The Hidden Failure Mode of Enterprise AI Analytics</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Wed, 12 Aug 2026 13:18:00 +0000</pubDate>
      <link>https://dev.to/arisyndata/semantic-drift-the-hidden-failure-mode-of-enterprise-ai-analytics-161c</link>
      <guid>https://dev.to/arisyndata/semantic-drift-the-hidden-failure-mode-of-enterprise-ai-analytics-161c</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwppfii0eb9hpxwvurvto.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwppfii0eb9hpxwvurvto.jpg" alt=" " width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enterprise AI systems rarely fail only because the model is weak.&lt;/p&gt;

&lt;p&gt;A more subtle failure happens when the model is working correctly, the SQL executes successfully, and the result looks reasonable — but the system is reasoning over an outdated representation of the business.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;semantic drift&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;As more teams put semantic layers between LLMs and enterprise data, maintaining those semantics becomes a production engineering problem rather than a one-time modeling task.&lt;/p&gt;

&lt;p&gt;The database changes.&lt;/p&gt;

&lt;p&gt;Business definitions change.&lt;/p&gt;

&lt;p&gt;Relationships change.&lt;/p&gt;

&lt;p&gt;If the AI's understanding does not change with them, accuracy degrades quietly.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;A Semantic Layer Is Runtime Infrastructure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common AI analytics architecture looks roughly like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Question
     ↓
LLM / Query Agent
     ↓
Semantic Layer
     ↓
Enterprise Data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The semantic layer may contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;business terms;&lt;/li&gt;
&lt;li&gt;metric definitions;&lt;/li&gt;
&lt;li&gt;dimensions;&lt;/li&gt;
&lt;li&gt;mappings to physical tables and columns;&lt;/li&gt;
&lt;li&gt;relationships used to generate queries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This helps prevent an LLM from guessing directly from raw schemas.&lt;/p&gt;

&lt;p&gt;But there is an important consequence:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Once AI depends on the semantic layer at query time, stale semantics become a runtime failure.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The problem is that semantic models are often maintained as if they were documentation.&lt;/p&gt;

&lt;p&gt;Define them once.&lt;/p&gt;

&lt;p&gt;Review them.&lt;/p&gt;

&lt;p&gt;Publish them.&lt;/p&gt;

&lt;p&gt;Then assume they remain correct.&lt;/p&gt;

&lt;p&gt;Enterprise data does not behave that way.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Failure Mode 1: Schema Drift&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose a metric is mapped to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;customer.customer_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After a warehouse migration, the organization introduces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;account_customer.customer_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The old table may remain available for compatibility.&lt;/p&gt;

&lt;p&gt;That creates a dangerous situation.&lt;/p&gt;

&lt;p&gt;Nothing necessarily breaks.&lt;/p&gt;

&lt;p&gt;The old query can still execute.&lt;/p&gt;

&lt;p&gt;The semantic mapping is simply pointing to a representation that is no longer authoritative.&lt;/p&gt;

&lt;p&gt;Traditional schema monitoring may tell you that a column was added.&lt;/p&gt;

&lt;p&gt;AI analytics needs to answer a harder question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Does this schema change invalidate any business meaning used by the AI?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That requires connecting physical metadata changes to semantic dependencies.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Failure Mode 2: Semantic Drift&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Semantic drift happens even when the schema does not change.&lt;/p&gt;

&lt;p&gt;Consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Active Customer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Version 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;customer.status = 'ACTIVE'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Later, the business changes the definition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;customer with &amp;gt;= 1 completed order in the last 90 days
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The database can remain exactly the same.&lt;/p&gt;

&lt;p&gt;But the meaning has changed.&lt;/p&gt;

&lt;p&gt;An AI system using the old definition may continue returning perfectly valid SQL and perfectly wrong business answers.&lt;/p&gt;

&lt;p&gt;This is why execution success is a weak validation signal for enterprise AI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SQL succeeded != business meaning is correct
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Failure Mode 3: Relationship Drift&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This problem becomes more interesting when queries span multiple tables.&lt;/p&gt;

&lt;p&gt;Imagine the original analytical path is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
   ↓ customer_id
Order
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After an ERP redesign:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
   ↓
Account
   ↓
Order
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The old join may still work because legacy identifiers remain populated.&lt;/p&gt;

&lt;p&gt;But the organization has changed the business relationship.&lt;/p&gt;

&lt;p&gt;An LLM that sees both paths now has multiple executable options.&lt;/p&gt;

&lt;p&gt;Which one is correct?&lt;/p&gt;

&lt;p&gt;This cannot be solved reliably with schema retrieval alone.&lt;/p&gt;

&lt;p&gt;The system needs maintained relationship knowledge.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why Embeddings Do Not Solve Drift&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common approach is to embed schema metadata and retrieve relevant tables for each question.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Question
     ↓
Embedding Search
     ↓
Relevant Tables / Columns
     ↓
LLM
     ↓
SQL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful for reducing schema size.&lt;/p&gt;

&lt;p&gt;But semantic similarity does not tell us whether a definition is current.&lt;/p&gt;

&lt;p&gt;Embedding search may find:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;invoice_amount
recognized_revenue
payment_amount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for the term:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;revenue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All three are semantically related.&lt;/p&gt;

&lt;p&gt;Only business governance can determine which one currently represents the metric.&lt;/p&gt;

&lt;p&gt;Likewise, embeddings may identify two similar identifiers, but similarity does not prove that they form the trusted join path.&lt;/p&gt;

&lt;p&gt;Retrieval solves relevance.&lt;/p&gt;

&lt;p&gt;It does not solve validity.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Treat Semantic Assets Like Versioned Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If semantic definitions affect AI-generated answers, they should be treated more like production code than documentation.&lt;/p&gt;

&lt;p&gt;A metric definition should have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;metric&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;revenue&lt;/span&gt;
&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2.1&lt;/span&gt;
&lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;active&lt;/span&gt;
&lt;span class="na"&gt;definition&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;recognized revenue&lt;/span&gt;
&lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;table&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;finance_revenue&lt;/span&gt;
  &lt;span class="na"&gt;column&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;recognized_amount&lt;/span&gt;
&lt;span class="na"&gt;valid_from&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;2026-07-01&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A relationship should also carry explicit evidence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;relationship&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;customer.customer_id&lt;/span&gt;
  &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;account.customer_id&lt;/span&gt;
&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;business_validated&lt;/span&gt;
&lt;span class="na"&gt;confidence&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.97&lt;/span&gt;
&lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;active&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact format is less important than the engineering principle:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Meaning needs identity, state, history, and validation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Without versioning, it becomes difficult to answer basic production questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which definition generated this answer?&lt;/li&gt;
&lt;li&gt;When did that definition change?&lt;/li&gt;
&lt;li&gt;Which queries are affected?&lt;/li&gt;
&lt;li&gt;Can we roll back?&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Detect Changes Before They Become Wrong Answers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A living semantic system needs change detection.&lt;/p&gt;

&lt;p&gt;At the physical layer, monitor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;New table
Column added
Column removed
Type changed
Constraint changed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the relationship layer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;New candidate relationship
Join coverage changed
Identifier uniqueness changed
Relationship confidence changed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the semantic layer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Metric definition changed
Mapping became ambiguous
Business term changed
New semantic version published
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important part is not generating more alerts.&lt;/p&gt;

&lt;p&gt;It is calculating &lt;strong&gt;impact&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;finance_invoice.invoice_amount changed
                 ↓
revenue metric mapping affected
                 ↓
12 query templates affected
                 ↓
AI queries using Revenue require validation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now schema monitoring becomes useful to AI governance.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Relationship Discovery Should Produce Candidates, Not Truth&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Automatically discovering relationships can help keep a data model current.&lt;/p&gt;

&lt;p&gt;Signals may include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;declared primary/foreign keys;&lt;/li&gt;
&lt;li&gt;naming similarity;&lt;/li&gt;
&lt;li&gt;value overlap;&lt;/li&gt;
&lt;li&gt;uniqueness;&lt;/li&gt;
&lt;li&gt;inclusion ratio;&lt;/li&gt;
&lt;li&gt;historical joins.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For two columns &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt;, a simple inclusion signal could be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;inclusion(A → B)
=
|distinct(A) ∩ distinct(B)|
---------------------------
|distinct(A)|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A high value can indicate a possible relationship.&lt;/p&gt;

&lt;p&gt;But it should not automatically become trusted business logic.&lt;/p&gt;

&lt;p&gt;A better lifecycle is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Relationship Detected
        ↓
Candidate
        ↓
Evidence / Confidence
        ↓
Validation
        ↓
Trusted Relationship
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This distinction matters.&lt;/p&gt;

&lt;p&gt;Automated discovery improves coverage.&lt;/p&gt;

&lt;p&gt;Governance establishes trust.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Human-in-the-Loop Is a Feature, Not a Failure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enterprise semantics often cannot be inferred safely from technical metadata alone.&lt;/p&gt;

&lt;p&gt;If the system finds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;mapped plausibly to both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sales_order.total_amount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;finance_revenue.recognized_amount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the correct behavior may be to ask for clarification.&lt;/p&gt;

&lt;p&gt;A useful workflow is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ambiguity Detected
       ↓
Candidate Definitions
       ↓
Human Review
       ↓
Validate With Query
       ↓
Publish New Version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal of automation is not to eliminate domain experts.&lt;/p&gt;

&lt;p&gt;It is to stop asking them to manually rediscover every schema and relationship change.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;A Practical Living Data Model Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Putting the pieces together, the lifecycle looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Discover metadata
        ↓
2. Detect schema and relationship changes
        ↓
3. Identify impacted semantic assets
        ↓
4. Generate candidate updates
        ↓
5. Validate ambiguous business meaning
        ↓
6. Version and publish
        ↓
7. Use validated semantics for AI queries
        ↓
8. Repeat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is fundamentally different from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Build semantic layer → Done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The semantic model becomes an operational system.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What Should Be Monitored?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A few useful signals include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Semantic Coverage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How much of the active analytical surface has governed meaning?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;governed metrics / queried metrics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Relationship Coverage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How many required multi-table query paths are backed by trusted relationships?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ambiguity Rate&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How often does a business term map to multiple plausible definitions?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stale Mapping Rate&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How many semantic mappings reference changed or deprecated physical assets?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Validation Failure Rate&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How often do proposed semantic or relationship updates fail business validation?&lt;/p&gt;

&lt;p&gt;These metrics tell you more about production readiness than simply measuring whether SQL execution succeeds.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The Key Engineering Shift&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first generation of LLM analytics focused heavily on query generation.&lt;/p&gt;

&lt;p&gt;The next engineering challenge is maintaining the data knowledge used to generate those queries.&lt;/p&gt;

&lt;p&gt;A stronger model cannot compensate for a stale business definition.&lt;/p&gt;

&lt;p&gt;A larger context window cannot determine whether an old join path is still authoritative.&lt;/p&gt;

&lt;p&gt;And better embeddings cannot decide when the organization changed the meaning of revenue.&lt;/p&gt;

&lt;p&gt;The system needs a maintained layer of enterprise data knowledge.&lt;/p&gt;

&lt;p&gt;Not static metadata.&lt;/p&gt;

&lt;p&gt;Not a one-time semantic project.&lt;/p&gt;

&lt;p&gt;A living model.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your AI analytics system depends on business semantics, those semantics are production infrastructure.&lt;/p&gt;

&lt;p&gt;Treat them accordingly.&lt;/p&gt;

&lt;p&gt;Monitor changes.&lt;/p&gt;

&lt;p&gt;Track relationships.&lt;/p&gt;

&lt;p&gt;Version definitions.&lt;/p&gt;

&lt;p&gt;Detect ambiguity.&lt;/p&gt;

&lt;p&gt;Validate business meaning.&lt;/p&gt;

&lt;p&gt;Because the most dangerous enterprise AI failure is not always a broken query.&lt;/p&gt;

&lt;p&gt;Sometimes the query works perfectly — against yesterday's understanding of the business.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>semantic</category>
      <category>data</category>
      <category>sql</category>
    </item>
    <item>
      <title>Building AI Analysts: Why Enterprise Analytics Needs More Than BI Dashboards</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Mon, 10 Aug 2026 12:46:00 +0000</pubDate>
      <link>https://dev.to/arisyndata/building-ai-analysts-why-enterprise-analytics-needs-more-than-bi-dashboards-490a</link>
      <guid>https://dev.to/arisyndata/building-ai-analysts-why-enterprise-analytics-needs-more-than-bi-dashboards-490a</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Floh8bbx2olfcan5ic6a7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Floh8bbx2olfcan5ic6a7.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For decades, enterprises have relied on dashboards as the primary way to consume business data.&lt;/p&gt;

&lt;p&gt;A typical workflow looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Business Question
↓
Find the Right Dashboard
↓
Select Filters
↓
Review Metrics
↓
Human Analysis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This model works well for predefined questions.&lt;/p&gt;

&lt;p&gt;But modern businesses increasingly ask questions that were never designed into dashboards:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why did sales decline in East China last month?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Answering this requires combining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sales data;&lt;/li&gt;
&lt;li&gt;customer data;&lt;/li&gt;
&lt;li&gt;product data;&lt;/li&gt;
&lt;li&gt;regional information;&lt;/li&gt;
&lt;li&gt;order history.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A dashboard can show what happened.&lt;/p&gt;

&lt;p&gt;But understanding why it happened requires deeper analysis.&lt;/p&gt;

&lt;p&gt;This is where AI Analysts become valuable.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;From BI Dashboards to AI Analysts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI changes the interaction model.&lt;/p&gt;

&lt;p&gt;Instead of searching for reports, users can directly express business questions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Business Question

↓

AI Understanding

↓

Data Discovery

↓

Multi-dimensional Analysis

↓

Business Insight
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal is not simply generating charts.&lt;/p&gt;

&lt;p&gt;The goal is helping users understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What happened?&lt;/li&gt;
&lt;li&gt;Why did it happen?&lt;/li&gt;
&lt;li&gt;What factors contributed?&lt;/li&gt;
&lt;li&gt;What should be investigated next?&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Why Building AI Analysts Is Difficult&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Connecting an LLM to a database is not enough.&lt;/p&gt;

&lt;p&gt;Enterprise analytics requires understanding the business behind the data.&lt;/p&gt;

&lt;p&gt;An AI Analyst needs to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;business concepts;&lt;/li&gt;
&lt;li&gt;data relationships;&lt;/li&gt;
&lt;li&gt;analytical logic.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Understanding Business Concepts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Business users do not think in tables.&lt;/p&gt;

&lt;p&gt;They ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Show me high-value customers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But enterprises may have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;customer_table

account_table

crm_customer

billing_customer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The AI needs to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which customer definition is correct?&lt;/li&gt;
&lt;li&gt;Which attributes define value?&lt;/li&gt;
&lt;li&gt;Which data source should be trusted?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A business concept is not always a table.&lt;/p&gt;

&lt;p&gt;It is a combination of entities, metrics, rules, and relationships.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Understanding Data Relationships&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enterprise analysis rarely depends on one table.&lt;/p&gt;

&lt;p&gt;A typical path may involve:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
↓
Order
↓
Contract
↓
Payment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, enterprises often contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;multiple applications;&lt;/li&gt;
&lt;li&gt;duplicated entities;&lt;/li&gt;
&lt;li&gt;different identifiers;&lt;/li&gt;
&lt;li&gt;historical data models.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A database may allow many joins.&lt;/p&gt;

&lt;p&gt;But only some relationships represent business logic.&lt;/p&gt;

&lt;p&gt;The important question is not:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can these tables be joined?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Is this the correct business relationship?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;strong&gt;Moving From Answers to Analysis&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Traditional systems answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is the number?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;AI Analysts should answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why is this number changing?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sales decreased last month. Why?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The system should analyze:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;regional changes;&lt;/li&gt;
&lt;li&gt;customer changes;&lt;/li&gt;
&lt;li&gt;product changes;&lt;/li&gt;
&lt;li&gt;historical trends.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This requires dynamic analysis instead of fixed dashboards.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The Architecture Behind AI-Native Analytics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A future analytics system is not simply:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
↓
LLM
↓
Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A more reliable architecture requires:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Question

↓

AI Understanding

↓

Semantic Layer

↓

Relationship Intelligence

↓

Query Generation

↓

Analysis Result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AI needs to understand:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business Semantics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What does the data mean?&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;revenue definition;&lt;/li&gt;
&lt;li&gt;active customer definition;&lt;/li&gt;
&lt;li&gt;inventory calculation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data Relationships&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How is enterprise data connected?&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;customer to order;&lt;/li&gt;
&lt;li&gt;order to invoice;&lt;/li&gt;
&lt;li&gt;invoice to payment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Analytical Context&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What analysis should happen next?&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;comparison;&lt;/li&gt;
&lt;li&gt;trend analysis;&lt;/li&gt;
&lt;li&gt;root cause exploration.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;The Future of Enterprise Analytics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next generation of analytics will combine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;large language models;&lt;/li&gt;
&lt;li&gt;semantic understanding;&lt;/li&gt;
&lt;li&gt;relationship intelligence;&lt;/li&gt;
&lt;li&gt;enterprise data governance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The future is not about creating more dashboards.&lt;/p&gt;

&lt;p&gt;It is about creating AI systems that can become intelligent partners in business analysis.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Traditional BI helped enterprises understand what happened.&lt;/p&gt;

&lt;p&gt;AI Analysts will help enterprises understand why it happened.&lt;/p&gt;

&lt;p&gt;But this requires more than connecting an LLM to a database.&lt;/p&gt;

&lt;p&gt;AI needs to understand business concepts, data relationships, and analytical context.&lt;/p&gt;

&lt;p&gt;Only then can enterprise AI move from answering questions to supporting real analysis.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>data</category>
      <category>sql</category>
      <category>llm</category>
    </item>
    <item>
      <title>Beyond Data Lineage: Building Observability for AI-Generated Queries</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Wed, 05 Aug 2026 11:20:00 +0000</pubDate>
      <link>https://dev.to/arisyndata/beyond-data-lineage-building-observability-for-ai-generated-queries-1hcm</link>
      <guid>https://dev.to/arisyndata/beyond-data-lineage-building-observability-for-ai-generated-queries-1hcm</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1x3zy0p87swuqrlpbwx9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1x3zy0p87swuqrlpbwx9.jpg" alt=" " width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enterprise AI is moving from experimentation to production.&lt;/p&gt;

&lt;p&gt;Organizations are deploying AI assistants that can query databases, generate reports, and analyze business data.&lt;/p&gt;

&lt;p&gt;The first challenge was making AI capable of answering questions.&lt;/p&gt;

&lt;p&gt;The next challenge is making those answers trustworthy.&lt;/p&gt;

&lt;p&gt;When an AI system provides an answer, enterprises need to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What data did AI use?&lt;/li&gt;
&lt;li&gt;Why did AI choose those tables?&lt;/li&gt;
&lt;li&gt;Which business definitions were applied?&lt;/li&gt;
&lt;li&gt;How was the final answer generated?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where traditional data observability needs to evolve.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Traditional Data Observability Was Built for Data Pipelines&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For years, enterprises focused on understanding how data moved.&lt;/p&gt;

&lt;p&gt;A typical lineage looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Source Database

↓

ETL Pipeline

↓

Data Warehouse

↓

BI Report
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Organizations needed to know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where did data come from?&lt;/li&gt;
&lt;li&gt;Which pipeline transformed it?&lt;/li&gt;
&lt;li&gt;Which reports depend on it?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This became the foundation of modern data governance.&lt;/p&gt;

&lt;p&gt;However, AI introduces a different type of data consumption.&lt;/p&gt;

&lt;p&gt;AI does not only move data.&lt;/p&gt;

&lt;p&gt;AI interprets data.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;AI Creates a New Observability Challenge&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Consider a question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why did sales decrease last month?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An AI assistant may:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Understand the question.&lt;/li&gt;
&lt;li&gt;Select relevant data sources.&lt;/li&gt;
&lt;li&gt;Generate SQL.&lt;/li&gt;
&lt;li&gt;Execute the query.&lt;/li&gt;
&lt;li&gt;Explain the result.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The final answer may look reasonable.&lt;/p&gt;

&lt;p&gt;But enterprises need more visibility.&lt;/p&gt;

&lt;p&gt;They need to understand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Question

↓

AI Interpretation

↓

Business Definition

↓

Selected Data Sources

↓

Relationship Path

↓

Generated SQL

↓

Final Answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is different from traditional data lineage.&lt;/p&gt;

&lt;p&gt;It is AI reasoning lineage.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why AI Query Results Need Explainability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Traditional BI systems use predefined reports.&lt;/p&gt;

&lt;p&gt;Users usually know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which metric is used;&lt;/li&gt;
&lt;li&gt;which data source is connected;&lt;/li&gt;
&lt;li&gt;how calculations are performed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI-powered analytics changes this.&lt;/p&gt;

&lt;p&gt;The query path can be generated dynamically.&lt;/p&gt;

&lt;p&gt;The selected tables may change.&lt;/p&gt;

&lt;p&gt;The SQL may be different for different questions.&lt;/p&gt;

&lt;p&gt;Therefore, AI systems need to explain not only the answer, but also the reasoning behind the answer.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The Four Layers of AI Data Observability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI data observability extends traditional data governance with new capabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Query Lineage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Traditional lineage asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Where did this data come from?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;AI query lineage asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How did AI produce this answer?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It should capture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user question;&lt;/li&gt;
&lt;li&gt;generated SQL;&lt;/li&gt;
&lt;li&gt;selected tables;&lt;/li&gt;
&lt;li&gt;filters;&lt;/li&gt;
&lt;li&gt;returned datasets.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;2. Semantic Lineage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enterprise concepts often have multiple meanings.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;Revenue may mean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sales revenue;&lt;/li&gt;
&lt;li&gt;recognized revenue;&lt;/li&gt;
&lt;li&gt;invoice amount;&lt;/li&gt;
&lt;li&gt;payment amount.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI observability needs to record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which business definition was used;&lt;/li&gt;
&lt;li&gt;which metric mapping was applied;&lt;/li&gt;
&lt;li&gt;which semantic rules affected the answer.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;3. Relationship Lineage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enterprise queries often depend on relationships:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer

↓

Order

↓

Invoice

↓

Payment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AI needs to know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which relationship path was selected;&lt;/li&gt;
&lt;li&gt;why this path was chosen;&lt;/li&gt;
&lt;li&gt;whether the relationship is trusted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A valid SQL join does not always represent a valid business relationship.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;4. Answer Explainability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enterprise users need more than a result.&lt;/p&gt;

&lt;p&gt;They need to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;where the data came from;&lt;/li&gt;
&lt;li&gt;what logic was applied;&lt;/li&gt;
&lt;li&gt;what assumptions were made.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is critical in industries where decisions depend on reliable data.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;From Data Governance to AI Governance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Traditional data governance focused on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;data quality;&lt;/li&gt;
&lt;li&gt;metadata;&lt;/li&gt;
&lt;li&gt;lineage;&lt;/li&gt;
&lt;li&gt;ownership.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI introduces new requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI query traceability;&lt;/li&gt;
&lt;li&gt;semantic consistency;&lt;/li&gt;
&lt;li&gt;relationship validation;&lt;/li&gt;
&lt;li&gt;answer transparency.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The question is changing from:&lt;/p&gt;

&lt;p&gt;"Can we manage enterprise data?"&lt;/p&gt;

&lt;p&gt;to:&lt;/p&gt;

&lt;p&gt;"Can we trust how AI uses enterprise data?"&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI can generate answers quickly.&lt;/p&gt;

&lt;p&gt;But enterprises need more than speed.&lt;/p&gt;

&lt;p&gt;They need confidence.&lt;/p&gt;

&lt;p&gt;Traditional data lineage helped organizations understand how data moved.&lt;/p&gt;

&lt;p&gt;AI observability will help organizations understand how AI reasons over data.&lt;/p&gt;

&lt;p&gt;The future of enterprise AI will belong to systems that are not only intelligent, but also transparent and trustworthy.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>data</category>
      <category>sql</category>
      <category>llm</category>
    </item>
    <item>
      <title>Building Data Intelligence for Reliable Enterprise AI</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Mon, 03 Aug 2026 11:41:00 +0000</pubDate>
      <link>https://dev.to/arisyndata/building-data-intelligence-for-reliable-enterprise-ai-1gl1</link>
      <guid>https://dev.to/arisyndata/building-data-intelligence-for-reliable-enterprise-ai-1gl1</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fstxsina13vmytyjaxamo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fstxsina13vmytyjaxamo.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Large language models are becoming more capable every year.&lt;/p&gt;

&lt;p&gt;They can generate SQL, write code, analyze documents, and interact with enterprise systems through tools.&lt;/p&gt;

&lt;p&gt;However, when organizations move AI applications from prototypes to production, a common problem appears:&lt;/p&gt;

&lt;p&gt;AI can access enterprise data.&lt;/p&gt;

&lt;p&gt;But access does not mean understanding.&lt;/p&gt;

&lt;p&gt;Many enterprise AI failures are not caused by weak models.&lt;/p&gt;

&lt;p&gt;They are caused by the fact that enterprise data was designed for applications and humans, not for AI systems.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Data Access Is Not Data Intelligence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modern enterprises already have mature data platforms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;relational databases;&lt;/li&gt;
&lt;li&gt;data warehouses;&lt;/li&gt;
&lt;li&gt;data lakes;&lt;/li&gt;
&lt;li&gt;BI systems;&lt;/li&gt;
&lt;li&gt;metadata management platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These systems solve an important problem:&lt;/p&gt;

&lt;p&gt;How do we store and access data?&lt;/p&gt;

&lt;p&gt;AI introduces a different challenge:&lt;/p&gt;

&lt;p&gt;How does AI understand and use this data correctly?&lt;/p&gt;

&lt;p&gt;A database can tell an AI system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;this is a customer table;&lt;/li&gt;
&lt;li&gt;this is a revenue column;&lt;/li&gt;
&lt;li&gt;this field contains an identifier.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But it usually cannot explain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which customer definition is trusted;&lt;/li&gt;
&lt;li&gt;what revenue means in this business context;&lt;/li&gt;
&lt;li&gt;how data from different systems should be connected.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The difference is the gap between data access and data intelligence.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why Traditional Metadata Is Not Enough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many enterprise AI systems start by providing metadata to LLMs.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Table: customer

Columns:
customer_id
customer_name
create_time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This information helps AI discover available data.&lt;/p&gt;

&lt;p&gt;But it does not provide enough business understanding.&lt;/p&gt;

&lt;p&gt;Consider a simple question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Who are our most valuable customers?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An enterprise may have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;crm_customer

erp_customer

billing_customer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All three tables may contain customer information.&lt;/p&gt;

&lt;p&gt;The challenge is not finding these tables.&lt;/p&gt;

&lt;p&gt;The challenge is understanding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are they the same business entity?&lt;/li&gt;
&lt;li&gt;Which one is authoritative?&lt;/li&gt;
&lt;li&gt;How should they be related?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without this knowledge, AI has to guess.&lt;/p&gt;

&lt;p&gt;And guessing creates unreliable answers.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Data Intelligence Starts With Business Meaning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enterprise data contains many ambiguous concepts.&lt;/p&gt;

&lt;p&gt;A common example is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It may represent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sales revenue;&lt;/li&gt;
&lt;li&gt;recognized revenue;&lt;/li&gt;
&lt;li&gt;invoice amount;&lt;/li&gt;
&lt;li&gt;payment amount;&lt;/li&gt;
&lt;li&gt;contract value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From a database perspective, all of these are valid fields.&lt;/p&gt;

&lt;p&gt;From a business perspective, they answer different questions.&lt;/p&gt;

&lt;p&gt;Humans resolve this ambiguity through experience.&lt;/p&gt;

&lt;p&gt;AI needs this business meaning to be explicitly available.&lt;/p&gt;

&lt;p&gt;This is why semantic understanding is a fundamental requirement for enterprise AI.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Relationships Are the Hidden Challenge&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enterprise data is not a collection of isolated tables.&lt;/p&gt;

&lt;p&gt;Business processes connect data together.&lt;/p&gt;

&lt;p&gt;A simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer

↓

Order

↓

Invoice

↓

Payment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, real enterprise environments are much more complex.&lt;/p&gt;

&lt;p&gt;Organizations often have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;multiple systems;&lt;/li&gt;
&lt;li&gt;duplicated entities;&lt;/li&gt;
&lt;li&gt;inconsistent identifiers;&lt;/li&gt;
&lt;li&gt;historical data models.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A database may allow many possible joins.&lt;/p&gt;

&lt;p&gt;But only some relationships represent real business logic.&lt;/p&gt;

&lt;p&gt;A technically valid join does not always mean a business-valid relationship.&lt;/p&gt;

&lt;p&gt;For AI applications, trusted relationships matter.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why Bigger LLMs Are Not Enough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common assumption is:&lt;/p&gt;

&lt;p&gt;"If the model becomes smarter, it will solve enterprise data problems."&lt;/p&gt;

&lt;p&gt;Better models definitely improve reasoning capabilities.&lt;/p&gt;

&lt;p&gt;But models cannot automatically know enterprise-specific knowledge.&lt;/p&gt;

&lt;p&gt;They cannot magically determine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which data source the company trusts;&lt;/li&gt;
&lt;li&gt;which metric definition is correct;&lt;/li&gt;
&lt;li&gt;which relationship represents the real business process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The problem is not only intelligence.&lt;/p&gt;

&lt;p&gt;The problem is the intelligence available around the data.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Building an AI-Ready Data Intelligence Layer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Reliable enterprise AI requires more than connecting an LLM to a database.&lt;/p&gt;

&lt;p&gt;It requires data intelligence capabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business Entity Understanding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI needs to understand important business objects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer;&lt;/li&gt;
&lt;li&gt;Product;&lt;/li&gt;
&lt;li&gt;Supplier;&lt;/li&gt;
&lt;li&gt;Contract;&lt;/li&gt;
&lt;li&gt;Project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not just as database tables.&lt;/p&gt;

&lt;p&gt;As business entities.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Data Semantic Understanding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI needs to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;business terms;&lt;/li&gt;
&lt;li&gt;metric definitions;&lt;/li&gt;
&lt;li&gt;calculation logic;&lt;/li&gt;
&lt;li&gt;organizational language.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same field name can represent different meanings across organizations.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Trusted Data Relationships&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI needs to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which entities are connected;&lt;/li&gt;
&lt;li&gt;which relationships are reliable;&lt;/li&gt;
&lt;li&gt;which data paths should be used.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This enables AI to generate answers based on trusted enterprise knowledge.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The Future of Enterprise AI Data Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Traditional data platforms answered:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Where is the data?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;AI requires a deeper answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What does this data mean?&lt;/p&gt;

&lt;p&gt;How is it connected?&lt;/p&gt;

&lt;p&gt;Can AI trust it?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The next generation of enterprise data architecture will not replace databases, warehouses, or lakes.&lt;/p&gt;

&lt;p&gt;Instead, it will add intelligence that makes enterprise data understandable and usable for AI systems.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enterprise AI is not only a model problem.&lt;/p&gt;

&lt;p&gt;It is also a data intelligence problem.&lt;/p&gt;

&lt;p&gt;Large language models provide reasoning capabilities.&lt;/p&gt;

&lt;p&gt;Data intelligence provides the foundation that allows those capabilities to work reliably.&lt;/p&gt;

&lt;p&gt;The future of enterprise AI will not only depend on smarter models.&lt;/p&gt;

&lt;p&gt;It will depend on smarter data.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>data</category>
      <category>sql</category>
      <category>llm</category>
    </item>
    <item>
      <title>Why Enterprise AI Needs Data Semantics and Relationships</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Fri, 31 Jul 2026 18:06:00 +0000</pubDate>
      <link>https://dev.to/arisyndata/why-enterprise-ai-needs-data-semantics-and-relationships-31g7</link>
      <guid>https://dev.to/arisyndata/why-enterprise-ai-needs-data-semantics-and-relationships-31g7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqqmn71vfpc3idatcscnx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqqmn71vfpc3idatcscnx.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Large language models are becoming increasingly powerful.&lt;br&gt;
They can generate SQL, write code, summarize documents, and reason through complex tasks.&lt;br&gt;
However, when enterprises try to deploy AI systems in production, a common problem appears:&lt;br&gt;
AI can access the data.&lt;br&gt;
But it does not always understand the data.&lt;br&gt;
This is where many enterprise AI projects struggle.&lt;br&gt;
The problem is not only model capability.&lt;br&gt;
It is the missing context behind enterprise data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## The Difference Between Data Access and Data Understanding&lt;/strong&gt;&lt;br&gt;
Modern data platforms are excellent at storing and processing information.&lt;br&gt;
They provide:&lt;br&gt;
databases;&lt;br&gt;
data warehouses;&lt;br&gt;
data lakes;&lt;br&gt;
metadata catalogs;&lt;br&gt;
BI systems.&lt;br&gt;
From a technical perspective, AI can retrieve:&lt;br&gt;
table names;&lt;br&gt;
column names;&lt;br&gt;
data types;&lt;br&gt;
sample values.&lt;br&gt;
But enterprise questions are rarely only technical questions.&lt;br&gt;
For example:&lt;br&gt;
What are our top customers this year?&lt;br&gt;
A database can show customer-related tables.&lt;br&gt;
But AI still needs to understand:&lt;br&gt;
Which customer definition should be used?&lt;br&gt;
Which system is the authoritative source?&lt;br&gt;
Does customer mean account, buyer, or contract owner?&lt;br&gt;
The missing information is not stored data.&lt;br&gt;
It is business meaning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Data Semantics: Teaching AI What Data Means&lt;/strong&gt;&lt;br&gt;
One of the biggest challenges in enterprise AI is that business concepts are often ambiguous.&lt;br&gt;
Consider the word:&lt;br&gt;
Revenue&lt;br&gt;
An enterprise may have:&lt;br&gt;
sales_amount&lt;br&gt;
invoice_amount&lt;br&gt;
payment_amount&lt;br&gt;
contract_value&lt;br&gt;
All of these contain financial information.&lt;br&gt;
But they represent different business concepts.&lt;br&gt;
A financial analyst understands the difference.&lt;br&gt;
An AI system does not automatically know.&lt;br&gt;
Without semantic understanding, AI may generate a technically valid answer that is still wrong from a business perspective.&lt;br&gt;
The SQL executes successfully.&lt;br&gt;
The business decision fails.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Data Relationships: The Hidden Complexity Behind Enterprise Data&lt;br&gt;
Enterprise data rarely exists in isolation.&lt;/strong&gt;&lt;br&gt;
A simple business process may involve:&lt;br&gt;
Customer&lt;br&gt;
↓&lt;br&gt;
Order&lt;br&gt;
↓&lt;br&gt;
Invoice&lt;br&gt;
↓&lt;br&gt;
Payment&lt;br&gt;
But real enterprise environments are much more complicated.&lt;br&gt;
Organizations often have:&lt;br&gt;
multiple customer tables;&lt;br&gt;
different identifiers;&lt;br&gt;
duplicated entities;&lt;br&gt;
historical schemas;&lt;br&gt;
disconnected applications.&lt;br&gt;
Technically, many joins are possible.&lt;br&gt;
Business-wise, only some relationships are meaningful.&lt;br&gt;
This creates an important distinction:&lt;br&gt;
A possible relationship is not always a trusted relationship.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Why LLMs Cannot Solve This Automatically&lt;/strong&gt;&lt;br&gt;
A common assumption is:&lt;br&gt;
"If the model becomes smarter, it will understand enterprise data."&lt;br&gt;
But intelligence does not replace missing information.&lt;br&gt;
A powerful LLM can reason about:&lt;br&gt;
A → B → C&lt;br&gt;
But it still needs to know:&lt;br&gt;
What is A?&lt;br&gt;
What does B represent?&lt;br&gt;
Is this relationship valid?&lt;br&gt;
If enterprise knowledge is not explicitly represented, the model has to guess.&lt;br&gt;
And guessing creates unreliable AI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Building More Reliable Enterprise AI&lt;/strong&gt;&lt;br&gt;
Future enterprise AI systems need more than better models.&lt;br&gt;
They need a stronger connection between AI and enterprise knowledge.&lt;br&gt;
This requires three important capabilities.&lt;br&gt;
&lt;strong&gt;### 1. Business Entity Understanding&lt;/strong&gt;&lt;br&gt;
AI needs to understand core business objects:&lt;br&gt;
customers;&lt;br&gt;
products;&lt;br&gt;
suppliers;&lt;br&gt;
contracts;&lt;br&gt;
projects.&lt;br&gt;
Not only as database tables.&lt;br&gt;
As business entities.&lt;br&gt;
&lt;strong&gt;### 2. Trusted Relationship Understanding&lt;/strong&gt;&lt;br&gt;
AI needs to understand how entities connect.&lt;br&gt;
Not every foreign key or possible join represents business logic.&lt;br&gt;
The system needs to identify trusted paths between data.&lt;br&gt;
&lt;strong&gt;### 3. Business Semantic Understanding &lt;/strong&gt;&lt;br&gt;
AI needs to understand business definitions.&lt;br&gt;
Metrics.&lt;br&gt;
Terms.&lt;br&gt;
Rules.&lt;br&gt;
Context.&lt;br&gt;
Because the same field name can mean different things in different organizations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## The Next Evolution of Enterprise Data Architecture&lt;/strong&gt;&lt;br&gt;
Traditional data platforms answered:&lt;br&gt;
Where is the data?&lt;br&gt;
AI requires a different answer:&lt;br&gt;
What does this data mean?&lt;br&gt;
How is it connected?&lt;br&gt;
Can we trust it?&lt;br&gt;
The future enterprise data stack will not replace databases or warehouses.&lt;br&gt;
Instead, it will add a layer that makes enterprise knowledge understandable to AI systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Final Thoughts&lt;/strong&gt;&lt;br&gt;
The next challenge in enterprise AI is not only building smarter models.&lt;br&gt;
It is reducing the amount of guessing AI has to do.&lt;br&gt;
Data semantics help AI understand meaning.&lt;br&gt;
Data relationships help AI understand connections.&lt;br&gt;
Together, they provide the missing context required for reliable enterprise AI.&lt;br&gt;
Because AI does not only need access to enterprise data.&lt;br&gt;
It needs to understand the business behind it.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>I Didn't Break Enterprise Data Models. It Exposed Their Blind Spots.</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Wed, 29 Jul 2026 06:19:24 +0000</pubDate>
      <link>https://dev.to/arisyndata/i-didnt-break-enterprise-data-models-it-exposed-their-blind-spots-1i3b</link>
      <guid>https://dev.to/arisyndata/i-didnt-break-enterprise-data-models-it-exposed-their-blind-spots-1i3b</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8uyoxf5bvx7avlfu7v0t.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8uyoxf5bvx7avlfu7v0t.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Over the past few years, I've worked with several enterprise AI projects, especially those involving natural language querying and AI-powered analytics.&lt;/p&gt;

&lt;p&gt;One pattern keeps showing up.&lt;/p&gt;

&lt;p&gt;When an AI system returns the wrong answer, people usually blame the model.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Maybe we need a larger LLM."&lt;/p&gt;

&lt;p&gt;"Maybe the prompt needs more context."&lt;/p&gt;

&lt;p&gt;"Maybe SQL generation isn't mature enough."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After digging into these projects, I came to a different conclusion.&lt;/p&gt;

&lt;p&gt;In many cases, the model isn't the real problem.&lt;/p&gt;

&lt;p&gt;The enterprise data model is.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Enterprise Data Models Were Never Designed for AI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For decades, enterprise databases have been optimized for applications.&lt;/p&gt;

&lt;p&gt;Normalization reduces redundancy.&lt;/p&gt;

&lt;p&gt;Indexes improve query performance.&lt;/p&gt;

&lt;p&gt;Foreign keys maintain integrity.&lt;/p&gt;

&lt;p&gt;Data warehouses organize information for reporting.&lt;/p&gt;

&lt;p&gt;Everything makes sense because applications already know how the business works.&lt;/p&gt;

&lt;p&gt;Business logic lives in source code, service layers, stored procedures, ETL pipelines, and developers' experience—not necessarily in the database itself.&lt;/p&gt;

&lt;p&gt;Applications don't need the database to explain what a "customer" is.&lt;/p&gt;

&lt;p&gt;Developers already know.&lt;/p&gt;

&lt;p&gt;AI doesn't.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Schema Describes Structure, Not Meaning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most AI systems start by reading metadata.&lt;/p&gt;

&lt;p&gt;They can discover tables.&lt;/p&gt;

&lt;p&gt;Columns.&lt;/p&gt;

&lt;p&gt;Primary keys.&lt;/p&gt;

&lt;p&gt;Sometimes foreign keys.&lt;/p&gt;

&lt;p&gt;But metadata only tells AI how data is stored.&lt;/p&gt;

&lt;p&gt;It doesn't explain what the data actually represents.&lt;/p&gt;

&lt;p&gt;For example, imagine an enterprise with three different systems.&lt;/p&gt;

&lt;p&gt;CRM stores customers.&lt;/p&gt;

&lt;p&gt;ERP stores accounts.&lt;/p&gt;

&lt;p&gt;The finance system stores billing entities.&lt;/p&gt;

&lt;p&gt;To employees, these often represent the same business entity viewed from different business processes.&lt;/p&gt;

&lt;p&gt;To AI, they are simply three unrelated tables.&lt;/p&gt;

&lt;p&gt;Without additional business knowledge, every SQL statement becomes an educated guess.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The Hardest Problem Isn't Writing SQL&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modern language models are surprisingly good at generating SQL.&lt;/p&gt;

&lt;p&gt;Syntax errors have become much less common.&lt;/p&gt;

&lt;p&gt;The bigger challenge appears earlier.&lt;/p&gt;

&lt;p&gt;Before generating SQL, AI must answer questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which customer table should I use?&lt;/li&gt;
&lt;li&gt;Which data source is considered authoritative?&lt;/li&gt;
&lt;li&gt;Are these two entities actually the same customer?&lt;/li&gt;
&lt;li&gt;Which relationship reflects real business rules?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These aren't SQL problems.&lt;/p&gt;

&lt;p&gt;They're knowledge problems.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Business Knowledge Lives Outside the Database&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One thing I find interesting is that enterprise knowledge is rarely stored where AI can access it.&lt;/p&gt;

&lt;p&gt;Developers understand join paths.&lt;/p&gt;

&lt;p&gt;Business analysts understand metric definitions.&lt;/p&gt;

&lt;p&gt;Database administrators understand physical schemas.&lt;/p&gt;

&lt;p&gt;Domain experts understand the business process.&lt;/p&gt;

&lt;p&gt;Each group holds part of the knowledge.&lt;/p&gt;

&lt;p&gt;Very little of it is represented explicitly in the data model itself.&lt;/p&gt;

&lt;p&gt;Humans bridge these gaps naturally.&lt;/p&gt;

&lt;p&gt;AI cannot.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;AI Has Become a New Consumer of Enterprise Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is probably the biggest architectural change we're seeing.&lt;/p&gt;

&lt;p&gt;For years, applications were the only consumers of enterprise databases.&lt;/p&gt;

&lt;p&gt;Now AI is becoming another consumer.&lt;/p&gt;

&lt;p&gt;Unlike applications, AI doesn't read source code.&lt;/p&gt;

&lt;p&gt;It doesn't attend design meetings.&lt;/p&gt;

&lt;p&gt;It doesn't ask senior developers which table is "correct."&lt;/p&gt;

&lt;p&gt;It only sees what the enterprise has documented.&lt;/p&gt;

&lt;p&gt;And many enterprises have documented far less than they assumed.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The Future Isn't About Bigger Models&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Large language models will continue to improve.&lt;/p&gt;

&lt;p&gt;They'll write better SQL.&lt;/p&gt;

&lt;p&gt;Reason more effectively.&lt;/p&gt;

&lt;p&gt;Handle longer contexts.&lt;/p&gt;

&lt;p&gt;But none of these improvements automatically provide business knowledge.&lt;/p&gt;

&lt;p&gt;If an enterprise hasn't clearly defined its business entities, trusted relationships, or business semantics, AI has no reliable foundation to reason from.&lt;/p&gt;

&lt;p&gt;The model can infer.&lt;/p&gt;

&lt;p&gt;It can estimate.&lt;/p&gt;

&lt;p&gt;It can guess.&lt;/p&gt;

&lt;p&gt;It cannot know.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I don't think AI is exposing weaknesses in language models.&lt;/p&gt;

&lt;p&gt;It's exposing weaknesses in enterprise data architecture.&lt;/p&gt;

&lt;p&gt;For years, our data models were built to support applications.&lt;/p&gt;

&lt;p&gt;Today, they also need to support AI.&lt;/p&gt;

&lt;p&gt;That doesn't necessarily mean redesigning every database.&lt;/p&gt;

&lt;p&gt;But it does mean making business entities, relationships, and business semantics far more explicit than they have been in the past.&lt;/p&gt;

&lt;p&gt;The smarter AI becomes, the more valuable well-structured enterprise knowledge will be.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>data</category>
      <category>sql</category>
      <category>llm</category>
    </item>
    <item>
      <title>Foreign Keys Aren't Enough: Why Enterprise AI Needs Relationship Discovery</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Mon, 27 Jul 2026 03:15:19 +0000</pubDate>
      <link>https://dev.to/arisyndata/foreign-keys-arent-enough-why-enterprise-ai-needs-relationship-discovery-3jok</link>
      <guid>https://dev.to/arisyndata/foreign-keys-arent-enough-why-enterprise-ai-needs-relationship-discovery-3jok</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F229wefmg4aazub1m4av2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F229wefmg4aazub1m4av2.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Modern AI systems are surprisingly good at writing SQL.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Give an LLM a database schema, and it can often generate syntactically correct queries within seconds. With Retrieval-Augmented Generation (RAG), database metadata, and function calling, connecting AI to enterprise databases has become easier than ever.&lt;/p&gt;

&lt;p&gt;Yet many enterprise AI projects encounter the same problem after deployment:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The SQL executes successfully, but the answer is still wrong.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This isn't usually a model problem.&lt;/p&gt;

&lt;p&gt;It's a relationship problem.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The assumption most AI systems make&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most AI-powered database assistants follow roughly the same workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Question
      │
      ▼
Schema Retrieval
      │
      ▼
LLM Generates SQL
      │
      ▼
Database Execution
      │
      ▼
Answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This workflow assumes something important:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The schema contains enough information for AI to understand how data is connected.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Unfortunately, enterprise databases rarely work that way.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Real enterprise databases rarely have complete foreign keys&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In tutorials, relationships are simple.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
    │
    ▼
Order
    │
    ▼
Invoice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every relationship is explicitly defined.&lt;/p&gt;

&lt;p&gt;Every foreign key exists.&lt;/p&gt;

&lt;p&gt;Every table follows the same modeling standard.&lt;/p&gt;

&lt;p&gt;Production systems look very different.&lt;/p&gt;

&lt;p&gt;A company may have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an ERP system&lt;/li&gt;
&lt;li&gt;a CRM platform&lt;/li&gt;
&lt;li&gt;a financial system&lt;/li&gt;
&lt;li&gt;a manufacturing system&lt;/li&gt;
&lt;li&gt;a data warehouse&lt;/li&gt;
&lt;li&gt;several legacy databases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each system was designed independently.&lt;/p&gt;

&lt;p&gt;Relationships frequently exist without database constraints.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the same customer appears under different identifiers&lt;/li&gt;
&lt;li&gt;order numbers are reused across systems&lt;/li&gt;
&lt;li&gt;warehouse codes connect operational databases&lt;/li&gt;
&lt;li&gt;contract IDs link finance and sales data&lt;/li&gt;
&lt;li&gt;relationships rely on business rules rather than foreign keys&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Applications understand these connections because developers encoded them years ago.&lt;/p&gt;

&lt;p&gt;The database itself often does not.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why column names are unreliable&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common strategy is to infer joins from matching field names.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;customer_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;appears in two tables.&lt;/p&gt;

&lt;p&gt;Therefore they must be related.&lt;/p&gt;

&lt;p&gt;Sometimes that's correct.&lt;/p&gt;

&lt;p&gt;Sometimes it's completely wrong.&lt;/p&gt;

&lt;p&gt;Likewise,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;customer_code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;account_number
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;may represent exactly the same business entity even though their names are different.&lt;/p&gt;

&lt;p&gt;Enterprise systems evolve over years.&lt;/p&gt;

&lt;p&gt;Naming conventions change.&lt;/p&gt;

&lt;p&gt;Systems are merged.&lt;/p&gt;

&lt;p&gt;Columns are duplicated.&lt;/p&gt;

&lt;p&gt;Temporary tables become permanent.&lt;/p&gt;

&lt;p&gt;Column names alone cannot describe the real data model.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Relationships exist inside the data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the biggest misconceptions is that relationships only exist in metadata.&lt;/p&gt;

&lt;p&gt;In reality, much stronger evidence often exists inside the data itself.&lt;/p&gt;

&lt;p&gt;Imagine two tables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Orders
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Neither contains a foreign key.&lt;/p&gt;

&lt;p&gt;However:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;every customer ID appearing in Orders also appears in Customers&lt;/li&gt;
&lt;li&gt;Customer IDs are unique in Customers&lt;/li&gt;
&lt;li&gt;the inclusion ratio remains stable over time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That combination provides strong evidence that the relationship is real.&lt;/p&gt;

&lt;p&gt;Similar signals include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;distinct value overlap&lt;/li&gt;
&lt;li&gt;inclusion ratios&lt;/li&gt;
&lt;li&gt;uniqueness&lt;/li&gt;
&lt;li&gt;composite key candidates&lt;/li&gt;
&lt;li&gt;relationship direction&lt;/li&gt;
&lt;li&gt;cardinality&lt;/li&gt;
&lt;li&gt;value distribution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unlike naming conventions, these signals come directly from the data.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Discovery is only the first step&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finding candidate relationships is valuable.&lt;/p&gt;

&lt;p&gt;Trusting them automatically is dangerous.&lt;/p&gt;

&lt;p&gt;Enterprise environments frequently contain multiple possible join paths.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
   │
Order
   │
Invoice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;may be valid.&lt;/p&gt;

&lt;p&gt;So may:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
   │
Contract
   │
Invoice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Technically, both queries execute.&lt;/p&gt;

&lt;p&gt;Only one answers the business question correctly.&lt;/p&gt;

&lt;p&gt;Relationship discovery should therefore be followed by relationship governance.&lt;/p&gt;

&lt;p&gt;Organizations need to know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which relationships were verified&lt;/li&gt;
&lt;li&gt;where they came from&lt;/li&gt;
&lt;li&gt;how reliable they are&lt;/li&gt;
&lt;li&gt;which scenarios they support&lt;/li&gt;
&lt;li&gt;which path should be preferred&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without that layer, AI still has to guess.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;AI needs a relationship layer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of discovering relationships every time SQL is generated, enterprises should treat relationship knowledge as reusable metadata.&lt;/p&gt;

&lt;p&gt;An effective relationship layer can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;detect implicit relationships across databases&lt;/li&gt;
&lt;li&gt;discover candidate joins from actual data&lt;/li&gt;
&lt;li&gt;measure confidence using statistical evidence&lt;/li&gt;
&lt;li&gt;preserve verified relationship paths&lt;/li&gt;
&lt;li&gt;expose trusted relationships to AI systems&lt;/li&gt;
&lt;li&gt;update relationship knowledge as data evolves&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once this layer exists, AI no longer starts from zero every time it answers a question.&lt;/p&gt;

&lt;p&gt;It starts with knowledge accumulated by the organization.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Beyond SQL generation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enterprise AI discussions often focus on better prompts, larger models, or more powerful agents.&lt;/p&gt;

&lt;p&gt;Those improvements certainly matter.&lt;/p&gt;

&lt;p&gt;But they cannot compensate for missing relationship knowledge.&lt;/p&gt;

&lt;p&gt;A model cannot reliably choose a relationship that has never been made visible.&lt;/p&gt;

&lt;p&gt;Better reasoning helps evaluate evidence.&lt;/p&gt;

&lt;p&gt;It cannot invent enterprise knowledge that the organization has never captured.&lt;/p&gt;

&lt;p&gt;As AI becomes a permanent part of enterprise software, relationship discovery is becoming more than a data engineering task.&lt;/p&gt;

&lt;p&gt;It is becoming part of the infrastructure that enables AI to understand how enterprise data actually fits together.&lt;/p&gt;

&lt;p&gt;Because in enterprise databases, the most important relationships often aren't missing.&lt;/p&gt;

&lt;p&gt;They're simply invisible.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>database</category>
      <category>data</category>
      <category>sql</category>
    </item>
    <item>
      <title>Designing a Production-Grade Text-to-SQL Pipeline</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Mon, 13 Jul 2026 07:21:21 +0000</pubDate>
      <link>https://dev.to/arisyndata/designing-a-production-grade-text-to-sql-pipeline-n50</link>
      <guid>https://dev.to/arisyndata/designing-a-production-grade-text-to-sql-pipeline-n50</guid>
      <description>&lt;p&gt;Text-to-SQL demos usually look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question → LLM → SQL → Result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi6vaomr9y2m74obaoq8j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi6vaomr9y2m74obaoq8j.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is fine for a controlled dataset.&lt;/p&gt;

&lt;p&gt;It is not enough for a production system.&lt;/p&gt;

&lt;p&gt;In a real warehouse, the model has to deal with duplicated concepts, undocumented joins, multiple date fields, inconsistent naming, and tables that were never designed for AI access.&lt;/p&gt;

&lt;p&gt;The hard part is not generating SQL.&lt;/p&gt;

&lt;p&gt;The hard part is building the context the model needs before generation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start with the question, not the schema&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Take a simple request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Show revenue by customer segment for last quarter.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A model can turn that into SQL quickly. But before it does, the system needs to answer a few basic questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which revenue definition should be used?&lt;/li&gt;
&lt;li&gt;Which date field represents the reporting period?&lt;/li&gt;
&lt;li&gt;Is customer segment current or historical?&lt;/li&gt;
&lt;li&gt;Which customer table is authoritative?&lt;/li&gt;
&lt;li&gt;Which join path avoids duplicating revenue?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those decisions should not be left to the model to guess.&lt;/p&gt;

&lt;p&gt;A better pipeline resolves them before SQL generation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A more realistic workflow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A production flow looks closer to this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Question
    ↓
Intent Parsing
    ↓
Semantic Mapping
    ↓
Metadata Retrieval
    ↓
Relationship Discovery
    ↓
Join Path Selection
    ↓
SQL Generation
    ↓
Validation
    ↓
Execution
    ↓
Explanation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each step has a separate job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Intent parsing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Extract the actual request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"metric"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"revenue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dimension"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"customer_segment"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"time_range"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"last_quarter"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is also where the system should detect ambiguity.&lt;/p&gt;

&lt;p&gt;For example, “revenue” may refer to booked, invoiced, recognized, or paid revenue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Semantic mapping&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Map the user’s language to governed business definitions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"metric"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"recognized_revenue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"formula"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SUM(invoice_line.recognized_amount)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"time_field"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"invoice_line.recognition_date"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prevents the model from choosing fields based only on similar names.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Metadata retrieval&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Retrieve only the relevant tables and columns.&lt;/p&gt;

&lt;p&gt;Passing the entire warehouse schema into the prompt usually creates more noise than value.&lt;/p&gt;

&lt;p&gt;The model should receive a narrow working set:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;customer
customer_segment_history
invoice
invoice_line
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Relationship discovery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is where many systems remain weak.&lt;/p&gt;

&lt;p&gt;Foreign keys are useful, but enterprise databases often have missing, incomplete, or misleading constraints.&lt;/p&gt;

&lt;p&gt;A relationship layer should provide more than table names. It should include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;source and target columns&lt;/li&gt;
&lt;li&gt;relationship direction&lt;/li&gt;
&lt;li&gt;cardinality&lt;/li&gt;
&lt;li&gt;confidence&lt;/li&gt;
&lt;li&gt;known fanout risk&lt;/li&gt;
&lt;li&gt;preferred usage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"from"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"invoice.customer_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"to"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"customer.customer_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"cardinality"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"many_to_one"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"confidence"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.98&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fanout_risk"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Join path selection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There may be several valid paths between the same business entities.&lt;/p&gt;

&lt;p&gt;The shortest path is not always the safest one.&lt;/p&gt;

&lt;p&gt;A good system should prefer a path that matches the query grain and metric definition, not just one that happens to connect the tables.&lt;/p&gt;

&lt;p&gt;For the revenue example, joining directly to a current customer table may produce a valid result but lose historical segment accuracy.&lt;/p&gt;

&lt;p&gt;The correct path may require a segment history table and an effective-date condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Validation has to be explicit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SQL execution is not validation.&lt;/p&gt;

&lt;p&gt;A query can run successfully and still return the wrong answer.&lt;/p&gt;

&lt;p&gt;At minimum, the validation stage should check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Are the selected tables approved for this metric?
- Does the join path match the required grain?
- Can the join duplicate fact rows?
- Are filters applied to the correct date field?
- Are permissions respected?
- Is the aggregation consistent with the metric definition?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some checks are static. Others require running a small test query.&lt;/p&gt;

&lt;p&gt;For example, a join can be tested for row multiplication before the final query is executed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;rows_before&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;invoice_line&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;distinct_rows&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;invoice_line&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt;
  &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;invoice_line&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If those numbers drift unexpectedly, the pipeline should stop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clarification is part of the system&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the most useful behaviors in Text-to-SQL is asking a question instead of generating one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Do you mean recognized revenue or invoiced revenue?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is not a failure.&lt;/p&gt;

&lt;p&gt;It is often the safest possible response.&lt;/p&gt;

&lt;p&gt;A production system should know when the available semantic or relationship context is not strong enough to proceed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep the reasoning visible&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The final response should include more than the result.&lt;/p&gt;

&lt;p&gt;A useful explanation might show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Metric: Recognized Revenue
Time Field: recognition_date
Tables Used: invoice_line, customer_segment_history
Join Path: invoice_line.customer_id → customer_segment_history.customer_id
Validation: No fanout detected
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That gives analysts a chance to review the logic and gives data teams something they can audit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The model is not the whole pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The LLM is still important. It can parse questions, generate SQL, explain results, and handle conversation.&lt;/p&gt;

&lt;p&gt;But production reliability comes from the surrounding system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Semantic context
+ Metadata
+ Trusted relationships
+ Validation
+ Governance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the difference between a query that looks reasonable and a query that can be trusted.&lt;/p&gt;

&lt;p&gt;At Arisyn, we split those responsibilities across two layers: Semora handles business semantics, query reasoning, SQL generation, validation, and explanation, while IntaLink provides the table and field relationship context needed to choose safer data paths.&lt;/p&gt;

&lt;p&gt;The SQL is generated near the end.&lt;/p&gt;

&lt;p&gt;Most of the real work happens before it.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>data</category>
      <category>llm</category>
      <category>sql</category>
    </item>
    <item>
      <title>Enterprise Databases Were Built for Applications, Not AI</title>
      <dc:creator>ArisynData</dc:creator>
      <pubDate>Fri, 10 Jul 2026 16:09:00 +0000</pubDate>
      <link>https://dev.to/arisyndata/enterprise-databases-were-built-for-applications-not-ai-4ocl</link>
      <guid>https://dev.to/arisyndata/enterprise-databases-were-built-for-applications-not-ai-4ocl</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F384nlgrddg2utmcqx8gf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F384nlgrddg2utmcqx8gf.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As engineers, we spend a lot of time talking about AI models.&lt;/p&gt;

&lt;p&gt;Which model generates better SQL?&lt;/p&gt;

&lt;p&gt;Which model reasons better?&lt;/p&gt;

&lt;p&gt;Which one has the largest context window?&lt;/p&gt;

&lt;p&gt;But after working with enterprise data, I've started to think we're looking in the wrong place.&lt;/p&gt;

&lt;p&gt;Most enterprise databases were never designed for AI.&lt;/p&gt;

&lt;p&gt;They were designed for applications.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Applications Know the Rules. AI Doesn't.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A business application already knows where everything is.&lt;/p&gt;

&lt;p&gt;If an order needs a customer record, the developer has already defined the relationship.&lt;/p&gt;

&lt;p&gt;If a dashboard needs revenue, someone has already decided which calculation to use.&lt;/p&gt;

&lt;p&gt;The application doesn't need to discover anything.&lt;/p&gt;

&lt;p&gt;AI does.&lt;/p&gt;

&lt;p&gt;When an LLM connects to an enterprise database, all it sees is hundreds of tables and thousands of columns.&lt;/p&gt;

&lt;p&gt;It has no idea:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which customer table is authoritative.&lt;/li&gt;
&lt;li&gt;Which tables are safe to join.&lt;/li&gt;
&lt;li&gt;Whether two IDs represent the same business entity.&lt;/li&gt;
&lt;li&gt;Which revenue definition the business actually uses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Generating SQL isn't the difficult part anymore.&lt;/p&gt;

&lt;p&gt;Choosing the right data is.&lt;/p&gt;




&lt;p&gt;*&lt;em&gt;## Schemas Describe Structure, Not Business Knowledge&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Even well-designed databases have this problem.&lt;/p&gt;

&lt;p&gt;A schema tells you that a table exists.&lt;/p&gt;

&lt;p&gt;It doesn't tell you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;why it exists,&lt;/li&gt;
&lt;li&gt;when it should be used,&lt;/li&gt;
&lt;li&gt;or whether another table has replaced it over time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The knowledge that engineers build up over years of maintaining a system rarely exists inside the database itself.&lt;/p&gt;

&lt;p&gt;It's stored in documentation, meeting notes, old dashboards—or simply in someone's head.&lt;/p&gt;

&lt;p&gt;That's exactly the information AI is missing.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Two Things Make Enterprise Data More Understandable&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In my experience, AI becomes much more reliable when two gaps are addressed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First, data relationships.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI needs to know how tables, fields, and business entities are connected—not just through foreign keys, but through relationships that have been verified across real enterprise systems. Discovering and validating those relationships is the foundation of platforms like &lt;strong&gt;Arisyn-IntaLink&lt;/strong&gt;. :contentReference[oaicite:0]{index=0}&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second, business semantics.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Even after the right data is found, AI still needs to understand what that data means. Shared metric definitions, business terminology, and governed semantic rules help ensure that "Revenue" or "Customer" means the same thing to everyone. That's exactly the role of a semantic layer such as &lt;strong&gt;Arisyn-Semora&lt;/strong&gt;. :contentReference[oaicite:1]{index=1}&lt;/p&gt;

&lt;p&gt;Relationships explain how data is connected.&lt;/p&gt;

&lt;p&gt;Semantics explain what the data means.&lt;/p&gt;

&lt;p&gt;AI needs both.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;## Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I don't think enterprise AI is limited by SQL generation anymore.&lt;/p&gt;

&lt;p&gt;The bigger challenge is helping AI understand enterprise data the way experienced engineers do.&lt;/p&gt;

&lt;p&gt;The better we capture relationships and business semantics, the less AI has to guess.&lt;/p&gt;

&lt;p&gt;And in enterprise systems, fewer guesses almost always lead to better decisions.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>data</category>
      <category>llm</category>
      <category>sql</category>
    </item>
  </channel>
</rss>
