Declarative Techniques for NL Queries over Heterogeneous Data
Elham Khabiri, Jeffrey O. Kephart, Fenno F. Heath, Srideepika Jayaraman, Fateh A. Tipu, Yingjie Li, Dhruv Shah, Achille Fokoue, Anu Bhamidipaty
TL;DR
This paper tackles natural language querying in industrial environments where data lives across heterogeneous sources (databases, APIs, etc.). It proposes siwarex, a declarative framework that represents user intent with SQL and integrates external APIs via User Defined Functions, enabling seamless orchestration alongside databases. Two Spider-based benchmarks augmented with API calls are introduced to evaluate performance in mixed-source scenarios, with results showing the declarative approach outperforms imperative and agent-based methods, especially as data heterogeneity increases. The work provides open benchmarks and outlines practical considerations for real-world deployment, while identifying limitations and future work in handling larger schemas and vector/table outputs.
Abstract
In many industrial settings, users wish to ask questions in natural language, the answers to which require assembling information from diverse structured data sources. With the advent of Large Language Models (LLMs), applications can now translate natural language questions into a set of API calls or database calls, execute them, and combine the results into an appropriate natural language response. However, these applications remain impractical in realistic industrial settings because they do not cope with the data source heterogeneity that typifies such environments. In this work, we simulate the heterogeneity of real industry settings by introducing two extensions of the popular Spider benchmark dataset that require a combination of database and API calls. Then, we introduce a declarative approach to handling such data heterogeneity and demonstrate that it copes with data source heterogeneity significantly better than state-of-the-art LLM-based agentic or imperative code generation systems. Our augmented benchmarks are available to the research community.
