Over 10 years we help companies reach their financial and branding goals. Engitech is a values-driven technology agency dedicated.

Gallery

Contacts

411 University St, Seattle, USA

engitech@oceanthemes.net

+1 -800-456-478-23

Generative AI for Seamless
Data Interaction

Empowering Users with Natural
Language SQL Queries and Scalable AI-driven Solutions

Enhancing Text-to-SQL Capability with AI

Overview

Soulax has been at the forefront of harnessing Generative AI to streamline SQL generation for complex data workflows. This case study highlights how Soulax utilized AWS Cloud and cutting-edge AI technologies to revolutionize text-to-SQL conversion, making database interactions more intuitive and efficient for end users. The solution empowers users to input natural language queries and receive SQL statements that can be executed directly on the database, ensuring accessibility for technical and non-technical users alike.

text-to-sql
Situation

Traditional methods of writing SQL queries can be cumbersome and error-prone, especially for users without a strong technical background. The challenge was to enable users to interact with databases without learning SQL, thereby democratizing data access. Additionally, the solution needed to manage metadata, categorize various query types, and visualize tabular data efficiently, all while ensuring scalability and accuracy.

Key challenges included:

  • Ease of Use: Enabling users without SQL knowledge to extract insights from databases.
  • Scalability: Handling large volumes of data queries efficiently.
  • Accuracy: Ensuring the SQL generated was accurate and suitable for the query context. 
Task

Soulax needed a robust AI-driven architecture that would allow users to interact with complex datasets using natural language. The goal was to:

  • Generate Accurate SQL Queries: Develop an intuitive interface that could translate natural language inputs into SQL queries.
  • Provide Visualizations: Display tabular data and visualizations as needed based on user queries.
  • Leverage Generative AI: Use a generative model to continuously improve SQL query generation and error handling.
Action

To meet these requirements, Soulax designed a comprehensive AI-based system using various AWS services and Generative AI technologies. The solution comprised the following components:

  1. Metadata Extraction: AWS Glue was used to extract and catalog metadata from multiple data sources such as PostgreSQL, S3, and SQL Server.
  2. Embedding Generation and Query Classification: Using Hugging Face models, metadata was transformed into embeddings, which were stored in Amazon OpenSearch. AWS Bedrock was then employed to classify the query into one of four categories—General Query, SQL Query, Tabular Data, or Data Visualization.
  3. Context Retrieval and Response Generation: The solution leveraged the RAG (Retrieval-Augmented Generation) framework to retrieve relevant context from the vector database. AWS Bedrock was used to generate SQL statements, execute queries using Athena, and produce results.
  4. Error Handling with LLM Loop: A self-correcting mechanism was implemented to address errors in generated SQL statements, retrying up to three times to improve the quality of responses.
  5. User Interface: A Streamlit-based front end was developed for end users, allowing them to input natural language queries. The output, whether text, data, or visualizations, was presented in an easy-to-use format.
Results

The Generative AI-driven solution delivered significant improvements in user experience and operational efficiency:

  • Reduced Complexity: Users without SQL expertise can now easily interact with databases using natural language, making data more accessible.
  • Increased Efficiency: The optimized workflow allows for quick retrieval of information. Large queries that previously took hours to execute can now be performed in minutes, thanks to the efficient use of Athena and AWS-managed services.
  • Error Reduction: The self-correcting SQL loop significantly reduced errors, providing more reliable and accurate query results.
  • Enhanced Scalability: The solution utilized AWS’s scalable architecture, ensuring that the system could handle increased loads without performance degradation.

Soulax’s AWS DevOps expertise enabled Svarupa to build a robust, scalable,
and efficient platform to deliver ancient Vedic wisdom to a global audience.