Gustavo Araujo Dunhão’s Post

Most RAG tutorials stop at "just use the advisor and it works." But when your RAG system gives a weird answer at 2am, you need to know what happened underneath. What chunks did it actually retrieve? Were they even relevant? What score did they get? I just published the third post in my Spring AI RAG series — this time we skip the QuestionAnswerAdvisor entirely and go straight to the vector store. What you'll learn: → How to run similarity searches directly against PgVectorStore → Why similarity thresholds matter (and why the default "return everything" is dangerous) → How to inspect raw embeddings to see what the model actually "sees" → Practical tips for tuning topK and threshold values → How to peek into the PostgreSQL vector_store table with raw SQL The key insight that changed how I think about RAG: topK always returns K results, no matter how bad they are. Ask about baking a cake when your store only has Spring AI docs? You'll still get 5 results. Setting a similarity threshold fixes this — and it's one line of code. Read the full post: https://lnkd.in/dJpR4bKT Source code (clone and run): https://lnkd.in/dGSs_Hsg If you found this useful, I'd really appreciate a share — it helps more people discover the series. 🙏 #SpringAI #RAG #Java #VectorStore #pgvector #Ollama #AIEngineering #LLM #SpringBoot

  • graphical user interface

To view or add a comment, sign in

Explore content categories