{"id":20011409,"url":"https://github.com/jorgeandrespadilla/sql-agent","last_synced_at":"2025-07-08T12:07:02.640Z","repository":{"id":224833229,"uuid":"764293952","full_name":"jorgeandrespadilla/sql-agent","owner":"jorgeandrespadilla","description":"SQL Agent powered by LLMs","archived":false,"fork":false,"pushed_at":"2024-05-24T03:00:09.000Z","size":295,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T10:01:47.592Z","etag":null,"topics":["langchain","llm","openai","poetry","python","sql","streamlit"],"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/jorgeandrespadilla.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-02-27T20:26:29.000Z","updated_at":"2025-03-05T13:15:08.000Z","dependencies_parsed_at":"2025-01-12T14:45:03.323Z","dependency_job_id":"9567d3dd-0443-477e-a79c-091f1294253d","html_url":"https://github.com/jorgeandrespadilla/sql-agent","commit_stats":null,"previous_names":["jorgeandrespadilla/sql-agent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jorgeandrespadilla/sql-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgeandrespadilla%2Fsql-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgeandrespadilla%2Fsql-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgeandrespadilla%2Fsql-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgeandrespadilla%2Fsql-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jorgeandrespadilla","download_url":"https://codeload.github.com/jorgeandrespadilla/sql-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgeandrespadilla%2Fsql-agent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264267071,"owners_count":23581929,"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":["langchain","llm","openai","poetry","python","sql","streamlit"],"created_at":"2024-11-13T07:25:49.375Z","updated_at":"2025-07-08T12:07:02.615Z","avatar_url":"https://github.com/jorgeandrespadilla.png","language":"Python","readme":"# SQL Agent\n\nThis is a simple SQL Agent that can be used to run SQL queries against a database using LLMs. The main advantages of using the SQL Agent are:\n- It can answer questions based on the databases’ schema as well as on the databases’ content (like describing a specific table).\n- It can recover from errors by running a generated query, catching the traceback and regenerating it correctly.\n- It can query the database as many times as needed to answer the user question.\n- It will save tokens by only retrieving the schema from relevant tables.\n\n## Setup\n\n\u003e Before you start, you need to install `poetry`.\n\n1. Clone the repository\n2. Install the dependencies: `poetry install`\n3. Activate the virtual environment: `poetry shell`\n4. Configure the environment variables in the `.env` file (use the `.env.example` as a template)\n5. Initialize the database: `python -m scripts.init_db`\n\n## Running the Agent\n\nTo run the agent in CLI, you can use the following command:\n\n```bash\npython main.py\n```\n\nTo run the agent in Streamlit, you can use the following command:\n\n```bash\nstreamlit run main.py\n```\n\n## Additional Information\n\nFor more information, please refer to the [Agents LangChain documentation](https://python.langchain.com/docs/use_cases/sql/agents).\n\nFor more information about using LLMs with Streamlit, please refer to the [Streamlit documentation](https://docs.streamlit.io/knowledge-base/tutorials/llm-quickstart).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgeandrespadilla%2Fsql-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjorgeandrespadilla%2Fsql-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgeandrespadilla%2Fsql-agent/lists"}