Member-only story

Part 4: Chatting about company documents using RAG and Spring AI

A Step-by-Step Guide to Implementing RAG in Spring AI

Saeed Zarinfam
ITNEXT

In the previous parts of this tutorial, we learned several features of Spring AI. Our Employee Assistance chatbot can easily switch between different models (OpenAI, Llama, and DeepSeek) in part 2. We can also keep the chat history to get an answer from the model based on our previous questions and answers (part 1). We also learned how to write integration tests using Testcontainer and Ollama (part 3).

In this part, we want to expand our Employee Assistance chatbot and enable it to answer specific questions about the company's internal rules! To do so, we will use a famous technique called RAG.

Photo by Kelly Sikkema on Unsplash

· How to expand LLMs knowledge?
What is the RAG technique?
Difference between Chat history and Chat with document
· Implementing RAG using Spring AI
Advisors API
VectorStore API
Embeddings Model API
ETL Pipeline API
· Implementing Chat with document to Employee Chatbot using RAG
Adding the ETL pipeline
Embedding Model dependency
Implementing RAG using the Advisor API
Testing the result
· Final Thoughts

How to expand LLMs knowledge?

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (2)

What are your thoughts?