Natural Language Query Engine for Relational Databases using Generative AI

Steve Tueno Fotso
2024-09-23
Abstract:The growing reliance on data-driven decision-making highlights the need for more intuitive ways to access and analyze information stored in relational databases. However, the requirement of SQL knowledge has long been a significant barrier for non-technical users. This article introduces an innovative solution that leverages Generative AI to bridge this gap, enabling users to query databases using natural language. Our approach automatically translates natural language queries into SQL, ensuring both syntactic and semantic correctness, while also generating clear, natural language responses from the retrieved data. By streamlining the interaction between users and databases, this method empowers individuals without technical expertise to engage with data directly and efficiently, democratizing access to valuable insights and enhancing productivity.
Databases,Artificial Intelligence,Machine Learning,Software Engineering
What problem does this paper attempt to address?
The paper aims to address the issue that non-technical users find it difficult to directly use natural language to query relational databases. Specifically, the paper proposes an innovative approach that utilizes Generative AI to convert natural language queries into SQL statements and ensures the syntactic and semantic correctness of these SQL statements. Additionally, this method can generate clear and natural language responses based on the retrieved data. The main objectives include: 1. **Improving Usability**: Allowing users without SQL knowledge to easily query databases. 2. **Ensuring Query Accuracy**: Ensuring that the automatically generated SQL statements are not only syntactically correct but also comply with business rules and contextual requirements. 3. **Generating Natural Language Responses**: Converting query results into easy-to-understand natural language descriptions, rather than just raw SQL outputs. 4. **Integrating Business Rules**: Storing and applying complex business rules through a vector database to ensure that query results accurately reflect actual business operations. In this way, the method can simplify the interaction process between users and databases, enabling non-technical users to intuitively and efficiently gain data insights, thereby enhancing productivity.