Email the Author
You can use this page to email Fu Cheng about Text-to-SQL, Spring AI Implementation with RAG.
About the Book
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 book, 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 use Spring Cloud Function to deploy Text-to-SQL application and metadata indexer as serverless functions and run them on AWS Lambda.
This book 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 book, can help you build other AI applications using Spring AI.
About the Author
Full-stack software developer and content creator.