RAG assistant returns high-similarity but irrelevant passages from vector DB on production queries
Environment
Production RAG service: embedding model OpenAI text-embedding-3-small, vector DB: self-hosted Milvus, chunking pipeline produces 1–2 KB passages with metadata, retriever uses cosine similarity and returns top 10 hits; downstream LLM (gpt-4o-mini) consumes hits and generates answers.
Symptoms
Users report the assistant returns confident paragraphs that do not answer the question: retrieved passages have high similarity scores but are tangential or contain outdated references. This happens more on long, multi-part queries. Local manual searches in the vector DB for the same query find different top hits than the production retrieval returns.
Observations
Query embedding vectors logged show unusually low norm variance compared to document embeddings. Similarity scores for top hits cluster tightly (0.88–0.91) even when relevance judged poor. Milvus reports no errors; index info shows IVF index with nlist=1024 and runtime_search_params = {nprobe: 8}. The chunker produced overlapping chunks but some chunks lack clear context metadata (source document IDs missing). Retriever uses an approximate index + then filters by metadata, but metadata filtering sometimes excludes the best matches.
Already attempted
Re-run retrieval locally using exact cosine on stored vectors — results differ: exact search surfaces more relevant chunks that were missing from approximate index top-10. Rebuilt the Milvus index with higher nlist and increased nprobe to 32 in a test cluster; relevance improved but query latency increased. Examined prompting: LLM prompt contains a strict instruction to prefer text from 'source' metadata, but many chunks lacked complete metadata.
Question
How do I diagnose whether the root cause is embedding quality, vector index approximation parameters, chunking metadata loss, or prompt/selection logic, and what reversible tuning or tests should I run to improve RAG relevance without risking production downtime?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Artificial Intelligence38% match
Vector search returns semantically unrelated high-similarity passages after incremental index update
Open0 answers - Artificial Intelligence35% match
Dense vector index returns stale document IDs and wrong passages after incremental update job — RAG answers become semantically irrelevant
Open0 answers - Artificial Intelligence26% match
Incremental vector index job leaves stale vectors and duplicate document IDs — RAG answers cite deleted passages
Open0 answers