-
Notifications
You must be signed in to change notification settings - Fork 19
🧠MindSQL
MindSQL is a Python Library that uses RAG (Retrieval-Augmented Generation) to create precise SQL queries tailored to your database with the help of Large Language Models.
MindSQL follows a simple two-step procedure to streamline your database interactions: firstly, it indexes the specifics of your database into a vector store, thus creating a RAG "model" tailored to your data. Subsequently, it formulates SQL queries in response to your inquiries, enabling seamless execution on your database.
To make the most of MindSQL's capabilities, you'll primarily interact with two key functions:
-
minds.index(...)
: This function plays a pivotal role in the initial step by allowing you to index your database-specific details into the vector store. This information serves as a foundational corpus for subsequent SQL query generation. -
minds.ask_db(...)
: This function facilitates direct communication with your database. It allows you to pose questions and leverages the context stored in the vector store to construct SQL queries that precisely address your questions.
MindSQL consists of three fundamental components:
Database Interface: This component is dedicated to managing database-related functionalities.
Vectorstore Interface: The vectorstore focuses on storing and organizing the indexed database context, serving as a crucial reference corpus for query generation.
LLMS Interface: The LLMS interface handles the integration of large language models into the MindSQL framework, enhancing the library's ability to comprehend and generate contextually relevant SQL queries.