Skip to content
trendoviz

SQL evaluation metrics for AI agents

Evaluating agents that generate SQL is difficult because standard methods penalize valid variations. Databricks and Google Cloud offer new techniques to accurately measure these agents.

Published

Overview

Databricks introduced query-time joins and relationship constraints in Unity Catalog Semantics in December 2026 to enable AI agents to compose governed metrics across independently defined metric views in SQL. Google Cloud, in an Agent Development Kit (ADK) blog post from November 30, 2026, described five common evaluation traps for SQL agents and recommended a custom evaluation metric that combines trajectory, deterministic semantic equivalence, and rubric-based checks to accurately assess performance. Both sources agree that traditional semantic models are insufficient for AI agents because the scope of analysis is determined at query time, and that built-in evaluation criteria often fail to distinguish between valid SQL variations and actual errors.

Why it matters

Evaluating AI agents that generate SQL queries is difficult because standard methods penalize valid variations like readable aliases, different column orders, or helpful extra columns. As these agents move from single-shot translators to autonomous data workers, accurate evaluation is required to prove reliability for production use. Without robust evaluation, organizations risk deploying unreliable data agents that produce incorrect or unhelpful answers to business users.

Context

Enterprise Natural Language to SQL (NL2SQL) systems are evolving from single-shot query translators into autonomous data agents. These agents inspect schemas, validate queries, and synthesize answers from live data. To prove that an agent is accurate and reliable for production, developers must use evaluation metrics that account for the flexible semantics of SQL.

Known, claimed, inferred

Databricks introduced query-time joins and relationship constraints in Unity Catalog to allow agents to compose governed metrics across independently defined metric views at query time, addressing the limitation of traditional semantic models that cannot anticipate every analysis combination. Google Cloud's Agent Development Kit (ADK) recommends a custom evaluation metric that normalizes result sets and combines trajectory, deterministic semantic equivalence, and rubric-based checks to avoid the five SQL evaluation traps: the alias problem, permutation problem, sorting problem, precision problem, and superset problem.

Opportunities

Developers can build custom evaluation metrics that normalize result sets and combine trajectory, deterministic, and rubric-based checks to assess data agents. Data platform providers can enable agents to compose governed metrics at query time, allowing systems to answer complex business questions without rigid pre-defined models.

Risks

Built-in evaluation criteria often fail to distinguish between valid SQL variations and actual errors, leading to false confidence in agent performance. Without robust evaluation, organizations risk deploying unreliable data agents that produce incorrect or unhelpful answers to business users.

Limitations & uncertainties

Databricks does not specify the names of the metrics or evaluation criteria it uses for its query-time joins and relationship constraints, nor does it provide performance benchmarks. Google Cloud describes a six-step normalization pipeline in the excerpt but only details the first three steps (standard value normalization, column alignment by value counts, and stripping whitespace from text). There is no evidence comparing the effectiveness or characteristics of Databricks' composable metrics approach with the SQL evaluation traps and custom metrics framework described by Google Cloud. The specific criteria and configuration fields (e.g., match_type, ignore_args) used in the ADK trajectory evaluation are not fully detailed in the provided text. To watch next: The industry is moving toward composable semantic layers and robust SQL evaluation, but independent comparisons of these approaches are needed.

Evidence & sources

Updates & corrections

  1. First published

Found an error? Report it.

News in this trend