AgentNLQ: A General-Purpose Agent for Natural Language to SQL

Olena Bogdanov, Yeunji Jung, Chandra Dhir, Pareekshitreddy Gaddam, Saurabh Jain, Lakshmi Tumati, Vijay Parthasarathy, Anup Shirgaonkar

arXiv:2605.19010 · 2026-05-20 공개 · arXiv · PDF

llm multi-agent context-aware orchestrator sql-generation metadata nl2sql schema-enrichment

Abstract

Natural language to SQL (NL2SQL) conversion is an important problem for researchers and enterprises due to the ubiquitous importance of relational databases in broad-ranging practical problems. Despite the rapid advancements in the capabilities of LLMs, NL2SQL has not reached parity in accuracy with human expert SQL writers, hence needing additional improvements in NL2SQL algorithms. This study presents a new multi-agent method for NL2SQL that achieves 78.1% semantic accuracy on the BIg Bench for LaRge-scale Database (BIRD) benchmark. Our method leverages a semantically enriched representation of user-provided schema, adds user-provided business rules, and produces accurate SQL queries. The main contributions of this study are (a) We designed an optimized new orchestrator in a multi-agent solution that uses LLMs to plan, orchestrate, reflect, and self-correct to generate accurate SQL queries, (b) We developed an advanced schema enrichment method that creates context-aware metadata to improve accuracy, and (c) We demonstrated the accuracy and generalizability of the method across different domains and datasets by evaluating it on the BIRD-SQL benchmark.

한국어 요약

한 줄 요약

**[NL2SQL / 멀티 에이전트 LLM]** 의미적으로 풍부한 스키마 표현과 사용자 비즈니스 규칙을 활용하는 새로운 멀티 에이전트 오케스트레이터 AgentNLQ로 BIRD 벤치마크에서 78.1% semantic accuracy 달성.

핵심 기여도

핵심 아이디어

NL2SQL의 정확도 향상은 단일 LLM 호출을 더 강한 모델로 바꾸는 것이 아니라, (a) 스키마 표현을 의미적으로 풍부하게 만들고, (b) 멀티 에이전트가 계획·반성·자기수정 루프를 돌리며, (c) 사용자 제공 비즈니스 규칙을 컨텍스트로 흡수하는 시스템 차원의 설계에서 온다.

기술적 접근법

주요 결과

의의 및 한계

**의의**: 엔터프라이즈 데이터베이스 응용에서 NL2SQL을 실제 적용 가능한 수준에 더 가깝게 끌어올리는 시스템 청사진 제공. **한계**: 비즈니스 규칙·스키마 enrichment의 품질에 성능이 의존, 매우 큰 스키마·드문 도메인 표준어에서의 일반화는 추가 검증 필요.

실용적 활용