Agentic Text-to-SQL Chatbot using LlamaIndex
Rakshitha G
QueryMind AI is a web-based intelligent database assistant that lets users ask questions about a database in plain English, by typing or by speaking, and receive the answer together with the SQL query that produced it and the result table. Many people who need information stored in a database, such as students, teachers and office staff, do not know SQL, so they depend on someone else to write queries for them. QueryMind AI removes this dependency by placing a large language model (Llama 3.1, run locally through Ollama) behind a simple chat interface. The interface is built with Streamlit and has five pages: an AI Assistant, a Dashboard, a Database Analytics page, a Query History page and an About page. The AI Assistant page accepts typed questions and recorded voice questions; voice is converted to text with the SpeechRecognition library. Each question is passed to an agent function (ask_database) built with LlamaIndex, which converts it into SQL, runs it on an SQLite college database and returns the answer. The interface shows the AI answer, the generated SQL in an expandable panel and the query results in a numbered table that can be downloaded as a CSV file. The Database Analytics page adds a department filter, summary figures, charts and a student profile search. The main purpose of the system is to make database access easy, transparent and usable by non-technical people.

