Reproduce “AgentNLQ: A General-Purpose Agent for Natural Language to SQL” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

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

AgentNLQ, a multi-agent system from JPMorganChase, converts natural language questions into SQL queries using an optimized orchestrator and advanced schema enrichment. It achieved a weighted average semantic accuracy of 78.1% on the 11-domain BIRD-SQL benchmark and reduced P50 latency for query generation from 134.9 seconds to 10.3 seconds for Claude Opus 4.1.

Key insights

  • A domain-specialized, ledger-driven orchestrator, optimized for NL2SQL and incorporating both fast (System 1) and slow (System 2) reasoning paths, significantly enhances accuracy and reduces latency by leveraging direct execution and validation feedback.
  • Automated, LLM-generated schema enrichment combined with vector search for context retrieval improves the system's understanding of complex database structures and relationships, crucial for accurate query generation in schema-dense environments.
  • Structured context compression, by selectively pruning session history and diagnostic signals, effectively manages token usage and preserves critical information during iterative self-correction, contributing to higher accuracy and cost efficiency.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.