Analytics · 数据分析
1. 介绍
1.1 背景
「用自然语言问数据」是智能体最容易展示、也最容易翻车的能力。业界有一个被广泛引用的判断:检索系统失败时什么也不返回,你会立刻察觉;问数系统失败时会返回一个数字,格式正确,还配了图表。
这句话道出了数据分析方向的根本风险:失败是体面且静默的。
从供给侧看,三大主流数据平台在 2026 年前后不约而同地把「语义层」作为可信 AI 问答的前提:
| 平台 | 语义层形态 | 路线特征 |
|---|---|---|
| Snowflake Cortex Analyst | YAML 定义的 semantic views(逻辑表、维度、事实、指标、关系、同义词、样例问题),以 verified queries 作持续评估与回归优化 | 「语义模型优先」;明确强调语义模型是提升 text-to-SQL 准确率的关键 |
| Databricks Genie / Genie Ontology | 持续更新的上下文图谱,统一指标定义、业务术语、查询与仪表盘资产之间的关系 | 把「智能体正确性」问题转写为「上下文是否权威、是否治理过、是否可持续更新」的上下文工程问题 |
| Microsoft Fabric Data Agent | 基于 Power BI 既有语义模型(度量值、关系、业务上下文),连接 OneLake,运行时按源类型分派 NL2SQL / NL2DAX / NL2KQL / 图查询 | 先与 Purview、RLS/CLS、组织级策略接稳,再做问答 |
三条不同技术路线收敛到同一个结论,本身就是对本方向核心命题的最好注解:问数的准确率问题,本质上是上下文工程问题。
1.2 定义
数据分析方向的 AI Harness,是指围绕指标口径、自助分析与商业智能问答,为智能体提供语义上下文装配、受控查询执行、口径漂移检测、越权防护与成本护栏的工程承载层。
它的产出物不是「一段能跑的 SQL」,而是一个与组织口径一致、权限合规、成本可控、可回归验证的答案。
边界澄清:
- 数据分析 Harness 不等于「把数据库接给大模型」。裸接会把口径、权限与成本三重风险同时引入。
- 数据分析 Harness 与数据工程(01-data)分工明确:数据工程负责把数据做成可信资产,数据分析负责让可信资产被正确消费。语义层是二者的交接面。
1.3 在 AI Harness 体系中的定位
图 1-1|数据分析 AI Harness 六层定位:核心在 L1 与 L5
数据来源:基于本文分析绘制的示意图。
| 层 | 侧重 | 数据分析方向的具体内容 |
|---|---|---|
| L1 上下文工程层 | ★★★★★ | schema linking 作为 RAG 问题(检索表与列,而非全量注入);语义层即「治理过的上下文」;指标口径与同义词 |
| L2 工具与执行层 | ★★★★ | 按源类型分派 NL2SQL / NL2DAX / NL2KQL;只读角色;查询沙箱与成本预估 |
| L3 编排与控制层 | ★★★ | 从单次问答扩展到多步分析(澄清 → 取数 → 校验 → 解释 → 下钻) |
| L4 记忆与状态层 | ★★★ | 查询历史、已验证查询集、用户偏好与口径上下文 |
| L5 评估与观测层 | ★★★★★ | 执行准确率(EX)+ 有效效率得分(VES)+ verified queries 回归集 + 口径漂移检测 |
| L6 治理与安全层 | ★★★★ | RLS/CLS 强制、越权防护、成本护栏、查询审计 |
核心在 L1 与 L5。
L1 是核心,因为本方向的输入不是文档而是结构极其庞大的 schema。企业库常含 1,000 列以上,全量注入不可行;正确做法是把 schema linking 当作检索问题处理——先检索相关的表与列,再装配上下文。语义层的价值正在于它把「哪些表和列是权威的」「这个指标该怎么算」这些原本散落的知识,变成了可被检索、可被治理、可持续更新的上下文。
L5 是核心,因为本方向恰好拥有最理想的评估条件:可执行 ground truth。SQL 结果集可以直接比对,已验证查询可以组成回归集,执行计划可以评估效率。这使得本方向成为 Harness 中「评估投入产出比」最高的方向之一。
瓶颈层:L1。 生产环境中绝大多数问数失败,不是模型不会写 SQL,而是模型拿到了错误的表、错误的口径,或者压根不知道组织内部「收入」指的是确认后收入还是下单金额。
1.4 价值与瓶颈
价值:
- 把口径从口头约定变成可执行资产:语义层一旦建立,指标定义就不再依赖口口相传。
- 降低自助分析的门槛:业务用户无需掌握 SQL,也无需等待数据团队排期。
- 评估可闭环:可执行 ground truth 使回归测试成为可能,这是其他方向羡慕的条件。
瓶颈:
- 企业悬崖:基准榜上的高准确率无法迁移到生产环境(详见 3.2)。
- 口径漂移:同一指标在不同报表、不同时间得到不同数字,且往往无人察觉。
- 越权可见:自然语言绕过了看板层既有的权限封装,可能暴露用户本不该看到的行与列。
- 成本爆炸:一次低效查询可以全表扫描掉整月预算。
2. 名词解释
| 术语 | 英文 / 缩写 | 释义 |
|---|---|---|
| 文本转 SQL | Text-to-SQL / NL2SQL | 把自然语言问题翻译为结构化查询语言的技术 |
| 语义层 | Semantic Layer | 集中定义指标、维度、粒度与关系,并对外提供一致口径的抽象层 |
| 语义视图 | Semantic View | 以声明式配置(如 YAML)描述逻辑表、维度、事实、指标与关系的对象 |
| 模式链接 | Schema Linking | 从大规模 schema 中检索与问题相关的表和列的过程,应作为检索问题处理 |
| 执行准确率 | Execution Accuracy, EX | 以生成 SQL 的执行结果集是否与标准答案一致计分,二值、无部分分 |
| 有效效率得分 | Valid Efficiency Score, VES | 在结果正确的前提下同时评估查询效率的指标;用于拦截「全表扫描换来的正确答案」 |
| 已验证查询 | Verified Queries | 经人工确认正确的问题-SQL 对,用作持续评估与回归优化的集合 |
| 语义回归集 | Semantic Regression Set | 关键指标的已验证查询集合,在语义层或模型变更时回归执行 |
| 口径漂移 | Metric Drift | 同一指标按非批准口径计算,导致与权威定义不一致 |
| 模式幻觉 | Schema Hallucination | 模型编造了不存在的表或字段 |
| 关联错误 | Join Error | 在错误的粒度或错误的键上做关联,导致结果偏大或偏小 |
| 越权可见 | Access Leakage | 用户通过自然语言问到了其权限之外的数据 |
| 成本爆炸 | Cost Explosion | 低效查询导致全表扫描,使计算成本失控 |
| 行级 / 列级安全 | RLS / CLS | 在数据库或平台层强制生效的行级与列级权限控制 |
| 干跑 | EXPLAIN Dry Run | 在不实际执行的前提下获取查询计划,用于语法校验与成本预估 |
| 上下文图谱 | Context Graph | 统一指标定义、业务术语与资产关系并持续更新的图谱,作为智能体上下文来源 |
| OLAP | Online Analytical Processing | 面向分析的多维数据处理方式,是 BI 的底层范式 |
| 数据产品 | Data Product | 有明确所有权、服务水平与消费者的可复用数据资产 |
| 黄金数据集 | Golden Dataset | 经权威确认、用于评估与回归的标准问题-答案集合 |
| 下钻 | Drill-down | 从汇总指标逐层深入到明细数据的分析动作 |
3. 案例
3.1 案例一:三大平台殊途同归——语义层是可信问答的前提
3.1.1 背景
早期的「AI 问数」普遍采用裸接路线:把 schema 塞进提示词,让模型直接写 SQL。这条路在演示环境表现良好,在生产环境频繁失效。其失效模式被归纳为五类:模式幻觉(编造列或表)、关联错误(在错误粒度上 join)、口径漂移(按非批准口径计算业务数字)、越权可见(看到不该看的数据)、成本爆炸(低效查询全表扫描)。
三大平台在 2026 年前后的产品演进,可以看作是对这五类失效的集体回应。
3.1.2 方案
| 平台 | 语义层设计 | 应对的失效模式 |
|---|---|---|
| Snowflake Cortex Analyst | 以 YAML 定义 semantic views,包含逻辑表、维度、事实、指标、关系、同义词与样例问题;以 verified queries 作持续评估与回归优化 | 模式幻觉、口径漂移 |
| Databricks Genie / Genie Ontology | 维护持续更新的上下文图谱,统一指标定义、业务术语、查询与仪表盘资产的关系;Genie Space 由分析师限定可用表、指标、业务定义与护栏 | 模式幻觉、口径漂移、越权可见 |
| Microsoft Fabric Data Agent | 复用 Power BI 既有语义模型(度量值、关系、业务上下文);连接 OneLake;先与 Purview、RLS/CLS、组织级策略接稳再开放问答;运行时按源类型分派 NL2SQL / NL2DAX / NL2KQL / 图查询 | 越权可见、口径漂移 |
三家的共同点值得强调:都把「先治理上下文、再做问答」作为前提。Microsoft Fabric 的做法尤为典型——先把权限与组织级策略接稳,再开放自然语言入口。
2026 年的新能力也延续了这一方向:Databricks 的 Genie One 可跨出单个 Genie Space、连接企业知识源,把结构化与非结构化合一,并自动从仪表盘、notebook 与既有管道学习并维护业务地图;Snowflake 把 Cortex Analyst 纳入 Snowflake Intelligence,扩展至非结构化数据的联合问答;Microsoft 报告 2026 年 Data Agent 工作负载的端到端响应时间最多降低 50%(该数据为厂商自报,标注 )。
3.1.3 效果
这一案例的效果不在于某个准确率数字,而在于行业共识的形成:
- Snowflake 方面曾公开表示,Cortex Analyst 是其设计并发布过的最困难的产品之一,难点不在写 SELECT,而在于答案是否尊重业务语义(收入确认规则、数据共享策略、客户层级)。
- Microsoft Fabric 方面则把数据碎片化称为 AI 表现的「毒药」。
两处表态指向同一结论:问数系统的正确性边界由上下文治理水平决定,而非由模型能力决定。这与 Harness 六层模型中 L1 的核心地位完全一致。
需要说明:上述表态均来自二手转述,标注 ;本案例未引用任何未公开的准确率或客户数数据。
3.2 案例二:企业悬崖——从基准榜到生产库的准确率断崖
3.2.1 背景
Text-to-SQL 是少数拥有成熟公开基准的方向。三个主流基准的定位差异极大:
| 基准 | 规模 | 特点 |
|---|---|---|
| Spider 1.0 | 10,181 问题 / 200 数据库 | 跨领域,覆盖多表 JOIN、GROUP BY、HAVING、嵌套子查询;以执行准确率 EX 计分;已趋于饱和 |
| BIRD | 12,751 问题-SQL 对 / 95 个真实数据库 / 37 个专业领域 | 加入脏数据、隐式业务逻辑与外部知识要求;同时给出人类基线 92.96% EX |
| Spider 2.0 | 632 个真实企业数据库用例 | 运行于 BigQuery / Snowflake / SQLite;数据库常含 1,000 列以上;多方言、多步骤工作流 |
3.2.2 方案
把不同系统在这三个基准上的表现并排放置,「企业悬崖」立刻显现(以下为截至 2026 年中的榜单状态,榜单数据变动频繁):
| 系统 | Spider 1.0 | BIRD | Spider 2.0 |
|---|---|---|---|
| 人类基线(BIRD) | — | 92.96% | — |
| GPT-4 系(DAIL-SQL / DIN-SQL) | 86~91% | — | — |
| AskData + GPT-4o(2025-12 提交) | — | 81.95% | — |
| Gemini-SQL2(2026-06 提交) | — | 80.04% | — |
| GPT-5.5-xhigh(2026-04 提交) | — | 72.55% | — |
| Snowflake Arctic-Text2SQL-R1-32B | 88.7% | 71.83% | 16.3% |
| GPT-4o(Spider 2.0 发布基线) | 86.6% | — | 10.1% |
| o1-preview + agent framework | — | — | 21.3% |
按查询复杂度分层,悬崖的形状更清晰:
| 复杂度 | 准确率区间 |
|---|---|
| 简单查找与过滤(单表 + WHERE / ORDER BY / LIMIT) | 93~97% |
| 聚合与 GROUP BY | 85~92% |
| Spider 1.0 分难度:easy | 95%+ |
| Spider 1.0 分难度:medium | 85~90% |
| Spider 1.0 分难度:hard | 72~80% |
| Spider 1.0 分难度:extra hard | 55~65% |
3.2.3 效果
这组数据给出的核心结论有三条:
- 同一系统在学术基准与真实企业库上的表现可差数十个百分点。GPT-4o 在 Spider 1.0 上 86.6%,在 Spider 2.0 上仅 10.1%;专用模型在 BIRD 上 71.83%,在 Spider 2.0-DK 上仅 16.3%。差距来自 schema 规模(1,000 列以上)、方言差异与多步骤工作流需求。
- 行业公认的「最大单一杠杆」是 schema linking——把检索表与列作为 RAG 问题处理,而非把整个 schema 一次性塞入提示词。
- 生产级落地需要四道门:schema linking 作为 RAG 问题;语义层预定义指标(有来源称可消除约 60% 的幻觉,该数字来源可信度低,标注 );三阶段查询校验(语法解析 → 针对目标方言的
EXPLAIN干跑 → 数据库角色级只读策略);深度防御护栏。
此外,评估指标不应只看 EX。应同时看 VES(有效效率得分)——业界对此的表述是:通过全表扫描返回正确行的查询,是等着发生的生产事故。
3.3 案例三:Ground truth 本身也会错——基准标注错误与措辞损失
3.3.1 背景
本方向拥有可执行 ground truth,这被视为优势。但一项发表于 CIDR 2026 的研究(University of Illinois,作者包括 Jin、Choi、Zhu、Kang)对基准本身提出了质疑:
- BIRD Mini-Dev 中 29.7%、Spider 2.0-Snow 中 25% 的问题被判定为歧义(例如两张表存在同名列,问题未说明指的是哪个诊断字段)。
- 带公开 gold query 的问题中,BIRD Mini-Dev 52.8%、Spider 2.0-Snow 66.1% 存在标注错误——用研究者的话说,「ground truth 错的比对的还多」。
- 用修正后的答案重跑五个领先智能体:CHESS 从 62% 升至 81%,从第 4 名跃升至第 1,原第 1 名跌至第 3。
- BIRD 维护方已于 2025-11 发布清洗后的开发集。
以上数据来自对 CIDR 2026 论文的二手转述,标注 ,建议核对原论文后引用。
另一个独立发现来自 BIRD 团队的 LiveSQLBench:同一批问题用「清晰表述」与「真人日常表述」两种方式提问,2025-09 的结果显示 Gemini-2.5-Pro 在 base-full 集上正常表述 35.67、口语化表述 28.67——同一 schema、同一数据,仅因措辞损失 7 个百分点。
3.3.2 方案
这两组发现对 Harness 设计有三点直接启示:
- 评估集本身必须被治理。ground truth 不是天然正确的,它需要与生产数据一样的版本管理、人工复核与定期清洗。BIRD 维护方发布清洗后开发集的做法,应当被每个内部评估集建设者复制。
- 歧义必须被显式处理。当问题存在多种合理解读时,正确行为是反问澄清,而不是任选一种。这是 L3 编排层需要支持的显式分支。
- 口语化输入需要归一化层。用户不会用基准里的规范表述提问。Harness 应在 L1 提供术语映射与问题改写能力,把口语化输入对齐到语义层中的规范术语。
3.3.3 效果
这组发现最重要的效果是破除对基准分数的迷信:
- 一个 80% 的榜单分数,可能建立在 50% 以上标注错误的 ground truth 之上;
- 一个在生产环境表现良好的系统,可能因为使用了非批准口径而在榜单上吃亏;
- 用户的真实提法会比基准提法低约 7 个百分点。
因此本方向的可行评估策略是:以内部已验证查询集为第一评估依据,以公开基准为参考而非目标。这与 4.2 节 DoD 中「语义回归集全通过」优先于「榜单分数」的设定一致。
4. 实践标准
4.1 AGENTS.md 规范
标准来源声明:以下为本文提出的数据分析方向 AGENTS.md 标准建议稿。截至目前不存在官方或行业公认标准原文,AGENTS.md 属社区约定而非标准。本建议稿继承数据科学组级 AGENTS.md 全部条款。
# AGENTS.md —— 数据分析(Analytics / BI)
> 继承数据科学组级 AGENTS.md 全部条款。本节为数据分析方向的收紧与扩展。
> 本文件为标准建议稿,业界尚无官方标准版本。
## 角色与边界
- 本 Agent 是**口径的执行者,不是口径的定义者**。
- 可以做:检索语义层与指标注册表、检索 schema、生成并执行只读查询、解释结果、指出歧义并反问。
- 不可以做:定义或修改指标口径、绕过 RLS/CLS、执行写操作、用非批准口径回答业务问题。
- 遇到语义层中不存在或存在冲突的指标定义:**停止并上报口径缺口**,禁止自行发明口径。
## 环境假设
- 存在语义层或指标注册表(semantic views / 度量值 / 指标字典),且可检索。
- 存在可解析的元数据:表、列、关系、数据分级、所有权人。
- 查询在只读角色下执行;RLS/CLS 在数据访问层强制生效。
- 存在成本可见性:可获取查询计划与扫描量预估。
- 存在已验证查询集 / 黄金数据集用于回归。
- 目标方言已知(Snowflake / BigQuery / PostgreSQL / DAX / KQL 等);未知时禁止生成查询。
## 上下文加载顺序(Context Budget)
1. 问题本身与用户身份(决定权限与可见范围)
2. **语义层中的指标定义与同义词**(涉及指标时必须,优先级高于 schema)
3. 经检索选中的表与列的 schema(**检索式 schema linking,禁止全量注入**)
4. 表间关系与 join 路径
5. 已验证查询集中与该问题最接近的范例
6. 数据剖析结果:行数、空值率、取值分布、基数
7. 历史查询与用户偏好
8. 领域知识与业务术语表
- 大 schema 必须走检索式 schema linking;一次装配的表数量应有上限。
- 语义层定义与模型记忆冲突时,**以语义层为准**。
## 工具契约
| 工具 | 用途 | 模式 | 约束 |
|---|---|---|---|
| 语义层 / 指标注册表 | 查询指标、维度、关系、同义词 | 只读 | 不得写入或修改定义 |
| 元数据服务 | 检索表与列、读取分级与所有权 | 只读 | 不得修改元数据 |
| 查询执行器 | 执行只读查询、获取结果 | 只读 | 只读角色;返回前按 RLS/CLS 过滤 |
| 查询计划器 | EXPLAIN 干跑、成本预估 | 只读 | 预估超阈值须中止并上报 |
| 已验证查询集 | 检索相似范例、触发回归 | 只读 | 不得修改标准答案 |
| 可视化 | 生成图表 | 读 + 生成 | 图表继承源数据分级 |
- 每个工具调用记录:时间、参数摘要、返回摘要、耗时、扫描量与成本。
- 查询结果在返回用户前必须经过权限过滤;**权限由系统强制,不由 Agent 判断**。
## 数据源契约
- 只允许使用语义层中已登记并授权的数据源。
- 每个指标引用必须标注:指标名、权威定义来源、版本或最近更新时间。
- 数据引用必须带版本:快照时间、分区或数据集版本号,四者至少其一。
- 涉及多个口径候选时,必须列出全部候选并说明差异,**不得静默择一**。
- 样本不等于总体:基于抽样的结论必须写明抽样方式与样本量。
## 任务执行流程(SOP)
1. **理解与对齐**:复述问题,识别所涉指标与维度,与语义层对齐术语。
2. **歧义检查**:检查问题是否存在多种合理解读(同名列、未指明的口径、未指明的粒度);存在则**反问澄清**,不自行假设。
3. **口径确认**:确认指标使用的是批准口径;语义层缺失则上报口径缺口。
4. **schema linking**:检索相关表与列,而非全量注入。
5. **查询构造**:按目标方言生成查询;优先复用已验证查询集中的范例。
6. **三阶段校验**:
- 语法解析:确认语句合法
- `EXPLAIN` 干跑:确认可执行并预估扫描量与成本
- 权限与只读策略:确认在只读角色下且未触碰越权对象
7. **执行**:在只读角色下执行;记录耗时、扫描量与成本。
8. **结果校验**:与已验证查询集或独立复算路径比对;检查量级合理性。
9. **解释与限定**:给出答案、口径说明、覆盖范围、不确定性与已知局限。
10. **归档**:有价值的问答对经验证后进入已验证查询集。
## 验证与证据要求
- 每条数值必须来自**执行结果**,禁止由模型凭记忆或估算生成。
- 必须执行三项校验:**语法解析 → EXPLAIN 干跑 → 权限与只读策略检查**。
- 关键指标必须与**已验证查询集**或**独立复算路径**比对,差值须说明。
- 除执行准确率外,必须评估**有效效率得分(VES)**:通过全表扫描返回正确结果的查询,视为不合格。
- 主动报告反例与不利数据,不得只呈现支持性结果。
- 结论分「已验证 / 部分验证 / 未验证」三档列出。
## 失败与升级策略
- 同类失败重试不超过 2 次;第 3 次改变策略或升级。
- **歧义问题**:反问澄清,提供候选解读供用户选择,禁止任选其一。
- **语义层缺失该指标**:停止回答,上报口径缺口并说明需要谁补定义。
- **权限不足**:明确告知无权限,禁止用代理字段或近似口径绕过。
- **成本超阈值**:中止执行,报告预估扫描量与成本,申请放量或缩小范围。
- **结果为零或为空**:先区分「真的没有数据」与「查询条件写错」,两者不得混报。
- **结果与直觉严重不符**:标注为部分验证,报告可能的口径差异,不得自行「修正」数字。
- 升级时携带:原始问题、候选口径、生成的查询、执行计划、失败点、建议下一步。
## 安全与合规红线
- 不得绕过、推测或代为申请 RLS/CLS 权限。
- 不得用近似字段、代理指标或非批准口径回答受限问题。
- 不得在未声明的情况下使用未登记的口径。
- 不得把受限数据写入低分级位置(缓存、日志、图表、导出文件)。
- 不得执行任何写操作。
- 不得隐瞒查询的成本、覆盖范围与已知局限。
- 涉及个人信息与敏感字段的查询,须确认用户具备相应权限后才可执行。
## 禁止事项
- 禁止把整个 warehouse schema 一次性注入上下文。
- 禁止在语义层缺失时自行发明指标口径。
- 禁止用「大概」「通常来说」替代具体数值与口径来源。
- 禁止跳过 `EXPLAIN` 干跑直接执行高成本查询。
- 禁止在未确认方言的情况下生成查询。
- 禁止把执行成功当作结果正确——执行成功只说明能跑,不说明算对了。
- 禁止跨方向复制通用模板;数据分析的口径治理要求与深度研究、HPC 有实质差异。
## 输出格式
- 答案先行 → 口径说明 → 证据(数据源 + 版本 + 查询 + 执行记录)→ 不确定性 → 建议。
- 数值带单位与口径说明;范围用「~」连接;百分比数值与 % 之间无空格。
- 涉及多口径候选时用表格列出:口径、定义、数值、差异原因。
- 每个答案必须包含覆盖范围(时间范围、数据范围、过滤条件)。
- 查询与配置使用带语言标记的代码块。
## 评估与自检
- [ ] 问题中的术语已与语义层对齐
- [ ] 歧义已检查;存在歧义时已反问澄清
- [ ] 使用的是批准口径,且已标注定义来源与版本
- [ ] schema 经检索式 linking 装配,未全量注入
- [ ] 三阶段校验(语法 / EXPLAIN 干跑 / 权限只读)已全部执行
- [ ] 执行结果已与已验证查询集或独立复算比对
- [ ] 已评估有效效率得分,非全表扫描换来的正确结果
- [ ] 权限过滤已生效,未发生越权可见
- [ ] 成本在阈值内,或已上报
- [ ] 覆盖范围、局限与不确定性已声明 4.2 SKILL.md 规范
标准来源声明:以下为本文提出的数据分析方向 SKILL.md 标准建议稿,同样不存在官方标准原文。
---
name: metric-qa-and-analysis
description: 指标问答与自助分析的标准执行流程与验收基线。适用于自然语言问数、指标口径核对、多步下钻分析、口径漂移检测与已验证查询集建设。触发场景:任何需要基于企业数据用自然语言回答业务数字的任务。
version: 1.0
created: 2026-09-12
---
# 指标问答与自助分析标准流程
## 适用场景
- 业务用户用自然语言询问指标数值、趋势与构成。
- 指标口径核对与差异解释(两个报表数字不一致时定位原因)。
- 多步分析:澄清 → 取数 → 校验 → 解释 → 下钻。
- 口径漂移检测与已验证查询集建设。
- 不适用场景:需要写操作的数据处理、无语义层且无指标字典的裸库问答(应先补语义层)。
## 前置条件
- 语义层或指标注册表可用且可检索。
- 元数据可用:表、列、关系、分级、所有权人。
- 只读数据库角色已配置,RLS/CLS 已生效。
- 目标查询方言已知。
- 成本可见:可获取 EXPLAIN 与扫描量预估。
- 已验证查询集存在(可为空集,但需有建设路径)。
## 输入
| 输入项 | 必需 | 说明 |
|---|---|---|
| 自然语言问题 | 是 | 用户的原始提问,含其惯用措辞 |
| 用户身份与权限上下文 | 是 | 决定可见行与可见列 |
| 语义层 / 指标定义 | 是 | 指标的权威定义、维度、粒度 |
| 目标方言 | 是 | Snowflake / BigQuery / PostgreSQL / DAX / KQL 等 |
| 成本阈值 | 是 | 单次查询可接受的最大扫描量或费用 |
| 时间范围默认值 | 否 | 用户未指定时使用的默认窗口 |
## 输出
| 输出项 | 必需 | 说明 |
|---|---|---|
| 答案 | 是 | 数值 + 单位 + 口径 + 覆盖范围 |
| 口径说明 | 是 | 使用的指标定义、来源与版本 |
| 查询 | 是 | 实际执行的语句,可复现 |
| 验证结果 | 是 | 与已验证查询集或独立复算的比对结果 |
| 效率评估 | 是 | 扫描量与有效效率评估结论 |
| 不确定性 | 是 | 歧义、局限、已知口径差异 |
## 执行步骤
1. **术语对齐**
把用户措辞映射到语义层中的规范术语与同义词;口语化表述须显式归一化;无法映射的术语进入待澄清清单。
2. **歧义检测**
检查同名列、未指明的口径、未指明的粒度与时间范围;存在多解时生成候选解读并向用户确认。
3. **口径确认**
在语义层中定位指标的权威定义;缺失则停止并上报口径缺口,禁止自行定义。
4. **schema linking**
基于已对齐的术语检索相关表与列;限制装配数量;优先使用语义层声明的关系路径。
5. **范例检索**
在已验证查询集中检索最相近的范例;命中则优先复用并按需微调。
6. **查询构造与三阶段校验**
按方言生成查询;依次执行语法解析、`EXPLAIN` 干跑(获取扫描量与成本)、权限与只读策略检查;任一阶段不通过则停止。
7. **执行与取数**
在只读角色下执行;记录耗时、扫描量与成本;结果按权限过滤后返回。
8. **结果校验**
与已验证查询集或独立复算路径比对;检查量级是否合理;检查是否命中已知口径差异。
9. **效率评估**
评估有效效率得分;若正确答案依赖全表扫描,标记为待优化,不得视为合格交付。
10. **解释与归档**
输出答案、口径、覆盖范围、不确定性与建议;有价值的问答对经验证后进入已验证查询集;记录本次成本。
## 质量标准(DoD)
口径与语义:
- [ ] 使用的指标定义来自语义层,且已标注来源与版本
- [ ] 用户措辞已映射到规范术语,映射关系已记录
- [ ] 全部歧义已澄清或已列为不确定性
- [ ] 多口径候选已用表格列出,未静默择一
正确性:
- [ ] 三阶段校验全部通过
- [ ] 结果与已验证查询集或独立复算一致,差值已说明
- [ ] 量级合理性已人工或规则检查
- [ ] 结论分为已验证 / 部分验证 / 未验证三档
效率与成本:
- [ ] 已评估有效效率得分,非全表扫描换来的正确结果
- [ ] 扫描量与成本在阈值内,或已上报获批
治理:
- [ ] RLS/CLS 已生效,无越权可见
- [ ] 查询在只读角色下执行
- [ ] 输出物继承源数据分级,未泄漏受限内容
- [ ] 覆盖范围与局限性已声明
## 常见失败与处理
| 失败现象 | 根因 | 处理方式 |
|---|---|---|
| 模型引用了不存在的字段 | 全量注入 schema 或缺少 schema linking | 改为检索式 schema linking;装配前校验字段存在性 |
| 数字比预期大很多 | 在错误粒度上 join 导致扇出 | 校验关联键唯一性;改用语义层声明的关系路径 |
| 两个报表口径不一致 | 使用了非批准口径 | 列出两个口径的定义与差异,交所有权人裁定 |
| 用户看到了不该看的行 | RLS 未生效或被绕过 | 立即停止;权限由数据访问层强制,不得靠提示词约束 |
| 查询跑了几分钟还没完 | 未做 EXPLAIN 干跑与成本预估 | 中止;加分区过滤与聚合下推;设置扫描量上限 |
| 同一问题两次答案不同 | 数据未定版或时间窗口未固定 | 固定时间范围与数据版本;使用快照 |
| 回答了但用户说「不是这个口径」 | 术语映射错误 | 回到术语对齐步骤;把正确映射补充进同义词表 |
| 结果为空 | 条件过严或数据缺失 | 先区分「真的没有」与「条件写错」,分别报告 |
| 榜单分数高但生产表现差 | 基准与生产分布不一致 | 以内部已验证查询集为第一评估依据,公开基准仅作参考 |
## 示例
**任务**:业务用户问「上个月华东区的新客收入是多少」。
1. 术语对齐:「上个月」→ 上一个自然月(非滚动 30 天,需确认);「华东区」→ 语义层中的 `region = 'East China'`;「新客」→ 语义层中 `is_new_customer` 口径(定义为首次成交在当前自然月内的客户);「收入」→ 语义层中 `net_revenue`(**已确认收入,非下单金额**)。
2. 歧义检测:「上个月」存在自然月与滚动 30 天两种解读;「新客」存在首次注册与首次成交两种口径 → 生成候选解读向用户确认。
3. 口径确认:语义层中 `net_revenue` 定义明确,来源为指标注册表 v2026-08。
4. schema linking:检索到 `fct_orders`、`dim_customer`、`dim_region` 三张表及所需列,未全量注入。
5. 范例检索:已验证查询集中存在「分大区月度净收入」范例,复用其关系路径。
6. 三阶段校验:语法通过;`EXPLAIN` 预估扫描 12 GB,低于阈值;只读角色确认。
7. 执行:返回净收入数值,记录耗时与扫描量。
8. 结果校验:与「分大区月度净收入」范例中华东区上月数值比对,一致。
9. 效率评估:命中分区裁剪,有效效率得分合格。
10. 输出:答案 + 口径说明(已确认收入 / 首次成交口径 / 自然月)+ 覆盖范围 + 不确定性(若用户本意是滚动 30 天,数值会不同)+ 建议把该问答对加入已验证查询集。 4.3 落地检查清单
4.3.1 上下文层(L1)
- [ ] 语义层 / 指标注册表已建立,指标定义、维度、粒度、同义词齐全
- [ ] 支持检索式 schema linking,限制单次装配的表与列数量
- [ ] 业务术语与口语化表述到规范术语的映射表可用
- [ ] 已验证查询集可被检索并作为范例复用
- [ ] 数据剖析结果(基数、取值分布、空值率)可注入上下文
4.3.2 工具与执行层(L2)
- [ ] 查询在只读角色下执行
- [ ] 按源类型正确分派 NL2SQL / NL2DAX / NL2KQL
- [ ] 提供 EXPLAIN 干跑与扫描量预估能力
- [ ] 工具参数有模式校验
- [ ] 每次查询记录耗时、扫描量与成本
4.3.3 编排与控制层(L3)
- [ ] 支持歧义分支:存在多解时反问澄清,不自行假设
- [ ] 支持多步分析:澄清 → 取数 → 校验 → 解释 → 下钻
- [ ] 口径缺口有明确的上报与升级路径
- [ ] 重试策略明确,同类失败不超过 2 次
4.3.4 记忆与状态层(L4)
- [ ] 查询历史与用户偏好可查
- [ ] 有价值的问答对可沉淀进已验证查询集
- [ ] 术语映射的纠错结果可回流到同义词表
- [ ] 数据快照与版本可追溯
4.3.5 评估与观测层(L5)
- [ ] 已验证查询集 / 黄金数据集已建立,覆盖关键指标
- [ ] 每次语义层或模型变更触发回归执行
- [ ] 同时评估执行准确率(EX)与有效效率得分(VES)
- [ ] 口径漂移检测已上线(同一指标多路径比对)
- [ ] 评估集本身有版本管理与定期清洗机制
- [ ] 内部评估优先于公开基准,公开基准仅作参考
4.3.6 治理与安全层(L6)
- [ ] RLS / CLS 在数据访问层强制生效,不依赖提示词
- [ ] 越权查询有拦截与审计记录
- [ ] 单次查询成本阈值已设置并可中止
- [ ] 输出物(缓存、日志、图表、导出)继承源数据分级
- [ ] 指标口径变更须经所有权人确认并留痕
5. 总结
数据分析方向拥有 AI Harness 最理想的条件,也面对最体面的失败。
最理想的条件是它拥有可执行 ground truth:SQL 结果集可以比对,已验证查询可以回归,执行计划可以评估效率。这使得本方向成为「评估投入产出比」最高的方向之一——每一次评估层的投入都能直接换算成准确率的提升与事故的减少。
最体面的失败是它出错时返回一个格式正确、配了图表的数字。检索系统失败时什么也不返回,你会察觉;问数系统失败时会给你一个数字。
贯穿本方向的三条主线是:
- 上下文治理决定正确性上限。三大平台殊途同归地把语义层置于问答之前,本质上是在承认:问数问题首先是上下文工程问题。企业库常含 1,000 列以上,全量注入不可行,schema linking 必须作为检索问题处理。
- 基准分数不等于生产可用。Spider 1.0 上 86.6% 与 Spider 2.0 上 10.1% 的落差,就是企业悬崖的形状。更值得警惕的是,基准本身的 ground truth 也可能大面积标注错误——ground truth 需要被治理,正如数据需要被治理。
- 正确的执行不等于正确的答案。除了执行准确率,还必须看有效效率得分;除了结果正确,还必须确认口径是批准口径、权限是生效权限、成本在阈值之内。
一句话概括本方向的 Harness 主张:先把口径治理成可检索的上下文,再让模型去问答;先用已验证查询集验证,再让答案见人。
信息缺口声明
- 不存在数据分析方向 AGENTS.md / SKILL.md 的官方或行业公认标准原文。4.1 与 4.2 节均为本文提出的标准建议稿。
- 准确率榜单数据变动频繁,本文所有榜单数字均标注为「截至 2026 年中的榜单状态」,引用时应核对最新榜单。
- 以下数字来自二手转述,标注 :CIDR 2026 论文的 BIRD Mini-Dev 29.7% / Spider 2.0-Snow 25% 歧义比例、52.8% / 66.1% 标注错误率、CHESS 62% → 81% 的排名变化;建议核对原论文后引用。
- LiveSQLBench 的 35.67 / 28.67 对比来自二手转述,标注 ;「损失 7 个百分点」为该数据的直接差值,非独立统计结论。
- 「语义层可消除约 60% 的幻觉」来自可信度较低的来源,标注 ,本文不作为结论使用。
- Microsoft Fabric Data Agent 端到端响应时间最多降低 50% 为厂商自报数据,标注 。
- 平台定价信息(Databricks DBU 额度、Snowflake 免费包含、Fabric F2 档价格)为渠道方数据且变动频繁,本文未引用具体价格。
- 各平台的真实客户数、ARR 与内部基准自报准确率(如某厂商自报 text-to-SQL 从 32% 提升至 90%+)本次未获得可靠一手来源,本文未采用。
- Snowflake 与 Microsoft 相关负责人表态均来自二手转述,标注 。
- 4.2 节示例中的指标名、表名与参数均为示意性构造,不代表任何真实系统。
6. 参考资料
- Text-to-SQL Accuracy in 2026: The Performance Cliff Nobody Mentions(三大基准定位与准确率数据)— Onvo AI。https://www.onvo.ai/blog/text-to-sql-accuracy-in-2026-the-performance-cliff-nobody-mentions
- Natural Language to SQL Accuracy in 2026(按复杂度分层的准确率)— AI for Database。https://www.aifordatabase.com/blog/natural-language-sql-accuracy-2026
- Plausible Wrong Numbers(CIDR 2026 基准标注错误研究、LiveSQLBench 措辞损失)— Mantissa AI。https://www.mantissaai.com/blog/nl-to-sql-plausible-wrong-numbers
- Snowflake Arctic-Text2SQL-R1-32B 基准表现 — Awesome Agents。https://awesomeagents.ai/models/snowflake-arctic-text2sql-r1-32b
- Text-to-SQL LLM in Production: Schema Linking and Guardrails(四道门与 VES)— AI Workflow Lab。http://aiworkflowlab.dev/article/text-to-sql-llm-production-schema-linking-guardrails-2026
- Data Agent 架构综述:从架构到实践(三大平台语义层对比)— 技术分析博客。https://ibillxia.github.io/blog/2026/08/20/data-agent-servey-from-arch-to-practice
- Databricks Genie vs Snowflake Cortex Analyst vs Microsoft Fabric Data Agents — Agilytic。https://www.agilytic.com/blog/databricks-genie-cortex-analyst-fabric-data-agents
- Bad AI-generated SQL 的五类失败模式(分析框架来源)— Perplexity AI Magazine。https://perplexityaimagazine.com/?p=3450/
- DAMA 数据管理知识体系指南(数据仓库与商务智能知识领域)— DAMA International。https://www.longshidata.com/blog/c/c2026062301.html
- MCP 数据科学工作流工具生态(数据库类 MCP Server)— 技术指南。https://chatforest.com/guides/mcp-data-science-workflows
- OpenLineage 官方规范文档 — Linux Foundation。https://openlineage.io/
- ISO 8000 数据质量系列标准汇总 — ISO/TC 184/SC 4。https://quality.arc42.org/standards/iso-8000
Analytics · 数据分析
1. Introduction
1.1 Background
"Asking data in natural language" is the capability that agents are the easiest to demonstrate — and the easiest to get wrong. There is a widely cited observation in the industry: when a retrieval system fails, it returns nothing and you notice immediately; when a Q&A system fails, it returns a number — correctly formatted, accompanied by a chart.
This sentence captures the fundamental risk of the data analytics direction: failure is graceful and silent.
From the supply side, around 2026 the three major data platforms all independently made the "semantic layer" a prerequisite for trustworthy AI Q&A:
| Platform | Semantic Layer Form | Approach Characteristics |
|---|---|---|
| Snowflake Cortex Analyst | YAML-defined semantic views (logical tables, dimensions, facts, metrics, relationships, synonyms, sample questions), with verified queries for continuous evaluation and regression optimization | "Semantic-model-first"; explicitly emphasizes that the semantic model is key to improving text-to-SQL accuracy |
| Databricks Genie / Genie Ontology | A continuously updated context graph unifying the relationships among metric definitions, business terminology, queries, and dashboard assets | Reframes the "agent correctness" problem as a context-engineering problem: whether the context is authoritative, governed, and sustainably updated |
| Microsoft Fabric Data Agent | Built on Power BI's existing semantic model (measures, relationships, business context), connected to OneLake, dispatching NL2SQL / NL2DAX / NL2KQL / graph queries at runtime by source type | First integrates firmly with Purview, RLS/CLS, and organization-level policies, then handles Q&A |
Three different technical routes converging on the same conclusion is itself the best annotation of this direction's core proposition: the accuracy problem of Q&A is, in essence, a context-engineering problem.
1.2 Definition
The AI Harness for the data analytics direction is the engineering carrier layer that, around metric definitions, self-service analytics, and business-intelligence Q&A, provides agents with semantic-context assembly, controlled query execution, metric-drift detection, access-leakage protection, and cost guardrails.
Its output is not "a runnable piece of SQL" but an answer that is consistent with the organization's metric definitions, permission-compliant, cost-controlled, and verifiable by regression.
Boundary clarification:
- The data analytics Harness is not the same as "connecting a database to a large model." A raw connection introduces the triple risk of metric definitions, permissions, and cost all at once.
- The data analytics Harness and data engineering (01-data) have a clear division of labor: data engineering is responsible for turning data into trustworthy assets, and data analytics is responsible for ensuring trustworthy assets are correctly consumed. The semantic layer is the interface between the two.
1.3 Position in the AI Harness Architecture
图 1-1|数据分析 AI Harness 六层定位:核心在 L1 与 L5
数据来源:基于本文分析绘制的示意图。
| Layer | Emphasis | Specific Content for the Data Analytics Direction |
|---|---|---|
| L1 Context Engineering Layer | ★★★★★ | schema linking as a RAG problem (retrieving tables and columns rather than full injection); the semantic layer as "governed context"; metric definitions and synonyms |
| L2 Tool and Execution Layer | ★★★★ | dispatch to NL2SQL / NL2DAX / NL2KQL by source type; read-only roles; query sandboxing and cost estimation |
| L3 Orchestration and Control Layer | ★★★ | extend from single-shot Q&A to multi-step analysis (clarify → fetch data → validate → explain → drill down) |
| L4 Memory and State Layer | ★★★ | query history, verified queries set, user preferences, and metric context |
| L5 Evaluation and Observability Layer | ★★★★★ | execution accuracy (EX) + valid efficiency score (VES) + verified-queries regression set + metric-drift detection |
| L6 Governance and Security Layer | ★★★★ | RLS/CLS enforcement, access-leakage protection, cost guardrails, query audit |
The core lies in L1 and L5.
L1 is core because this direction's input is not documentation but an extremely large schema. Enterprise databases often contain more than 1,000 columns, making full injection infeasible; the correct approach is to treat schema linking as a retrieval problem — first retrieve the relevant tables and columns, then assemble the context. The value of the semantic layer is precisely that it turns knowledge that was scattered — "which tables and columns are authoritative" and "how this metric should be computed" — into context that can be retrieved, governed, and sustainably updated.
L5 is core because this direction happens to have the most ideal evaluation conditions: executable ground truth. SQL result sets can be compared directly, verified queries can form a regression set, and execution plans can be evaluated for efficiency. This makes the direction one of the highest in Harness in terms of "return on evaluation investment".
Bottleneck layer: L1. In production, the majority of Q&A failures are not because the model cannot write SQL, but because the model got the wrong tables, the wrong metric definitions, or simply has no idea whether the organization's "revenue" means recognized revenue or order amount.
1.4 Value and Bottlenecks
Value:
- Turn metric definitions from verbal agreements into executable assets: once the semantic layer is established, metric definitions no longer depend on word of mouth.
- Lower the barrier to self-service analytics: business users neither need to master SQL nor wait for the data team's schedule.
- Evaluation can be closed-loop: executable ground truth makes regression testing possible — a condition other directions envy.
Bottlenecks:
- The enterprise cliff: high accuracy on leaderboards cannot transfer to production environments (see 3.2).
- Metric drift: the same metric yields different numbers in different reports and at different times, and usually no one notices.
- Access leakage: natural language bypasses the permission encapsulation already present in the dashboard layer and can expose rows and columns a user should not see.
- Cost explosion: a single inefficient query can full-scan away an entire month's budget.
2. Glossary
| Term | English / Abbreviation | Definition |
|---|---|---|
| Text-to-SQL | Text-to-SQL / NL2SQL | The technique of translating natural-language questions into structured query language |
| Semantic layer | Semantic Layer | An abstraction layer that centrally defines metrics, dimensions, granularity, and relationships, and provides a consistent metric definition externally |
| Semantic view | Semantic View | An object describing logical tables, dimensions, facts, metrics, and relationships via declarative configuration (e.g., YAML) |
| Schema linking | Schema Linking | The process of retrieving the tables and columns relevant to a question from a large-scale schema; it should be treated as a retrieval problem |
| Execution accuracy | Execution Accuracy, EX | Scored by whether the result set of the generated SQL matches the standard answer; binary, with no partial credit |
| Valid efficiency score | Valid Efficiency Score, VES | A metric that also evaluates query efficiency on top of a correct result; used to intercept "correct answers obtained through full table scans" |
| Verified queries | Verified Queries | Question-SQL pairs manually confirmed as correct, used as a set for continuous evaluation and regression optimization |
| Semantic regression set | Semantic Regression Set | A set of verified queries for key metrics, executed by regression when the semantic layer or model changes |
| Metric drift | Metric Drift | Computing the same metric under a non-approved definition, causing inconsistency with the authoritative definition |
| Schema hallucination | Schema Hallucination | The model fabricates tables or fields that do not exist |
| Join error | Join Error | Joining at the wrong granularity or on the wrong key, causing results to be inflated or deflated |
| Access leakage | Access Leakage | A user obtains data beyond their permissions through natural language |
| Cost explosion | Cost Explosion | An inefficient query causes a full table scan, sending compute cost out of control |
| Row-level / column-level security | RLS / CLS | Row-level and column-level permission controls enforced at the database or platform layer |
| Dry run | EXPLAIN Dry Run | Obtaining a query plan without actually executing it, for syntax validation and cost estimation |
| Context graph | Context Graph | A continuously updated graph unifying metric definitions, business terminology, and asset relationships, serving as the agent's context source |
| OLAP | Online Analytical Processing | Multi-dimensional data processing oriented toward analysis; the underlying paradigm of BI |
| Data product | Data Product | A reusable data asset with clear ownership, service levels, and consumers |
| Golden dataset | Golden Dataset | A standard question-answer set confirmed authoritatively and used for evaluation and regression |
| Drill-down | Drill-down | The analysis action of descending from summary metrics layer by layer into detail data |
3. Case Studies
3.1 Case 1: Three Platforms, One Destination — The Semantic Layer Is the Prerequisite for Trustworthy Q&A
3.1.1 Background
Early "AI Q&A" generally followed the raw-connection route: stuffing the schema into the prompt and letting the model write SQL directly. This approach performed well in demos but failed frequently in production. Its failure modes are grouped into five categories: schema hallucination (fabricating columns or tables), join error (joining at the wrong granularity), metric drift (computing business numbers under a non-approved definition), access leakage (seeing data one should not see), and cost explosion (a full table scan from an inefficient query).
The product evolution of the three platforms around 2026 can be read as a collective response to these five failure modes.
3.1.2 Solution
| Platform | Semantic Layer Design | Failure Modes Addressed |
|---|---|---|
| Snowflake Cortex Analyst | Defines semantic views in YAML, including logical tables, dimensions, facts, metrics, relationships, synonyms, and sample questions; uses verified queries for continuous evaluation and regression optimization | Schema hallucination, metric drift |
| Databricks Genie / Genie Ontology | Maintains a continuously updated context graph unifying metric definitions, business terminology, and the relationships among queries and dashboard assets; Genie Space lets analysts limit the available tables, metrics, business definitions, and guardrails | Schema hallucination, metric drift, access leakage |
| Microsoft Fabric Data Agent | Reuses Power BI's existing semantic model (measures, relationships, business context); connects to OneLake; first integrates firmly with Purview, RLS/CLS, and organization-level policies before opening Q&A; dispatches NL2SQL / NL2DAX / NL2KQL / graph queries at runtime by source type | Access leakage, metric drift |
The commonality across the three is worth emphasizing: all treat "govern the context first, then handle Q&A" as a prerequisite. Microsoft Fabric's approach is especially typical — it secures permissions and organization-level policies first, and only then opens the natural-language entry point.
The new capabilities in 2026 also continue this direction: Databricks's Genie One can step beyond a single Genie Space, connect to enterprise knowledge sources, unify structured and unstructured data, and automatically learn and maintain a business map from dashboards, notebooks, and existing pipelines; Snowflake folds Cortex Analyst into Snowflake Intelligence, extending federated Q&A to unstructured data; Microsoft reports that Data Agent workloads' end-to-end response time fell by up to 50% in 2026 (self-reported vendor data, marked [To be verified]).
3.1.3 Results
The effect of this case lies not in some accuracy number, but in the formation of industry consensus:
- Snowflake has publicly stated that Cortex Analyst is one of the most difficult products it has designed and released; the difficulty is not in writing SELECT, but in whether the answer respects business semantics (revenue-recognition rules, data-sharing policies, customer hierarchies).
- Microsoft Fabric, for its part, calls data fragmentation the "poison" of AI performance.
Both statements point to the same conclusion: the correctness boundary of a Q&A system is determined by the level of context governance, not by model capability. This is fully consistent with the core position of L1 in the Harness six-layer model.
It should be noted: the above statements all come from secondhand accounts and are marked [To be verified]; this case does not cite any undisclosed accuracy or customer-count data.
3.2 Case 2: The Enterprise Cliff — The Accuracy Drop-off from Leaderboards to Production Databases
3.2.1 Background
Text-to-SQL is one of the few directions with mature public benchmarks. The positioning of the three mainstream benchmarks differs greatly:
| Benchmark | Scale | Features |
|---|---|---|
| Spider 1.0 | 10,181 questions / 200 databases | Cross-domain; covers multi-table JOIN, GROUP BY, HAVING, and nested subqueries; scored by execution accuracy EX; approaching saturation |
| BIRD | 12,751 question-SQL pairs / 95 real databases / 37 specialized domains | Adds dirty data, implicit business logic, and external-knowledge requirements; also provides a human baseline of 92.96% EX |
| Spider 2.0 | 632 real enterprise database cases | Runs on BigQuery / Snowflake / SQLite; databases often contain more than 1,000 columns; multi-dialect, multi-step workflows |
3.2.2 Solution
Placing the different systems' results on these three benchmarks side by side, the "enterprise cliff" becomes immediately visible (the following is the leaderboard status as of mid-2026; leaderboard data changes frequently):
| System | Spider 1.0 | BIRD | Spider 2.0 |
|---|---|---|---|
| Human baseline (BIRD) | — | 92.96% | — |
| GPT-4 family (DAIL-SQL / DIN-SQL) | 86~91% | — | — |
| AskData + GPT-4o (submitted 2025-12) | — | 81.95% | — |
| Gemini-SQL2 (submitted 2026-06) | — | 80.04% | — |
| GPT-5.5-xhigh (submitted 2026-04) | — | 72.55% | — |
| Snowflake Arctic-Text2SQL-R1-32B | 88.7% | 71.83% | 16.3% |
| GPT-4o (Spider 2.0 release baseline) | 86.6% | — | 10.1% |
| o1-preview + agent framework | — | — | 21.3% |
Broken down by query complexity, the shape of the cliff becomes clearer:
| Complexity | Accuracy Range |
|---|---|
| Simple lookup and filtering (single table + WHERE / ORDER BY / LIMIT) | 93~97% |
| Aggregation and GROUP BY | 85~92% |
| Spider 1.0 by difficulty: easy | 95%+ |
| Spider 1.0 by difficulty: medium | 85~90% |
| Spider 1.0 by difficulty: hard | 72~80% |
| Spider 1.0 by difficulty: extra hard | 55~65% |
3.2.3 Results
This data yields three core conclusions:
- The same system can differ by dozens of percentage points between academic benchmarks and real enterprise databases. GPT-4o scores 86.6% on Spider 1.0 but only 10.1% on Spider 2.0; a specialized model scores 71.83% on BIRD but only 16.3% on Spider 2.0-DK. The gap comes from schema scale (more than 1,000 columns), dialect differences, and multi-step workflow requirements.
- The industry's acknowledged "single biggest lever" is schema linking — treating table and column retrieval as a RAG problem rather than stuffing the entire schema into the prompt at once.
- Production-grade deployment needs four gates: schema linking as a RAG problem; predefined metrics in the semantic layer (some sources claim this can eliminate roughly 60% of hallucinations, but the figure's source credibility is low, marked
[To be verified]); three-stage query validation (syntax parsing →EXPLAINdry run against the target dialect → database role-level read-only policy); and defense-in-depth guardrails.
In addition, evaluation metrics should not look at EX alone. One must also look at VES (valid efficiency score) — as the industry puts it: a query that returns the correct rows through a full table scan is a production incident waiting to happen.
3.3 Case 3: Ground Truth Itself Can Be Wrong — Benchmark Annotation Errors and Wording Loss
3.3.1 Background
This direction has executable ground truth, which is viewed as an advantage. But a study published at CIDR 2026 (University of Illinois, authors including Jin, Choi, Zhu, and Kang) calls the benchmarks themselves into question:
- Of the questions in BIRD Mini-Dev, 29.7%, and in Spider 2.0-Snow, 25%, were judged ambiguous (for example, two tables share a column with the same name, and the question does not indicate which diagnostic field is meant).
- Among questions with a public gold query, 52.8% in BIRD Mini-Dev and 66.1% in Spider 2.0-Snow contain annotation errors — in the researchers' words, "there are more wrong ground truths than right ones."
- Rerunning the five leading agents with the corrected answers: CHESS rose from 62% to 81%, jumping from 4th to 1st place, while the original 1st place fell to 3rd.
- The BIRD maintainers released a cleaned development set in 2025-11.
The above data comes from a secondhand account of the CIDR 2026 paper, is marked [To be verified], and citation is advised only after checking the original paper.
Another independent finding comes from the BIRD team's LiveSQLBench: when the same batch of questions was posed in both "clear phrasing" and "how real people phrase it," the 2025-09 results showed Gemini-2.5-Pro scoring 35.67 with normal phrasing and 28.67 with colloquial phrasing on the base-full set — with the same schema and same data, wording alone cost 7 percentage points.
3.3.2 Solution
These two sets of findings yield three direct implications for Harness design:
- The evaluation set itself must be governed. Ground truth is not naturally correct; it needs the same version management, human review, and periodic cleaning as production data. The BIRD maintainers' practice of releasing a cleaned development set should be replicated by every builder of internal evaluation sets.
- Ambiguity must be handled explicitly. When a question admits multiple reasonable interpretations, the correct behavior is to ask a clarifying question, not to pick one arbitrarily. This is an explicit branch the L3 orchestration layer must support.
- Colloquial input needs a normalization layer. Users will not phrase questions the way benchmarks do. Harness should provide term-mapping and question-rewriting capabilities in L1 to align colloquial input with the canonical terms in the semantic layer.
3.3.3 Results
The most important effect of these findings is breaking the superstition about benchmark scores:
- An 80% leaderboard score may rest on ground truth with more than 50% annotation errors;
- A system that performs well in production may fare poorly on a leaderboard because it used a non-approved metric definition;
- Real user phrasings will score about 7 percentage points lower than benchmark phrasings.
Therefore the viable evaluation strategy for this direction is: use the internal verified queries set as the primary evaluation basis, and treat public benchmarks as reference rather than target. This is consistent with the Section 4.2 DoD setting in which "semantic regression set fully passing" takes precedence over "leaderboard score".
4. Practice Standards
4.1 AGENTS.md Specification
Standard source statement: the following is this document's proposed draft of an AGENTS.md standard for the data analytics direction. As of now there is no official or industry-recognized standard text; AGENTS.md is a community convention rather than a standard. This draft inherits all provisions of the data science group-level AGENTS.md.
# AGENTS.md —— 数据分析(Analytics / BI)
> 继承数据科学组级 AGENTS.md 全部条款。本节为数据分析方向的收紧与扩展。
> 本文件为标准建议稿,业界尚无官方标准版本。
## 角色与边界
- 本 Agent 是**口径的执行者,不是口径的定义者**。
- 可以做:检索语义层与指标注册表、检索 schema、生成并执行只读查询、解释结果、指出歧义并反问。
- 不可以做:定义或修改指标口径、绕过 RLS/CLS、执行写操作、用非批准口径回答业务问题。
- 遇到语义层中不存在或存在冲突的指标定义:**停止并上报口径缺口**,禁止自行发明口径。
## 环境假设
- 存在语义层或指标注册表(semantic views / 度量值 / 指标字典),且可检索。
- 存在可解析的元数据:表、列、关系、数据分级、所有权人。
- 查询在只读角色下执行;RLS/CLS 在数据访问层强制生效。
- 存在成本可见性:可获取查询计划与扫描量预估。
- 存在已验证查询集 / 黄金数据集用于回归。
- 目标方言已知(Snowflake / BigQuery / PostgreSQL / DAX / KQL 等);未知时禁止生成查询。
## 上下文加载顺序(Context Budget)
1. 问题本身与用户身份(决定权限与可见范围)
2. **语义层中的指标定义与同义词**(涉及指标时必须,优先级高于 schema)
3. 经检索选中的表与列的 schema(**检索式 schema linking,禁止全量注入**)
4. 表间关系与 join 路径
5. 已验证查询集中与该问题最接近的范例
6. 数据剖析结果:行数、空值率、取值分布、基数
7. 历史查询与用户偏好
8. 领域知识与业务术语表
- 大 schema 必须走检索式 schema linking;一次装配的表数量应有上限。
- 语义层定义与模型记忆冲突时,**以语义层为准**。
## 工具契约
| 工具 | 用途 | 模式 | 约束 |
|---|---|---|---|
| 语义层 / 指标注册表 | 查询指标、维度、关系、同义词 | 只读 | 不得写入或修改定义 |
| 元数据服务 | 检索表与列、读取分级与所有权 | 只读 | 不得修改元数据 |
| 查询执行器 | 执行只读查询、获取结果 | 只读 | 只读角色;返回前按 RLS/CLS 过滤 |
| 查询计划器 | EXPLAIN 干跑、成本预估 | 只读 | 预估超阈值须中止并上报 |
| 已验证查询集 | 检索相似范例、触发回归 | 只读 | 不得修改标准答案 |
| 可视化 | 生成图表 | 读 + 生成 | 图表继承源数据分级 |
- 每个工具调用记录:时间、参数摘要、返回摘要、耗时、扫描量与成本。
- 查询结果在返回用户前必须经过权限过滤;**权限由系统强制,不由 Agent 判断**。
## 数据源契约
- 只允许使用语义层中已登记并授权的数据源。
- 每个指标引用必须标注:指标名、权威定义来源、版本或最近更新时间。
- 数据引用必须带版本:快照时间、分区或数据集版本号,四者至少其一。
- 涉及多个口径候选时,必须列出全部候选并说明差异,**不得静默择一**。
- 样本不等于总体:基于抽样的结论必须写明抽样方式与样本量。
## 任务执行流程(SOP)
1. **理解与对齐**:复述问题,识别所涉指标与维度,与语义层对齐术语。
2. **歧义检查**:检查问题是否存在多种合理解读(同名列、未指明的口径、未指明的粒度);存在则**反问澄清**,不自行假设。
3. **口径确认**:确认指标使用的是批准口径;语义层缺失则上报口径缺口。
4. **schema linking**:检索相关表与列,而非全量注入。
5. **查询构造**:按目标方言生成查询;优先复用已验证查询集中的范例。
6. **三阶段校验**:
- 语法解析:确认语句合法
- `EXPLAIN` 干跑:确认可执行并预估扫描量与成本
- 权限与只读策略:确认在只读角色下且未触碰越权对象
7. **执行**:在只读角色下执行;记录耗时、扫描量与成本。
8. **结果校验**:与已验证查询集或独立复算路径比对;检查量级合理性。
9. **解释与限定**:给出答案、口径说明、覆盖范围、不确定性与已知局限。
10. **归档**:有价值的问答对经验证后进入已验证查询集。
## 验证与证据要求
- 每条数值必须来自**执行结果**,禁止由模型凭记忆或估算生成。
- 必须执行三项校验:**语法解析 → EXPLAIN 干跑 → 权限与只读策略检查**。
- 关键指标必须与**已验证查询集**或**独立复算路径**比对,差值须说明。
- 除执行准确率外,必须评估**有效效率得分(VES)**:通过全表扫描返回正确结果的查询,视为不合格。
- 主动报告反例与不利数据,不得只呈现支持性结果。
- 结论分「已验证 / 部分验证 / 未验证」三档列出。
## 失败与升级策略
- 同类失败重试不超过 2 次;第 3 次改变策略或升级。
- **歧义问题**:反问澄清,提供候选解读供用户选择,禁止任选其一。
- **语义层缺失该指标**:停止回答,上报口径缺口并说明需要谁补定义。
- **权限不足**:明确告知无权限,禁止用代理字段或近似口径绕过。
- **成本超阈值**:中止执行,报告预估扫描量与成本,申请放量或缩小范围。
- **结果为零或为空**:先区分「真的没有数据」与「查询条件写错」,两者不得混报。
- **结果与直觉严重不符**:标注为部分验证,报告可能的口径差异,不得自行「修正」数字。
- 升级时携带:原始问题、候选口径、生成的查询、执行计划、失败点、建议下一步。
## 安全与合规红线
- 不得绕过、推测或代为申请 RLS/CLS 权限。
- 不得用近似字段、代理指标或非批准口径回答受限问题。
- 不得在未声明的情况下使用未登记的口径。
- 不得把受限数据写入低分级位置(缓存、日志、图表、导出文件)。
- 不得执行任何写操作。
- 不得隐瞒查询的成本、覆盖范围与已知局限。
- 涉及个人信息与敏感字段的查询,须确认用户具备相应权限后才可执行。
## 禁止事项
- 禁止把整个 warehouse schema 一次性注入上下文。
- 禁止在语义层缺失时自行发明指标口径。
- 禁止用「大概」「通常来说」替代具体数值与口径来源。
- 禁止跳过 `EXPLAIN` 干跑直接执行高成本查询。
- 禁止在未确认方言的情况下生成查询。
- 禁止把执行成功当作结果正确——执行成功只说明能跑,不说明算对了。
- 禁止跨方向复制通用模板;数据分析的口径治理要求与深度研究、HPC 有实质差异。
## 输出格式
- 答案先行 → 口径说明 → 证据(数据源 + 版本 + 查询 + 执行记录)→ 不确定性 → 建议。
- 数值带单位与口径说明;范围用「~」连接;百分比数值与 % 之间无空格。
- 涉及多口径候选时用表格列出:口径、定义、数值、差异原因。
- 每个答案必须包含覆盖范围(时间范围、数据范围、过滤条件)。
- 查询与配置使用带语言标记的代码块。
## 评估与自检
- [ ] 问题中的术语已与语义层对齐
- [ ] 歧义已检查;存在歧义时已反问澄清
- [ ] 使用的是批准口径,且已标注定义来源与版本
- [ ] schema 经检索式 linking 装配,未全量注入
- [ ] 三阶段校验(语法 / EXPLAIN 干跑 / 权限只读)已全部执行
- [ ] 执行结果已与已验证查询集或独立复算比对
- [ ] 已评估有效效率得分,非全表扫描换来的正确结果
- [ ] 权限过滤已生效,未发生越权可见
- [ ] 成本在阈值内,或已上报
- [ ] 覆盖范围、局限与不确定性已声明 4.2 SKILL.md Specification
Standard source statement: the following is this document's proposed draft of a SKILL.md standard for the data analytics direction; likewise, no official standard text exists.
---
name: metric-qa-and-analysis
description: 指标问答与自助分析的标准执行流程与验收基线。适用于自然语言问数、指标口径核对、多步下钻分析、口径漂移检测与已验证查询集建设。触发场景:任何需要基于企业数据用自然语言回答业务数字的任务。
version: 1.0
created: 2026-09-12
---
# 指标问答与自助分析标准流程
## 适用场景
- 业务用户用自然语言询问指标数值、趋势与构成。
- 指标口径核对与差异解释(两个报表数字不一致时定位原因)。
- 多步分析:澄清 → 取数 → 校验 → 解释 → 下钻。
- 口径漂移检测与已验证查询集建设。
- 不适用场景:需要写操作的数据处理、无语义层且无指标字典的裸库问答(应先补语义层)。
## 前置条件
- 语义层或指标注册表可用且可检索。
- 元数据可用:表、列、关系、分级、所有权人。
- 只读数据库角色已配置,RLS/CLS 已生效。
- 目标查询方言已知。
- 成本可见:可获取 EXPLAIN 与扫描量预估。
- 已验证查询集存在(可为空集,但需有建设路径)。
## 输入
| 输入项 | 必需 | 说明 |
|---|---|---|
| 自然语言问题 | 是 | 用户的原始提问,含其惯用措辞 |
| 用户身份与权限上下文 | 是 | 决定可见行与可见列 |
| 语义层 / 指标定义 | 是 | 指标的权威定义、维度、粒度 |
| 目标方言 | 是 | Snowflake / BigQuery / PostgreSQL / DAX / KQL 等 |
| 成本阈值 | 是 | 单次查询可接受的最大扫描量或费用 |
| 时间范围默认值 | 否 | 用户未指定时使用的默认窗口 |
## 输出
| 输出项 | 必需 | 说明 |
|---|---|---|
| 答案 | 是 | 数值 + 单位 + 口径 + 覆盖范围 |
| 口径说明 | 是 | 使用的指标定义、来源与版本 |
| 查询 | 是 | 实际执行的语句,可复现 |
| 验证结果 | 是 | 与已验证查询集或独立复算的比对结果 |
| 效率评估 | 是 | 扫描量与有效效率评估结论 |
| 不确定性 | 是 | 歧义、局限、已知口径差异 |
## 执行步骤
1. **术语对齐**
把用户措辞映射到语义层中的规范术语与同义词;口语化表述须显式归一化;无法映射的术语进入待澄清清单。
2. **歧义检测**
检查同名列、未指明的口径、未指明的粒度与时间范围;存在多解时生成候选解读并向用户确认。
3. **口径确认**
在语义层中定位指标的权威定义;缺失则停止并上报口径缺口,禁止自行定义。
4. **schema linking**
基于已对齐的术语检索相关表与列;限制装配数量;优先使用语义层声明的关系路径。
5. **范例检索**
在已验证查询集中检索最相近的范例;命中则优先复用并按需微调。
6. **查询构造与三阶段校验**
按方言生成查询;依次执行语法解析、`EXPLAIN` 干跑(获取扫描量与成本)、权限与只读策略检查;任一阶段不通过则停止。
7. **执行与取数**
在只读角色下执行;记录耗时、扫描量与成本;结果按权限过滤后返回。
8. **结果校验**
与已验证查询集或独立复算路径比对;检查量级是否合理;检查是否命中已知口径差异。
9. **效率评估**
评估有效效率得分;若正确答案依赖全表扫描,标记为待优化,不得视为合格交付。
10. **解释与归档**
输出答案、口径、覆盖范围、不确定性与建议;有价值的问答对经验证后进入已验证查询集;记录本次成本。
## 质量标准(DoD)
口径与语义:
- [ ] 使用的指标定义来自语义层,且已标注来源与版本
- [ ] 用户措辞已映射到规范术语,映射关系已记录
- [ ] 全部歧义已澄清或已列为不确定性
- [ ] 多口径候选已用表格列出,未静默择一
正确性:
- [ ] 三阶段校验全部通过
- [ ] 结果与已验证查询集或独立复算一致,差值已说明
- [ ] 量级合理性已人工或规则检查
- [ ] 结论分为已验证 / 部分验证 / 未验证三档
效率与成本:
- [ ] 已评估有效效率得分,非全表扫描换来的正确结果
- [ ] 扫描量与成本在阈值内,或已上报获批
治理:
- [ ] RLS/CLS 已生效,无越权可见
- [ ] 查询在只读角色下执行
- [ ] 输出物继承源数据分级,未泄漏受限内容
- [ ] 覆盖范围与局限性已声明
## 常见失败与处理
| 失败现象 | 根因 | 处理方式 |
|---|---|---|
| 模型引用了不存在的字段 | 全量注入 schema 或缺少 schema linking | 改为检索式 schema linking;装配前校验字段存在性 |
| 数字比预期大很多 | 在错误粒度上 join 导致扇出 | 校验关联键唯一性;改用语义层声明的关系路径 |
| 两个报表口径不一致 | 使用了非批准口径 | 列出两个口径的定义与差异,交所有权人裁定 |
| 用户看到了不该看的行 | RLS 未生效或被绕过 | 立即停止;权限由数据访问层强制,不得靠提示词约束 |
| 查询跑了几分钟还没完 | 未做 EXPLAIN 干跑与成本预估 | 中止;加分区过滤与聚合下推;设置扫描量上限 |
| 同一问题两次答案不同 | 数据未定版或时间窗口未固定 | 固定时间范围与数据版本;使用快照 |
| 回答了但用户说「不是这个口径」 | 术语映射错误 | 回到术语对齐步骤;把正确映射补充进同义词表 |
| 结果为空 | 条件过严或数据缺失 | 先区分「真的没有」与「条件写错」,分别报告 |
| 榜单分数高但生产表现差 | 基准与生产分布不一致 | 以内部已验证查询集为第一评估依据,公开基准仅作参考 |
## 示例
**任务**:业务用户问「上个月华东区的新客收入是多少」。
1. 术语对齐:「上个月」→ 上一个自然月(非滚动 30 天,需确认);「华东区」→ 语义层中的 `region = 'East China'`;「新客」→ 语义层中 `is_new_customer` 口径(定义为首次成交在当前自然月内的客户);「收入」→ 语义层中 `net_revenue`(**已确认收入,非下单金额**)。
2. 歧义检测:「上个月」存在自然月与滚动 30 天两种解读;「新客」存在首次注册与首次成交两种口径 → 生成候选解读向用户确认。
3. 口径确认:语义层中 `net_revenue` 定义明确,来源为指标注册表 v2026-08。
4. schema linking:检索到 `fct_orders`、`dim_customer`、`dim_region` 三张表及所需列,未全量注入。
5. 范例检索:已验证查询集中存在「分大区月度净收入」范例,复用其关系路径。
6. 三阶段校验:语法通过;`EXPLAIN` 预估扫描 12 GB,低于阈值;只读角色确认。
7. 执行:返回净收入数值,记录耗时与扫描量。
8. 结果校验:与「分大区月度净收入」范例中华东区上月数值比对,一致。
9. 效率评估:命中分区裁剪,有效效率得分合格。
10. 输出:答案 + 口径说明(已确认收入 / 首次成交口径 / 自然月)+ 覆盖范围 + 不确定性(若用户本意是滚动 30 天,数值会不同)+ 建议把该问答对加入已验证查询集。 4.3 Implementation Checklist
4.3.1 Context Layer (L1)
- [ ] Semantic layer / metric registry established, with complete metric definitions, dimensions, granularity, and synonyms
- [ ] Retrieval-based schema linking supported, limiting the number of tables and columns assembled per query
- [ ] Mapping table from business terms and colloquial phrasing to canonical terms available
- [ ] Verified queries set searchable and reusable as exemplars
- [ ] Data profiling results (cardinality, value distribution, null rate) can be injected into context
4.3.2 Tool and Execution Layer (L2)
- [ ] Queries executed under a read-only role
- [ ] Correct dispatch to NL2SQL / NL2DAX / NL2KQL by source type
- [ ] EXPLAIN dry-run and scan-volume estimation capability provided
- [ ] Schema validation for tool parameters
- [ ] Duration, scan volume, and cost recorded for every query
4.3.3 Orchestration and Control Layer (L3)
- [ ] Ambiguity branch supported: ask a clarifying question when multiple interpretations exist, rather than assuming
- [ ] Multi-step analysis supported: clarify → fetch data → validate → explain → drill down
- [ ] Clear escalation path for metric-definition gaps
- [ ] Retry policy explicit, no more than 2 retries for the same type of failure
4.3.4 Memory and State Layer (L4)
- [ ] Query history and user preferences queryable
- [ ] Valuable Q&A pairs can be accumulated into the verified queries set
- [ ] Term-mapping corrections can flow back into the synonym table
- [ ] Data snapshots and versions traceable
4.3.5 Evaluation and Observability Layer (L5)
- [ ] Verified queries set / golden dataset established, covering key metrics
- [ ] Every semantic-layer or model change triggers regression execution
- [ ] Both execution accuracy (EX) and valid efficiency score (VES) evaluated
- [ ] Metric-drift detection in place (multi-path comparison of the same metric)
- [ ] Evaluation set itself has version management and periodic cleaning
- [ ] Internal evaluation prioritized over public benchmarks; public benchmarks for reference only
4.3.6 Governance and Security Layer (L6)
- [ ] RLS / CLS enforced at the data access layer, not dependent on prompts
- [ ] Access-violation queries intercepted with audit records
- [ ] Per-query cost threshold set and abortable
- [ ] Outputs (cache, logs, charts, exports) inherit source data classification
- [ ] Metric-definition changes require owner confirmation and leave an audit trail
5. Summary
The data analytics direction enjoys the most ideal conditions in AI Harness, and faces its most graceful failures.
The most ideal conditions are its executable ground truth: SQL result sets can be compared, verified queries can be regressed, and execution plans can be evaluated for efficiency. This makes the direction one of the highest in "evaluation return on investment" in Harness — every investment in the evaluation layer translates directly into accuracy gains and fewer incidents.
The most graceful failure is that when it errs, it returns a well-formatted number accompanied by a chart. A retrieval system returns nothing when it fails, and you notice immediately; a Q&A system hands you a number when it fails.
Three main threads run through this direction:
- Context governance sets the ceiling on correctness. The three platforms all converged on placing the semantic layer before Q&A, which is essentially an admission that Q&A questions are first and foremost context-engineering problems. Enterprise databases often contain more than 1,000 columns, so full injection is infeasible and schema linking must be treated as a retrieval problem.
- Benchmark scores do not equal production readiness. The gap between 86.6% on Spider 1.0 and 10.1% on Spider 2.0 is the very shape of the enterprise cliff. More worrying still, the ground truth in benchmarks themselves can be riddled with annotation errors — ground truth must be governed, just as data must be governed.
- Correct execution is not the same as a correct answer. Beyond execution accuracy, one must also look at the valid efficiency score; beyond a correct result, one must confirm the metric definition is the approved one, the permissions are effective, and the cost stays within threshold.
In one sentence, this direction's Harness proposition: first govern metric definitions into searchable context, then let the model answer questions; first validate against the verified queries set, then let the answer be seen.
Information Gap Statement
- No official or industry-recognized standard text exists for the data analytics direction's AGENTS.md / SKILL.md. Sections 4.1 and 4.2 are both proposed standard drafts in this document.
- Accuracy leaderboard data changes frequently; all leaderboard figures in this document are marked "leaderboard status as of mid-2026", and the latest leaderboard should be checked when citing.
- The following figures come from secondhand accounts and are marked
[To be verified]: from the CIDR 2026 paper, BIRD Mini-Dev 29.7% / Spider 2.0-Snow 25% ambiguity rates, 52.8% / 66.1% annotation-error rates, and CHESS 62% → 81% ranking change; refer to the original paper before citing. - The LiveSQLBench 35.67 / 28.67 comparison comes from a secondhand account and is marked
[To be verified]; "7-point loss" is the direct difference of the data point, not an independent statistical conclusion. - "The semantic layer can eliminate roughly 60% of hallucinations" comes from a low-credibility source, is marked
[To be verified], and is not used as a conclusion in this document. - Microsoft Fabric Data Agent's end-to-end response time reduced by up to 50% is vendor-reported data, marked
[To be verified]. - Platform pricing information (Databricks DBU allowances, Snowflake free inclusions, Fabric F2 tier pricing) is channel-sourced and changes frequently; this document does not cite specific prices.
- Actual customer counts, ARR, and vendor-reported internal benchmark accuracy for various platforms (e.g., a vendor-reported text-to-SQL improvement from 32% to 90%+) did not have a reliable primary source this time and are not used here.
- Statements by relevant Snowflake and Microsoft executives all come from secondhand accounts and are marked
[To be verified]. - The metric names, table names, and parameters in the Section 4.2 example are illustrative constructions and do not represent any real system.
6. References
- Text-to-SQL Accuracy in 2026: The Performance Cliff Nobody Mentions (positioning and accuracy data for the three benchmarks) — Onvo AI. https://www.onvo.ai/blog/text-to-sql-accuracy-in-2026-the-performance-cliff-nobody-mentions
- Natural Language to SQL Accuracy in 2026 (accuracy broken down by complexity) — AI for Database. https://www.aifordatabase.com/blog/natural-language-sql-accuracy-2026
- Plausible Wrong Numbers (CIDR 2026 benchmark annotation-error research, LiveSQLBench wording loss) — Mantissa AI. https://www.mantissaai.com/blog/nl-to-sql-plausible-wrong-numbers
- Snowflake Arctic-Text2SQL-R1-32B benchmark performance — Awesome Agents. https://awesomeagents.ai/models/snowflake-arctic-text2sql-r1-32b
- Text-to-SQL LLM in Production: Schema Linking and Guardrails (the four gates and VES) — AI Workflow Lab. http://aiworkflowlab.dev/article/text-to-sql-llm-production-schema-linking-guardrails-2026
- Data Agent Architecture Survey: From Architecture to Practice (comparison of the three platforms' semantic layers) — technical analysis blog. https://ibillxia.github.io/blog/2026/08/20/data-agent-servey-from-arch-to-practice
- Databricks Genie vs Snowflake Cortex Analyst vs Microsoft Fabric Data Agents — Agilytic. https://www.agilytic.com/blog/databricks-genie-cortex-analyst-fabric-data-agents
- The Five Failure Modes of Bad AI-generated SQL (source of the analysis framework) — Perplexity AI Magazine. https://perplexityaimagazine.com/?p=3450/
- DAMA Guide to the Data Management Body of Knowledge (data warehousing and business intelligence knowledge areas) — DAMA International. https://www.longshidata.com/blog/c/c2026062301.html
- MCP Data Science Workflow Tool Ecosystem (database-type MCP Servers) — technical guide. https://chatforest.com/guides/mcp-data-science-workflows
- OpenLineage official specification documentation — Linux Foundation. https://openlineage.io/
- ISO 8000 Data Quality Standards Series Summary — ISO/TC 184/SC 4. https://quality.arc42.org/standards/iso-8000