My Computer World







  

DocAssist4U - How to set up Java/Ollama/Qdrant for GenAI

 

The Idea


I want to be able to ask DocAssist4U (that's what I am calling this GenAI Bot) questions about documents that have been loaded into the system via the upload option on the webpage.

 

There will be a single webpage that will allow the user to enter a question and after submitting the question the screen should display "processing" and disable the send button.

 

There will be an upload PDF option which will upload the PDF to be processed and embedded into the Qdrant Database.

 

What is needed?


To achieve this, I have used the following tech stack.

 

  • Java 21  (Long-Term Support release.)
  • Spring Boot 3.3.3
  • Spring AI 0.8.1
  • Qdrant client 1.7.1
  • Qdrant server 1.12.4 (Running on Docker desktop)
  • Ollama client (spring ai Ollama 0.8.1)
  • Ollama server 0.4.7

Qdrant set up.

To set up Qdrant on Docker, you will need to install Docker. I used the Docker desktop for Windows 11.
https://www.docker.com/products/docker-desktop/

In Docker desktop, I searched for a container that matched qdrant/qdrant as shown below:-


In Docker desktop, click on the version you want to run as a container and then click the "play" button.




The Qdrant server should now be running on port 6333/6334.


Application setup.

The structure of the application is broken down into these areas.





Copyright © 2024 MyComputerWorld.co.uk

My Computer World
Retro Gaming in a modern world.