QueryGPT is a Streamlit-based AI assistant that allows you to interact with your SQLite database using natural language. It leverages LLMs like Ollama (Mistral) or OpenAI GPT-4 via LangChain to translate your questions into SQL queries and display meaningful answers.
- 🔗 Connects to a local SQLite database (
products.db) - 🤖 Uses either:
Ollama(default) — lightweight LLM via local inferenceOpenAI GPT-4— via API key
- 🧠 Translates natural language into SQL using LangChain's SQL agent
- 📊 Automatically renders query results in table format (if applicable)
- 🧾 Handles plain-text responses and extracts structured data when possible
- You ask a question (e.g., "Show me the top 5 most expensive products").
- The app uses a selected LLM to generate a SQL query.
- If it's a
SELECTquery:- Executes it on
products.db - Displays results in a table
- Executes it on
- If not, it tries to parse and display the response cleanly.
- Python
- Streamlit
- LangChain
- Ollama / OpenAI
- SQLite
- Pandas
- Clone the Repository
git clone https://github.com/your-username/query-gpt.git
cd query-gpt