DynaQuery: A Self-Adapting Framework for Querying Structured and Multimodal Data
Aymane Hassini
TL;DR
DynaQuery introduces a self-adapting framework for querying structured and multimodal data, anchored by the Schema Introspection and Linking Engine (SILE) that treats schema linking as a first-class, structure-aware query planning step. Across Spider, BIRD, and a new Olist-based benchmark, the study demonstrates that structure-aware linking robustly reduces catastrophic SCHEMA_HALLUCINATION compared to unstructured RAG and enables strong end-to-end performance, especially when augmented with semantic context. The work further analyzes architectural trade-offs in the decision module, showing that a rule-based prompt-guided generalist LLM offers robust predictability in out-of-distribution scenarios, while data-aware linking and semantic enrichment are pivotal for generalization to complex, real-world schemas. Collectively, the findings establish a practical blueprint for robust, adaptable natural language interfaces to Unbound Databases, and highlight a clear path toward semantic and data-aware extensions to reach truly universal data querying. The provided artifact repository contains code, datasets, and benchmarks necessary to reproduce and build upon these results.
Abstract
The rise of Large Language Models (LLMs) has accelerated the long-standing goal of enabling natural language querying over complex, hybrid databases. Yet, this ambition exposes a dual challenge: reasoning jointly over structured, multi-relational schemas and the semantic content of linked unstructured assets. To overcome this, we present DynaQuery - a unified, self-adapting framework that serves as a practical blueprint for next-generation "Unbound Databases." At the heart of DynaQuery lies the Schema Introspection and Linking Engine (SILE), a novel systems primitive that elevates schema linking to a first-class query planning phase. We conduct a rigorous, multi-benchmark empirical evaluation of this structure-aware architecture against the prevalent unstructured Retrieval-Augmented Generation (RAG) paradigm. Our results demonstrate that the unstructured retrieval paradigm is architecturally susceptible to catastrophic contextual failures, such as SCHEMA_HALLUCINATION, leading to unreliable query generation. In contrast, our SILE-based design establishes a substantially more robust foundation, nearly eliminating this failure mode. Moreover, end-to-end validation on a complex, newly curated benchmark uncovers a key generalization principle: the transition from pure schema-awareness to holistic semantics-awareness. Taken together, our findings provide a validated architectural basis for developing natural language database interfaces that are robust, adaptable, and predictably consistent.
