Text-to-SQL Spring AI Implementation with RAG
What you'll learn
- Learn how to use Spring AI 1.0 to build AI applications
- Text-to-SQL implementation using LLM and RAG
- Database metadata searching using vector store
- Function calling in Spring AI to execute SQL statements
Requirements
- Basic knowledge of Java
- Basic knowledge of Spring & Spring Boot
- Basic knowledge of LLM
Description
Building AI applications is very popular these days. For Java developers, the best choice for building AI applications is using Spring AI. To learn how to use Spring AI to build AI applications, we need to have a concrete example. Text to SQL, is a typical usage of using AI to improve productivity. By using text to SQL, non-technical people use natural language to describe database query requirements. These queries are sent to LLM. LLM can generate SQL statements to answer user queries. LLM can also use tools to execute SQL statements, and return the query results to the user. Text to SQL is a good example of AI applications.
In this course, we will use Spring AI to create a text to SQL application. After learning this course, you will know:
How to use ChatClient to send requests to LLM and receive responses.
How to extract database metadata and include them in the prompt sent to LLM.
How to use Spring AI advisors to intercept ChatClient requests to process requests and responses.
How to use embedding model and vector store to implement semantic search of database metadata.
How to use LLM to generate summary of database tables and SQL statements.
How to use LLM to re-select tables automatically.
How to allow user to manually re-select tables using message history.
How to execute and validate SQL statements using functions.
How to deployment metadata indexer and Text-to-SQL application as serverless functions on AWS Lambda.
How to store table metadata in a database.
This course covers all major aspects of Spring AI, including ChatClient, advisors, embedding models, vector stores, chat memory and function calling.
What you have learned in this course can help you build other AI applications using Spring AI.
You can also get a free copy of the PDF book.
Source code: This course provides full source code of the text to SQL application. The source code can be downloaded from resource of 5th lecture. You can also send me your GitHub account email to access the private GitHub repository.
Who this course is for:
- Java developer curious about building AI applications using Spring AI
Instructor
Senior software architect and full stack developer with 17 years of experience.
Author of <Understanding Java 7>, <Exploring Java 9>, <Build Cloud Native Microservices with Quarkus>. E-books published on Leanpub, <From Java 11 to Java 17>, <From Java 17 to Java 21>, and <JUnit 5 Cookbook>.
Instructor of free and paid courses.