Spring AI RAG with PGVector and Ollama Integration#70
Open
smadil997 wants to merge 1 commit intospring-projects:mainfrom
Open
Spring AI RAG with PGVector and Ollama Integration#70smadil997 wants to merge 1 commit intospring-projects:mainfrom
smadil997 wants to merge 1 commit intospring-projects:mainfrom
Conversation
smadil997
commented
Sep 4, 2025
Author
smadil997
left a comment
There was a problem hiding this comment.
Signed-off-by: Mohdadil alisnagina@gmail.com
Signed-off-by: adil <alisnagina@gmail.com>
cccd658 to
a06b769
Compare
Author
|
Hi @tzolov please have look on this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a complete example of a Retrieval-Augmented Generation (RAG) pipeline using:
Spring AI
PGVector (running via Docker)
Ollama for embedding and chat models
Instead of installing a local PGVector DB manually, this setup runs it using Docker Compose (compose.yaml). Please ensure the database is running before starting the Spring Boot application.
⚙️ Key Features
Uses Ollama locally for LLM (gemma:3b) and embedding (nomic-embed-text:latest) models
PDF file upload endpoint at POST /upload for document ingestion
Validates PDFs for table of contents (TOC) – required by default reader
Embeds paragraphs from the PDF and stores them in a vector store using PGVector
Auto-creates vector_store table if not specified
Uses initialize-schema: true in application.yaml to recreate the schema on every app run (can be customized)