TL;DR
A Google Cloud Blog post by AI Engineer Rupjit Chakraborty describes how to build custom evaluation metrics for natural-language-to-SQL agents in Google’s Agent Development Kit. The approach combines tool-sequence checks, deterministic comparison of normalized results, and an LLM-based rubric for judging summaries and extra columns. The supplied source explains five evaluation traps, but its description of the fifth scenario is cut off.
Google Cloud has published guidance for evaluating natural-language-to-SQL (NL2SQL) data agents built with its Agent Development Kit (ADK), arguing that standard exact-match tests can wrongly mark valid SQL outputs as failures. The post, by AI Engineer Rupjit Chakraborty, proposes combining tool-sequence checks with a custom semantic comparison of query results and a rubric-based review of the agent’s final response.
Get business pricing on monitors, keyboards and dev gear
- Business-only prices and quantity discounts
- Tax-exempt purchasing
- Multiple users, one account, clear invoices
The post says ADK’s built-in tool_trajectory_avg_score can compare tool arguments exactly, including raw SQL, while response_match_score uses ROUGE-1 word overlap. Those measures may penalize agents for writing equivalent SQL differently or presenting the same data with more readable labels. Google Cloud’s recommendation is not to rely on a single score: evaluate agent behavior, result equivalence and the quality of the written answer as separate concerns.
For tool behavior, the post recommends configuring tool_trajectory_avg_score with match type IN_ORDER and ignore_args=true. That checks whether the agent used the expected tools in sequence without requiring the generated SQL arguments to match character for character. For result checking, it proposes a custom ADK metric that normalizes the reference and predicted result sets before comparing them, a deterministic approach the post says does not incur LLM token costs.
A third layer uses ADK’s rubric_based_final_response_quality_v1 criterion as an LLM judge. The proposed role for that rubric is to assess whether additional columns help the user and whether the natural-language summary is consistent with the returned data. The post presents these layers as complementary: a semantically correct table alone does not establish that the agent followed an appropriate tool path or explained its answer accurately.
Evaluate NL2SQL agents beyond exact matches
Google Cloud’s ADK guidance separates tool behavior, result equivalence, and answer quality to help teams assess SQL agents fairly.
Three evaluation layers
Measure how the agent works, what data it returns, and how well it explains the result.
Use IN_ORDER with ignore_args=true to check expected tools without matching raw SQL text.
A custom deterministic metric compares standardized reference and predicted result sets.
Use a rubric to assess whether extra columns help and the summary matches the data.
Where simple table diffs fail
Equivalent answers can look different, but meaningful errors still need to count.
Aliases and columns
Clearer aliases or a different column order may preserve the same information.
Rows depend on the request
Ignore sequence when no order is requested; check it for rankings such as “top 5.”
Compare values by meaning
Representations like 99.50 and 99 may need field-aware numeric comparison.
Review added context
Additional columns may help, but the supplied source cuts off before explaining its full example.
Set rules for your data
Teams must define what equivalence means for their queries and fields.
Why SQL-Aware Scoring Matters
Evaluation results influence whether developers trust an agent enough to use it with business data. If a benchmark treats column aliases, column order or harmless formatting differences as errors, it can understate an agent’s usefulness. If a benchmark is too permissive, it can miss wrong values, incorrect rankings or misleading summaries. The Google Cloud post’s central point is that the test must distinguish presentation differences from data errors.
This matters especially for agents that query live warehouses rather than return a fixed answer. Their results can vary in formatting and, for unordered queries, row sequence. A layered evaluation can help teams measure separate failure modes instead of collapsing them into a raw SQL string match. However, the blog guidance describes an evaluation design; it does not, in the supplied material, report measured improvements in accuracy or production reliability.
Products Worth Considering

LG UltraGear 32-inch QHD Curved Gaming Monitor, 180Hz, 1ms, FreeSync

Samsung Galaxy Tab A9+ 11-Inch 64GB Android Tablet, Silver

Anker SOLIX S2000 Portable Power Station, 2,010Wh, 1,500W
As an affiliate, we earn on qualifying purchases.
Five Cases That Break Table Diffs
The post identifies five situations where exact SQL matching or a naive cell-by-cell table comparison can produce false negatives. The first is column aliases: a database field such as prod_sale_rev_fy25 might be returned under a clearer label such as “Revenue FY2025,” even when its values are unchanged. The second is column order, which generally does not change the meaning of a result if the requested attributes are all present.
The third is row order. The post notes that SQL does not guarantee an order unless the query specifies one, so a test should not impose a sequence on an unordered result. But if the user asks for a ranking or a “top 5” list, the evaluation should check that order. The fourth case is numeric representation: values such as 99.50 and 99 may need type-aware or precision-aware comparison rather than string equality, although an evaluator must still apply rules appropriate to the field and task.
The fifth case is described as a superset result: an agent may return extra, potentially helpful context columns alongside requested fields. The supplied source begins an example about active projects but ends before the scenario and its proposed handling are fully explained. Its broader recommendation is to judge whether extra information is useful, rather than automatically rejecting every result with additional columns.
“The evaluator’s dilemma stems from a fundamental mismatch between rigid test assertions and flexible SQL semantics.”
— Rupjit Chakraborty, AI Engineer, in the Google Cloud Blog post
Limits of the Supplied Guidance
The source material does not provide a publication date, a complete implementation walkthrough, code, benchmark results or evidence that the proposed metrics improve production outcomes. It also stops partway through the fifth example, so the exact suggested comparison rules for extra columns cannot be confirmed from the supplied text. The post’s recommendations are guidance from Google Cloud, not an independently reported evaluation of ADK agents.
Teams would still need to define what counts as equivalent for their own data: whether rows are duplicates, whether nulls match, what numeric tolerances are acceptable, and when additional fields should fail a test. The source describes sorting exceptions, but does not set out a universal policy for such cases. These choices depend on the user’s request and the meaning of the underlying fields.
Implementation Depends on Test Design
The post says it will show how to build and run a custom semantic SQL evaluator in ADK, but the material supplied here contains the evaluation framework and scenario descriptions rather than the full implementation. Developers following the guidance would need to define normalization rules, add test cases for ordered and unordered results, and decide how to score extra fields and final-response accuracy.
The next practical milestone is validation against representative queries and known failure cases, including aliases, reordered columns, unsorted rows and numeric formatting. Until those tests and their outcomes are available, the guidance should be read as a proposed design approach, not proof that a particular agent is production-ready.
Key Questions
What development does the Google Cloud post describe?
It describes a custom evaluation approach for NL2SQL agents built with Google’s Agent Development Kit, combining tool checks, normalized result comparison and rubric-based assessment of the final answer.
Why might exact SQL matching mark a correct answer wrong?
Two queries can return equivalent data while using different SQL text, aliases or column order. An exact string test treats those presentation and syntax differences as failures even when the result serves the same request.
Should an evaluator ignore row order?
Not in every case. The post says row order should generally not be enforced when the request does not specify sorting, but a ranked request such as “top 5 customers” requires an order-sensitive check.
What does the custom semantic metric compare?
The post proposes normalizing the reference result and the agent’s predicted result into a standard form, then checking data equivalence. The supplied material does not give the full normalization implementation or rules.
Does the post show that the approach improves accuracy?
No such result is included in the supplied source. It presents a design recommendation and evaluation scenarios, but provides no benchmark measurements or production-performance evidence.
Source: Google Cloud Blog
