Enterprise text-to-SQL systems often fail before SQL is generated: the model receives the wrong schema context. Modern warehouses contain thousands of tables, abbreviated columns, informal metrics, hidden join conventions, and permission boundaries that are not captured by raw table names. We introduce Schema-First Retrieval, a retrieval layer that embeds catalog metadata rather than warehouse rows. The system indexes five typed catalog objects, tables, columns, metrics, relationships, and query history, using object-specific text templates. At query time, it combines parallel vector search, lineage expansion, cross-encoder reranking, workload memory, and deterministic access-control gates before SQL generation. On CRUSH4SQL (1,534 questions), Schema-First Retrieval reaches 96.4% table recall@20 and cross-encoder reranking adds +11.1 points at column recall@10; against an equally-templated BM25 baseline, semantic retrieval is +32.8 points at table recall@5. On SEDE (857 questions), query history raises table recall@5 from 52.1% to 92.3%. On BIRD (96 questions), schema-first context reduces SQL execution errors from 15.6% to 6.2%, a 2.5x reduction. These results show that catalog selection is a first-class retrieval problem for natural language analytics, not a prompt formatting detail.
Retrieval-Augmented Code Generation for Universal Information Extraction
CAS Key Laboratory of Network Data Science and Technology, Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所网络数据科学与技术重点实验室);School of Computer Science and Technology, University of Chinese Academy of Sciences(中国科学院大学计算机科学与技术学院);Platform and Content Group, Tencent(腾讯平台与内容事业群)
FollowTable: A Benchmark for Instruction-Following Table Retrieval
Southeast University(东南大学);Huawei Noah’s Ark Lab(华为诺亚实验室);Key Laboratory of New Generation Artificial Intelligence Technology and Its Interdisciplinary Applications (Southeast University), Ministry of Education(新一代人工智能技术及其交叉应用国家重点实验室(东南大学));Its Interdisciplinary Applications (Southeast University), Ministry of Education(交叉应用(东南大学),教育部)
DBCopilot: Natural Language Querying over Massive Databases via Schema Routing
Institute of Software, CAS(中国科学院软件研究所);Hangzhou Institute for Advanced Study, UCAS(中国科学院大学杭州高等研究院);University of Chinese Academy of Sciences (UCAS)(中国科学院大学);Alibaba Cloud Intelligence Group(阿里巴巴云智能集团)