If your warehouse columns are called questregistry and climtune, keyword search picks the wrong tables, and the model writes confident SQL against them.
schemagate sends the model only the tables a question needs and the caller may read: 91.1% fewer schema tokens (median, databases with 50+ tables). #1 on BIRD's Mini-Dev leaderboard in SQLite / PostgreSQL / MySQL (81.0 / 72.6 / 72.4 EX, official board); 74.34 EX on BIRD's hidden test set, scored by the BIRD team. Listed in LangChain's retriever docs, usable from LangGraph.
What I found
Snowflake's SQL-Schema-Retrieval benchmark (arXiv 2607.13311) asks one thing: given the question, rank this database's tables. On its hardest set, LiveSQLBench-Large (971 tables, column names that are codes), my fused ranking scored 48.2 recall@10 while its own vector channel alone scored 60.8. The fusion was losing to itself.
The cause was the RRF constant everyone copies, k=60. At 60, being anywhere in three keyword channels outweighs being first in the vector one, so readable distractor tables that shared one word with the question took the slots.
The fix (1.18.0), each piece measured on all five sets before it was kept
- RRF constant 10, so rank matters again
- a column channel: each table scored by its single best column (name + comment), max not sum, so a wide table can't win by breadth
- keyword votes scaled by how much of the question the match explains
Recall@10, no LLM calls
| Spider | BIRD | BEAVER | LiveSQLBench | LSB-Large | |
|---|---|---|---|---|---|
| hashed embedder (no extras) | 100.0 | 99.2 | 65.9 | 95.3 | 64.9 (was 48.2) |
| + all-MiniLM-L6-v2 | 100.0 | 99.8 | 66.2 | 97.6 | 73.9 (was 51.9) |
| paper's best model | 98.5 | 99.1 | 65.8 | 91.7 | 75.8 |
What it doesn't do: still under Qwen3-Embedding-4B on LSB-Large. The gap is the 22M-parameter sentence model, not the fusion: bge-small (33M) alone reaches 74.2. BIRD and BEAVER are level with the paper, not ahead. These are retrieval numbers I measured, not answer accuracy; the script is in the repo.
Also new: schemagate certify <url> --golden writes a question per table from your schema and names the tables no question will reach. And from 1.17: the schema as a property graph (Oracle CREATE PROPERTY GRAPH generated for you), concepts pulled from comments and view SQL, joins mined from the query log with every literal stripped first.
pip install schemagate · GitHub · the benchmark section

