Spring AI based web application whose purpose is to demonstrate how to easily build RAG applications on Spring stack.
All models runs locally which is requires OLLAMA.
Frontend
Backend
Retrieval-augmented generation (RAG) is a technique for enhancing the accuracy and reliability of generative AI models with facts fetched from external sources.
Implement RAG based on lectures of subject:
- Find related literature
- Convert to txt/pdf
- embed all of them
Unfortunately OLLAMA docker image requires NVIDIA GPU drivers see issue. The only way to run it locally, is manual build.
docker compose up --build
docker compose up -d
- Install Ollama
- Pull models
ollama pull nomic-embed-text:latest #you can choose your own model
ollama pull llama3.1:latest #you can choose your own model
ollama serve
- Run Postgres using docker
docker run -d \
--name pgvector-container \
-e POSTGRES_DB=core \
-e POSTGRES_PASSWORD=admin \
-e POSTGRES_USER=admin \
-p 5432:5432 \
-v pgvector-data:/var/lib/postgresql/data \
--label "org.springframework.boot.service-connection=postgres" \
pgvector/pgvector:pg16
- Build and Run Web
cd web
npm i
npm start
- Build and Run Backend
cd core
gradle bootRun