{"id":26956303,"url":"https://github.com/alokthedataguy/text-to-sql-agent","last_synced_at":"2025-09-02T11:07:43.551Z","repository":{"id":285696136,"uuid":"959019489","full_name":"AlokTheDataGuy/text-to-sql-agent","owner":"AlokTheDataGuy","description":"The Text-to-SQL Agent is designed to to interact with databases using simple, conversational language, eliminating the need for manual query writing.","archived":false,"fork":false,"pushed_at":"2025-04-11T13:27:52.000Z","size":205,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T14:48:16.526Z","etag":null,"topics":["agentic-ai","langchain","langchain-agent","llm","nextjs15","sql","sqlite","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/AlokTheDataGuy.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-04-02T06:20:25.000Z","updated_at":"2025-04-11T14:20:01.000Z","dependencies_parsed_at":"2025-04-02T07:40:39.914Z","dependency_job_id":null,"html_url":"https://github.com/AlokTheDataGuy/text-to-sql-agent","commit_stats":null,"previous_names":["alokthedataguy/text-to-sql-agent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlokTheDataGuy/text-to-sql-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlokTheDataGuy%2Ftext-to-sql-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlokTheDataGuy%2Ftext-to-sql-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlokTheDataGuy%2Ftext-to-sql-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlokTheDataGuy%2Ftext-to-sql-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlokTheDataGuy","download_url":"https://codeload.github.com/AlokTheDataGuy/text-to-sql-agent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlokTheDataGuy%2Ftext-to-sql-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273272581,"owners_count":25075991,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["agentic-ai","langchain","langchain-agent","llm","nextjs15","sql","sqlite","typescript"],"created_at":"2025-04-03T03:21:11.791Z","updated_at":"2025-09-02T11:07:43.539Z","avatar_url":"https://github.com/AlokTheDataGuy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text-to-SQL Agent\n\n## About\nThe Text-to-SQL Agent is an AI-powered tool built with Next.js that allows users to convert natural language queries into SQL commands and directly interact with a database. It utilizes LangChain, LangGraph, and Ollama to generate, execute, and refine SQL queries dynamically. The system can retrieve data from the database, enabling seamless interactions without requiring manual SQL writing.\n\n![Text-to-SQL Agent Screenshot](./public/Screenshot.png)\n\n## Features\n- **Natural Language to SQL Conversion**: Converts user queries into SQL statements.\n- **Direct Database Interaction**: Executes generated SQL queries and fetches results.\n- **Multi-Step Query Processing**: Uses LangGraph for structured query generation.\n- **Supports SQLite**: Works with SQLite databases for lightweight and fast execution.\n- **Extensible and Modular**: Easily adaptable for other databases or additional AI capabilities.\n\n## Technologies Used\n- **Next.js**: Framework for building the frontend and backend.\n- **LangChain**: For natural language processing and query generation.\n- **LangGraph**: Enables structured decision-making for SQL refinement.\n- **Ollama**: AI-powered model for query understanding.\n- **SQLite**: Lightweight relational database engine.\n\n## Installation\n\n### Prerequisites\n- Node.js (Latest LTS version recommended)\n- SQLite installed\n- WatsonX API credentials\n\n### Setup\n1. Clone the repository:\n   ```sh\n   git clone https://github.com/AlokTheDataGuy/text-to-sql-agent.git\n   cd text-to-sql-agent\n   ```\n2. Install dependencies:\n   ```sh\n   npm install\n   ```\n3. Set up environment variables in a `.env.local` file:\n   ```env\n   WATSONX_AI_ENDPOINT=your_watsonx_endpoint\n   WATSONX_AI_APIKEY=your_watsonx_apikey\n   WATSONX_AI_PROJECT_ID=your_watsonx_project_id\n   ```\n4. Run the development server:\n   ```sh\n   npm run dev\n   ```\n\n## Usage\n1. Open `http://localhost:3000` in your browser.\n2. Enter a natural language query (e.g., *\"Show me all customers who made a purchase last month\"*).\n3. The system will generate an SQL query and execute it on the database.\n4. Results will be displayed on the interface.\n\n## Contributing\n1. Fork the repository.\n2. Create a new branch: `git checkout -b feature-branch-name`.\n3. Commit your changes: `git commit -m \"Add new feature\"`.\n4. Push to the branch: `git push origin feature-branch-name`.\n5. Open a pull request.\n\n## License\nThis project is licensed under the MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falokthedataguy%2Ftext-to-sql-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falokthedataguy%2Ftext-to-sql-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falokthedataguy%2Ftext-to-sql-agent/lists"}