SQL-GPT  by CL-lau

SQL-generating tool using LLMs for database interaction

created 2 years ago
356 stars

Top 79.5% on sourcepulse

GitHubView on GitHub
Project Summary

SQL-GPT is a tool designed to streamline database interactions by leveraging Large Language Models (LLMs). It allows users to generate, optimize, and correct SQL queries using natural language prompts, and can also interact with file systems. This is beneficial for developers and data analysts seeking to improve efficiency when working with databases and unstructured data.

How It Works

SQL-GPT utilizes LLMs to interpret natural language requests and translate them into SQL queries. It supports multi-turn dialogues for iterative query refinement and can optimize queries based on database schema. For file system interaction, it employs vector databases for indexing and retrieval, with Redis caching to accelerate lookups. The architecture supports multiple LLM providers, vector databases, and database types.

Quick Start & Requirements

  • Install dependencies: pip install requirements.txt
  • Configure config.json with OpenAI API key/base URL and database connection details.
  • Prerequisites: Python 3.x, Redis (Docker recommended), MySQL (Docker recommended).
  • Example usage: from gpt.SQLGPT import SQL_GPT; sql_GPT = SQL_GPT(); sql_GPT.generateSQL("Perform a join operation on two database tables.")
  • Documentation: Chinese Docs, English Docs

Highlighted Details

  • Automatic SQL query generation and error correction.
  • Multi-database compatibility and proxy access support.
  • SQL statement optimization and Java persistence layer SQL generation.
  • File system interaction via vector databases with Redis caching for speed.

Maintenance & Community

The project acknowledges contributions from FastChat, Vicuna, Langchain, Auto-GPT, Hugging Face, Chroma, Milvus, ChatGLM, and LlamaIndex. Further community links are not explicitly provided in the README.

Licensing & Compatibility

The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The project is marked as "Development has begun," indicating it may be in an early or unstable state. Automatic data visualization analysis and privacy protection features are listed as incomplete.

Health Check
Last commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
2 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.