Inspiration

In today's data-driven world, a vast "data divide" exists. While companies collect massive amounts of valuable data, only a small fraction of their team—the data analysts and engineers—possess the SQL skills needed to access it. This creates a significant bottleneck, where business teams have urgent questions but face long delays waiting for reports.

Our inspiration came from wanting to bridge this gap. We saw the incredible advancements in Large Language Models and realized we could build a conversational bridge, allowing anyone to talk to their database directly and democratize access to data-driven insights.

What it does

QueryBot is a streamlined, production-ready platform that enables users to query an Azure SQL database using plain English. It transforms the complex task of data analysis into a simple conversation.

  • Natural Language Querying: Ask questions in plain English, either by typing or using your voice.
  • AI-Powered Translation: Uses Azure OpenAI (GPT-4) to instantly translate questions into executable SQL statements.
  • Rich Results: Executes queries and returns neatly formatted results as interactive tables.
  • Instant Visualization: With a single click, users can view results as bar, line, or pie charts.
  • Full Transparency: Displays the generated SQL code alongside results to build trust and aid learning.
  • Data Exploration: Built-in schema explorer and intelligent query suggestions guide users in understanding their data.

How we built it

QueryBot is a full-stack application built with a modern, scalable tech stack:

  • Frontend: Responsive interface with React and Material-UI (MUI).
  • Backend: High-performance API built with Python and FastAPI.
  • AI Core: Azure OpenAI (GPT-4) with schema-aware prompt engineering for accurate SQL generation.
  • Database: Azure SQL Database as the primary structured data source.
  • Voice-to-Text: Real-time voice querying via Azure Speech Services.
  • Deployment: Fully deployed on Vercel for scalability and ease of use.

Challenges we ran into

  • Ensuring SQL Accuracy: Preventing hallucinated or incorrect SQL required schema injection and few-shot examples.
  • Security and Safeguards: Restricted AI execution to read-only SELECT queries and implemented prompt-injection defenses.
  • Real-time Performance: Coordinated multiple APIs (Speech, OpenAI, Database) with FastAPI’s async features for smooth responsiveness.

Accomplishments that we're proud of

  • Built a complete, production-ready system that goes beyond proof-of-concept.
  • Integrated text, voice, querying, and visualization into one seamless interface.
  • Delivered transparency by displaying generated SQL, building trust and doubling as a SQL learning tool.

What we learned

  • Prompt Engineering Matters: Success depends on precise context injection for text-to-SQL.
  • Full-Stack Integration: Combined React frontend, FastAPI backend, and Azure services into a smooth workflow.
  • User-Centric AI Design: Trust, clarity, and simplicity are as important as raw functionality.

What's next for QueryBot

Our roadmap includes:

  • Support for More Databases: PostgreSQL, MySQL, Snowflake, and more.
  • Conversational Drill-Down: Multi-turn conversations to refine previous queries (e.g., "Filter that by department").
  • Proactive Insights: AI-powered suggestions for trends and anomalies.
  • Dashboard Creation: Save and combine favorite queries and visualizations into shareable dashboards.

Built With

Share this project:

Updates