Agentic NL2SQL to Reduce Computational Costs

Dominik Jehle, Lennart Purucker, Frank Hutter
10/16/2025
cs.AIcs.LG

No confident code implementation found for this paper.

Abstract

Translating natural language queries into SQL queries (NL2SQL or Text-to-SQL) has recently been empowered by large language models (LLMs). Using LLMs to perform NL2SQL methods on a large collection of SQL databases necessitates processing large quantities of meta-information about the databases, which in turn results in lengthy prompts with many tokens and high processing costs. To address this challenge, we introduce Datalake Agent, an agentic system designed to enable an LLM to solve NL2SQL tasks more efficiently. Instead of utilizing direct solvers for NL2SQL that call the LLM once with all meta-information in the prompt, the Datalake Agent employs an interactive loop to reduce the utilized meta-information. Within the loop, the LLM is used in a reasoning framework that selectively requests only the necessary information to solve a table question answering task. We evaluate the Datalake Agent on a collection of 23 databases with 100 table question answering tasks. The Datalake Agent reduces the tokens used by the LLM by up to 87\% and thus allows for substantial cost reductions while maintaining competitive performance.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{jehle2025agentic,
  title  = {Agentic NL2SQL to Reduce Computational Costs},
  author = {Dominik Jehle and Lennart Purucker and Frank Hutter},
  year   = {2025},
  eprint = {2510.14808},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.14808v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.14808.svg)](https://codeofpaper.com/paper/2510.14808)

Discussion