{"id":23922458,"url":"https://github.com/paraglondhe098/sql-manager-ai-agent","last_synced_at":"2026-04-18T12:02:25.144Z","repository":{"id":271088866,"uuid":"912367551","full_name":"paraglondhe098/sql-manager-ai-agent","owner":"paraglondhe098","description":"Incorporating AI agent to manage a SQL database.","archived":false,"fork":false,"pushed_at":"2025-01-05T12:05:50.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T22:27:50.319Z","etag":null,"topics":["ai-agent","database","llm","mysql","sql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paraglondhe098.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-01-05T11:34:41.000Z","updated_at":"2025-01-10T18:59:50.000Z","dependencies_parsed_at":"2025-01-05T12:29:51.857Z","dependency_job_id":"b110ec09-b25b-4a0c-b9a2-b41cf237e53c","html_url":"https://github.com/paraglondhe098/sql-manager-ai-agent","commit_stats":null,"previous_names":["paraglondhe098/sql-manager-ai-agent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paraglondhe098/sql-manager-ai-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraglondhe098%2Fsql-manager-ai-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraglondhe098%2Fsql-manager-ai-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraglondhe098%2Fsql-manager-ai-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraglondhe098%2Fsql-manager-ai-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paraglondhe098","download_url":"https://codeload.github.com/paraglondhe098/sql-manager-ai-agent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraglondhe098%2Fsql-manager-ai-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31967993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["ai-agent","database","llm","mysql","sql"],"created_at":"2025-01-05T17:14:04.704Z","updated_at":"2026-04-18T12:02:25.107Z","avatar_url":"https://github.com/paraglondhe098.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQL Database Management System with AI Assistant\n\nAn intelligent SQL database management system that combines traditional SQL capabilities with AI-powered natural language processing. This system allows users to interact with their databases using both direct SQL queries and natural language commands.\n\n## 🌟 Features\n\n- **Dual Query Interface**\n  - Traditional SQL query execution with AI error explanation support.\n  - AI agent query execution.\n- **Interactive Web UI** powered by Streamlit\n- **Smart Query Processing**\n  - Automatic query validation\n  - Intelligent error handling and suggestions\n- **Export Capabilities**\n  - Export results as CSV\n  - Export results as JSON\n- **Query History** tracking\n- **Database Information** display\n\n## 🛠️ Technology Stack\n\n- **Backend**\n  - Python 3.8+\n  - SQLAlchemy (Database ORM)\n  - LangChain (AI Integration)\n  - PyMySQL (MySQL Connector)\n- **Frontend**\n  - Streamlit\n- **AI Model**\n  - Groq LLM (llama3-8b-8192) (configurable)\n- **Database**\n  - MySQL\n\n## 📋 Prerequisites\n\n- Python 3.8 or higher\n- MySQL Server\n- Groq API access\n- Required Python packages (see `requirements.txt`)\n\n## ⚙️ Installation\n\n1. Clone the repository:\n```bash\ngit https://github.com/paraglondhe098/sql-manager-ai-agent.git\ncd sql-manager-ai-agent\n```\n\n2. Create and activate a virtual environment (Optional):\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n3. Install required packages:\n```bash\npip install -r requirements.txt\n```\n\n4. Create a `.env` file in the project root with your configuration (For testing purpose):\n```env\nMYSQL_USER=your_username\nMYSQL_PASSWORD=your_password\nMYSQL_HOST=your_host\nMYSQL_DATABASE_NAME=your_database\nGROQ_API_KEY=your_groq_api_key\n```\n\n## 🚀 Usage\n\n1. Start the application:\n```bash\nstreamlit run app.py\n```\n\n2. Open your web browser and navigate to `http://localhost:8501`\n\n3. Connect to your database using the sidebar options\n\n4. Choose your preferred query method:\n   - **SQL Console**: Direct SQL query execution\n   - **AI Assistant**: Natural language query processing\n\n## 💻 Code Structure\n\n```\nsql-management-system/\n├── app.py                 # Main Streamlit application\n├── utils/\n│   ├── dbmanager.py      # Database connection and query management\n│   ├── agent.py          # AI agent for natural language processing\n│   └── __init__.py\n├── requirements.txt       # Project dependencies\n└── .env                  # Environment variables\n```\n\n## 🔒 Security Features\n\n[//]: # (- Query validation to prevent harmful operations)\n[//]: # (- Connection pooling)\n- Input sanitization\n- Secure credential management\n- Error handling and recovery\n\n\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a new branch (`git checkout -b feature/improvement`)\n3. Make changes and commit (`git commit -am 'Add new feature'`)\n4. Push to the branch (`git push origin feature/improvement`)\n5. Create a Pull Request\n\n## 📝 Example Usage\n\n### SQL Console\n```sql\nSELECT * FROM users WHERE age \u003e 25;\n```\n\n### AI Assistant\n```\nShow me all users who are over 25 years old\n```\n\nBoth queries will produce the same result, but the AI Assistant allows for natural language input.\n\n## ⚠️ Important Notes\n\n- Always backup your database before performing write operations\n- Test queries in a development environment first\n- Keep your environment variables secure\n- Monitor query performance with large datasets\n\n## 🔄 Future Improvements\n\n- [ ] Add query result caching\n- [ ] Implement comprehensive testing suite\n- [ ] Add support for more database types\n- [ ] Enhance AI model capabilities\n- [ ] Add user authentication\n- [ ] Implement query optimization suggestions\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 📧 Contact\n\nFor questions and support, please open an issue in the GitHub repository.\n\n[//]: # (or contact [your-email@example.com]\u0026#40;mailto:your-email@example.com\u0026#41;.)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparaglondhe098%2Fsql-manager-ai-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparaglondhe098%2Fsql-manager-ai-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparaglondhe098%2Fsql-manager-ai-agent/lists"}