{"id":26233579,"url":"https://github.com/anuj0918/data-science-task","last_synced_at":"2026-04-27T01:31:05.336Z","repository":{"id":282047591,"uuid":"947239019","full_name":"Anuj0918/Data-science-Task","owner":"Anuj0918","description":"Data science Technical Writer Task ","archived":false,"fork":false,"pushed_at":"2025-03-12T14:37:10.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T14:45:34.875Z","etag":null,"topics":["llama-index","python","sql","sqlite"],"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/Anuj0918.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":"2025-03-12T11:24:17.000Z","updated_at":"2025-03-12T14:37:13.000Z","dependencies_parsed_at":"2025-03-12T14:45:37.135Z","dependency_job_id":"168659d9-7063-48c5-862a-e417b488798b","html_url":"https://github.com/Anuj0918/Data-science-Task","commit_stats":null,"previous_names":["anuj0918/data-science-task"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anuj0918%2FData-science-Task","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anuj0918%2FData-science-Task/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anuj0918%2FData-science-Task/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anuj0918%2FData-science-Task/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anuj0918","download_url":"https://codeload.github.com/Anuj0918/Data-science-Task/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243318766,"owners_count":20272144,"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":["llama-index","python","sql","sqlite"],"created_at":"2025-03-13T01:16:31.326Z","updated_at":"2025-12-30T01:59:20.606Z","avatar_url":"https://github.com/Anuj0918.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RAG and Text-to-SQL Query in Single Interface\n\nThis project builds a RAG and Text-to-SQL query app in a single interface. We use:\n\n- **OpenAI** to power the LLM capabilities  \n- **LlamaIndex** for orchestrating the RAG app  \n- **SQL Database** for storing and processing data from CSV files.  \n- **Streamlit** Provides an interactive and user-friendly UI. \n\n\n\n## 🧵 Twitter Thread  \n**[X Thread](https://typefully.com/t/EJEGoEp)** \n\n---\n\n## 🚀 Installation and Setup  \n\n## 1️. Setup OpenAI and LlamaCloud\n\nGet an API key from [OpenAI](https://openai.com) and set it in the `.env` file:\n\nGet an API key from [Llama Cloud](https://www.llama.cloud) and set it in the `.env` file:\n\n\n```ini\nOPENAI_API_KEY=\"your-openai-api-key\"\n\nname=\"your-llama-cloud-index-name\"\nproject_name=\"your-llama-cloud-project-name\"\norganization_id=\"your-llama-cloud-organization-id\"\napi_key=\"your-llama-cloud-api-key\"\n```\n## 2. Install Dependencies and Run the App\n   \n```ini  \n  pip install streamlit llama-index openai sqlalchemy python-dotenv nest-asyncio\n ```\n## How to Use\n\n1. **Upload a CSV file** using the file uploader in the main interface.\n2. **Ask questions** in natural language in the text input field, such as:\n   - \"Tell me about the history of Los Angeles City.\"\n   - \"Which states have cities with populations over 1 million?\"\n3. The application will **automatically determine** whether to use SQL or RAG to answer your question and display the results.\n\n### How It Works:\nThe system **routes queries** between:\n- **Text-to-SQL Tool** → Translates natural language into SQL queries for structured data analysis.\n- **Llama Cloud RAG Tool** → Retrieves information from a knowledge base for contextual answers.\n\n\n```ini  \n  streamlit run app.py\n ```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuj0918%2Fdata-science-task","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanuj0918%2Fdata-science-task","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuj0918%2Fdata-science-task/lists"}