ChatQL is an intuitive and user-friendly application that allows users to interact with their SQL database using natural language queries. Type in your questions or requests, and ChatQL will generate the appropriate SQL query and return the data you need. No more complex SQL queries or digging through tables - ChatQL makes it easy to access your data! By bringing data one step closer, ChatQL empowers users to make data-driven decisions faster and more efficiently, reducing the barriers between users and the insights they seek.
- Interactive and user-friendly interface
- Integration with PostgreSQL and Snowflake Data Warehouse
- Utilizes OpenAI's GPT-4 and text-embedding-ada-002
- Uses In-memory Vector Database FAISS for storing and searching through vectors
- Install the required packages:
pip install -r requirements.txt
- Run the Streamlit app to start chatting:
streamlit run app.py
- Select your database from dropdown and enter required credentials like Set up your
OPENAI_API_KEY
, PostgreSQL'sHOST
,PORT
,DATABASE
,USERNAME
,PASSWORD
andSCHEMA
or Snowflake'sACCOUNT
,USER_NAME
,PASSWORD
,ROLE
,DATABASE
,SCHEMA
andWAREHOUSE
. If you don't have access to GPT-4 change the script in chain.py replace gpt-4 in model_name to gpt-3.5-turbo. - And submit, It will now generate the schema of tables from database and store into a md file.
- Now chat with your data.
- Launch the app by visiting the URL provided by Streamlit.
- Type your query in natural language or SQL format in the input box and enter to generate the response.
- The chatbot will generate a response based on your query and display the result, including any relevant data or SQL code.