# SuperSQL **Repository Path**: guocjsh/supersql-open ## Basic Information - **Project Name**: SuperSQL - **Description**: SuperSQL 是一个基于国内外先进生成式大模型实现Nl2SQL的Java框架,专注于将数据库表结构通过检索增强生成(RAG, Retrieval-Augmented Generation)技术进行训练,从而实现从自然语言文本到SQL查询的智能转换(Text to SQL)。该框架旨在简化复杂的数据库查询过程,使开发者和用户能够通过简单的自然语言描述获取所需数据。 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: http://www.ai-space.com.cn/ - **GVP Project**: Yes ## Statistics - **Stars**: 223 - **Forks**: 74 - **Created**: 2025-01-13 - **Last Updated**: 2025-09-11 ## Categories & Tags **Categories**: ai **Tags**: None ## README

logo

Super SQL 1.0.0-M1

A Lightweight, Easy-to-Use, and Extensible SQL Generation Framework for Java!

--- ### Introduction to Super SQL Super SQL is a Java framework based on advanced generative large models, focusing on transforming database table structures through Retrieval-Augmented Generation (RAG) technology into intelligent conversions from natural language text to SQL queries (Text to SQL). This framework aims to simplify complex database query processes, enabling developers and users to obtain the required data through simple natural language descriptions. Key features include: - **Generative SQL**: Automatically converts natural language questions into precise SQL query statements using powerful generative large models. - **RAG Training**: Trains database table structures using retrieval-enhanced generation technology to improve the accuracy and efficiency of SQL generation. - **Type Safety and Ease of Use**: Combines Java's generics mechanism to ensure compile-time type checking, while providing a concise and intuitive API design that is easy to integrate into existing projects. - **Multi-database Support**: Compatible with multiple mainstream database systems to meet the needs of different application scenarios. - **Performance Optimization**: Carefully designed and optimized to ensure efficient execution while maintaining good readability. Super SQL is suitable for applications that require fast and secure complex database operations in Java, and wish to quickly empower traditional enterprise applications with AI through natural language processing technology. ### How Super SQL Works Super SQL operates based on RAG technology, training database table structures using retrieval-enhanced generation techniques to achieve intelligent conversion from natural language text to SQL queries. ![super-sql-ai](https://tiger-bucket.oss-cn-shanghai.aliyuncs.com/super-sql/how-to-work.png) ### Super-Sql Quick Start Add the Maven dependency for Super SQL: ```xml com.aispace.supersql super-sql-spring-boot-starter 1.0.0-M1-SNAPSHOT ``` Add dependencies for specific models: ```xml org.springframework.ai spring-ai-azure-openai-spring-boot-starter org.springframework.ai spring-ai-chroma-store-spring-boot-starter ``` ```java // Using Azure Chat model private final AzureOpenAiChatModel azureChatModel; private final SpringSqlEngine sqlEngine; private final SpringVectorStore store; @GetMapping("getSuperSql") public Object getSuperSql(@RequestParam String question) { String sql = sqlEngine.setChatModel(azureChatModel).generateSql(question); Object object = sqlEngine.executeSql(sql); return object; } ``` Spring-Ai official documentation:[https://docs.spring.io/spring-ai/docs/getting-started](https://docs.spring.io/spring-ai/docs/getting-started) ### Related Links - [[ Spring-AI ]](https://spring.io/projects/spring-ai): Spring AI is an application framework for AI engineering. Its goal is to apply Spring ecosystem design principles (such as portability and modular design) to the AI field, promoting the use of POJOs as building blocks for AI applications. ### Code Repository - Gitee: [https://gitee.com/guocjsh/super-sql](https://gitee.com/guocjsh/super-sql)