back to projects
Text2SQL
Agent
Benchmark & evaluation harness
for SQL-generating agents
01Problem 02Detector 03Architecture 04Result
2nd — hardest track
GitHub Press coverage ashleyn4@illinois.edu
AgentX–AgentBeats · UC Berkeley RDI · with Keshav Dalmia

An LLM will invent a table that doesn’t exist and hand you perfect SQL for it. The database is the wrong place to find that out.

Text2SQL Agent team at Illinois
01 — problem

Text-to-SQL benchmarks grade pass/fail: run it, compare rows. That hides the failure that actually hurts — confident, well-formed SQL against a table that was never in the schema. You find out at execution time, on a real warehouse, and the usual fix is to catch the error and retry the model.

Hallucination in SQL is a schema problem — and a schema is checkable before you execute anything.

So generated SQL is scored across seven weighted dimensions instead of one bit: correctness 35%, safety 20%, efficiency 15%, completeness and semantic accuracy 10% each, best practices and plan quality 5% each. Safety outranks speed on purpose.

02 — detector

Queries are parsed to an AST with sqlglot before execution. Every table, column and function reference is resolved against the live schema; anything that doesn’t resolve is reported with a severity score, not a stack trace.

SELECT fake_column FROM nonexistent_table
HALLUCINATION DETECTED
⚠ phantom table  →  nonexistent_table
⚠ phantom column  →  fake_column

Structural, not textual — so it survives transpilation across SQLite, DuckDB, PostgreSQL and BigQuery. Failures that do execute get classified by cause (schema, analysis, SQL) using the taxonomy from published work on SQL generation failures, which turns a score into a diagnosis.

03 — architecture
SQL executor sqlite · duckdb · postgres · bigquery
Validation layer AST parse · phantom check · schema
Error classifier schema · analysis · sql
Scoring engine 7 dimensions → ranked artifact

It runs as a green (evaluator) agent over the AgentBeats A2A protocol, handing tasks to purple competitor agents and emitting one reproducible artifact per tournament. Docker compose, MIT licensed.

04 — result
2nd hardest track
$1M prize pool
7 scoring dimensions
4 dialects
→ code on GitHub → press coverage → back to projects