Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Text-to-SQL Spring AI Implementation with RAG
Rating: 3.9 out of 5(6 ratings)
58 students

Text-to-SQL Spring AI Implementation with RAG

Build a Text-to-SQL application using Spring AI 1.1
Created byFu Cheng
Last updated 11/2025
English

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

Course content

10 sections41 lectures2h 57m total length
  • Course introduction2:11

    Introduction of this Spring AI course.

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.

  • How to create a Text-to-SQL MCP server using Spring AI and MCP Java SDK.

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.


The code has been updated to Spring AI 1.1 release version.


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