{"id":18498405,"url":"https://github.com/phaniteja5789/interactive-text-to-sql-query-generator-and-visualization","last_synced_at":"2026-04-20T09:32:49.130Z","repository":{"id":247616700,"uuid":"826343379","full_name":"phaniteja5789/Interactive-Text-to-SQL-Query-Generator-and-Visualization","owner":"phaniteja5789","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-25T10:19:24.000Z","size":10396,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T00:44:19.679Z","etag":null,"topics":["openai-api-chatbot","postgres","streamlit","vanna"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phaniteja5789.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-09T14:22:27.000Z","updated_at":"2024-08-20T18:06:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"35965851-6aa1-4d15-8429-922c59b74b57","html_url":"https://github.com/phaniteja5789/Interactive-Text-to-SQL-Query-Generator-and-Visualization","commit_stats":null,"previous_names":["phaniteja5789/text2sql","phaniteja5789/interactive-text-to-sql-query-generator-and-visualization"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaniteja5789%2FInteractive-Text-to-SQL-Query-Generator-and-Visualization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaniteja5789%2FInteractive-Text-to-SQL-Query-Generator-and-Visualization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaniteja5789%2FInteractive-Text-to-SQL-Query-Generator-and-Visualization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaniteja5789%2FInteractive-Text-to-SQL-Query-Generator-and-Visualization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phaniteja5789","download_url":"https://codeload.github.com/phaniteja5789/Interactive-Text-to-SQL-Query-Generator-and-Visualization/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239217107,"owners_count":19601593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openai-api-chatbot","postgres","streamlit","vanna"],"created_at":"2024-11-06T13:39:38.660Z","updated_at":"2026-04-20T09:32:49.084Z","avatar_url":"https://github.com/phaniteja5789.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text2SQL\n\nProblem Statement - Given the Input Text Prompt, we need to generate the relevant SQL responsible for that and along with that we need to Visualization Plot based on the result and along with that we need to generate the Follow-Up prompts based on the prompt we asked initially\n\nTech Stack used - Streamlit, OPENAI API, VANNA, Postgres\n\nExecution Phases\n\n  The Project has been implemented and executed in 4 Phases.\n\n  Phase - 1 ==\u003e Connection to the Database\n            ==\u003e In the 1st Phase, created a UI Page where the actual execution starts\n            ==\u003e Connection to the Database. We can connect to any database as per our requirement.\n            ==\u003e I have taken Postgres database. Once the database has been choosen, based on the database choosen, the connection string parameters will be updated\n            ==\u003e For the Postgres database, the connection string parameters are Host,UserName,Password,Port,Database\n            ==\u003e I am providing these options needs to be entered by the user.\n            ==\u003e Once these details has been entered by the user, these details will be validated and based on the validation, it will proceed further.\n            ==\u003e Once it gets connected to the database, the status will be shown to the user as below Image.\n            \u003cimg width=\"1103\" alt=\"image\" src=\"https://github.com/phaniteja5789/Text2SQL/assets/36558484/72171e10-ca5b-4a06-b86f-9c8eb109c2b8\"\u003e\n            ==\u003e After successful connect to the Database, it will navigate to the TextToSQL Page, where user can enter the chat information\n\n  Phase - 2 ==\u003e Training with Database data\n            ==\u003e Here I am using the RAG in order to train the Tabular data and schema information present in the table.\n            ==\u003e Every information will be Vectorized and the vectors will be stored in the ChromaDB\n            ==\u003e During the vectorization phase, the user will be get to know, that the data is getting vectorized as per below image.\n            \u003cimg width=\"1102\" alt=\"image\" src=\"https://github.com/phaniteja5789/Text2SQL/assets/36558484/868919c1-f088-4470-9a90-c39a4715e89b\"\u003e\n            ==\u003e After the Vectorization phase is completed, the user will get to know, the training has been completed by the status image as per below image.\n            \u003cimg width=\"1100\" alt=\"image\" src=\"https://github.com/phaniteja5789/Text2SQL/assets/36558484/5084eb7d-8bb6-45b9-b786-d86f02788b2f\"\u003e\n            ==\u003e Once the Vectorization phase is done, the user can see the training data information in the next tab of the TrainYourData page as per below image.\n            \u003cimg width=\"1102\" alt=\"image\" src=\"https://github.com/phaniteja5789/Text2SQL/assets/36558484/bd7b8244-ab6e-4ea5-a110-e7c8662ca565\"\u003e\n  \n  Phase - 3 ==\u003e Chat with your Data\n            ==\u003e Here, user can give the Input Prompt, based on the Input Prompt, the SQL query will be generated and also a CSV file will be provided as an option to download to view the result\n            ==\u003e Along with that the Plotly Chart also will be generated and along with that the Followup Prompts also will be generated where user can ask these prompts next time.\n            ==\u003e See the below Images for output\n            \u003cimg width=\"1101\" alt=\"image\" src=\"https://github.com/phaniteja5789/Text2SQL/assets/36558484/ac9ff77e-f556-4da3-b151-e209611a1bec\"\u003e\n            \u003cimg width=\"1102\" alt=\"image\" src=\"https://github.com/phaniteja5789/Text2SQL/assets/36558484/8563cf2a-fad4-4c26-8961-ae37e6b1cfa7\"\u003e\n            \u003cimg width=\"1099\" alt=\"image\" src=\"https://github.com/phaniteja5789/Text2SQL/assets/36558484/e77d0f3f-9d36-46f8-8700-6eb28ff73beb\"\u003e\n            \u003cimg width=\"739\" alt=\"image\" src=\"https://github.com/phaniteja5789/Text2SQL/assets/36558484/5034f0fb-6b82-435f-ae0c-c31b3aa54769\"\u003e\n\n  Phase - 4 ==\u003e Cache Details\n            ==\u003e Whatever the Input Prompts user has entered and whatever the SQL Responses generated are stored in the QuestionsANDResponses Page. \n            ==\u003e Attached the below image for the cache details\n            \u003cimg width=\"1103\" alt=\"image\" src=\"https://github.com/phaniteja5789/Text2SQL/assets/36558484/bd464d36-2681-444e-8032-ced88d972aed\"\u003e\n\nThe development phase can be extended with use cases like generating the summary of the schema etc.\n\nThe Output can be seen in the TextToSQL.mp4 file which is part of this repository.\n\n\n\n            \n\n\n            \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaniteja5789%2Finteractive-text-to-sql-query-generator-and-visualization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphaniteja5789%2Finteractive-text-to-sql-query-generator-and-visualization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaniteja5789%2Finteractive-text-to-sql-query-generator-and-visualization/lists"}