← All posts

2026-06-15

Building a RAG Pipeline with Spring Boot and pgvector

RAGRetrieval Augmented GenerationJavaSpring BootPostgreSQLpgvectorVector EmbeddingsSimilarity SearchOpenAI APILLMAI EngineeringDeveloper Tools

Placeholder post — replace this with the full write-up.

The problem

Understanding an unfamiliar Git repository takes hours of reading commits, diffs, and docs. What if you could just ask the repository questions in natural language?

Architecture overview

  • Ingestion: parse repository data (commits, diffs, file contents) into chunks.
  • Embeddings: generate vector embeddings for each chunk via the OpenAI API.
  • Storage: persist vectors in PostgreSQL using the pgvector extension.
  • Retrieval: similarity search over vectors to find relevant context.
  • Generation: pass retrieved context to an LLM to answer the user's question.

Why pgvector

Keeping vectors in PostgreSQL avoids introducing a separate vector database — one less system to operate, with transactional consistency alongside relational metadata.

Key learnings

More on this soon — this is a placeholder to be expanded.