A web app built with Streamlit that allows you to chat with your databases using a GPT model.
-
Chat with your GPT model of choice
-
Ask about anything in your databases, and the bot will answer
-
View the results and the SQL queries that the GPT model generated
-
SQL queries are added below the bot's response
-
Expand the box to see the query and the result the bot received
-
If the model accidentally generates an invalid query or the query fails, the error will be displayed (example:
apartments
table is not in the database) -
GPT 3.5 turbo (the default model) is really good at generating complex SQL queries from your questions, so just ask away!
-
-
Locally backup and restore your conversations and settings (API keys are encrypted before backup)
Chatdb.Demo.mp4
- Open the Streamlit app in your browser:
- Go to the ⚙️ Settings page
- Provide your OpenAI API key and add some database connnections
- Go to the 🤖 Chats page
- Create a new conversation by specifying the GPT model and selecting the databases you added
- Start chatting 🗣
↔️ 🤖
Currently supported databases:
- PostgreSQL (using
psycopg2
) - MySQL and MariaDB (using
mysqlclient
) - Oracle (using
cx_oracle
) - Microsoft SQL Server (using
pyodbc
)
If your database or DB API are not here, feel free to open a feature request. Contributions are also very welcome!
If you want to build and test locally:
- Clone the repository
- Install requirements with
pip install -r requirements.txt
(recommended to use a virtual environment) - Launch the app with
streamlit run 🏠_Home.py
This project is part of an internship I performed at B.E.A.R. TELL.