cd /news/artificial-intelligence/my-rag-retrieval-quality-is-tanking-… · home topics artificial-intelligence article
[ARTICLE · art-99122] src=promptcube3.com ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

My RAG retrieval quality is tanking as my dataset grows

A developer reports that retrieval precision in their RAG pipeline degrades as the dataset grows, using SentenceTransformer's all-MiniLM-L6-v2 and FAISS IndexFlatIP with L2-normalized vectors. They are considering switching to HNSW or IVF indexes, adding a Cross-Encoder reranker, and improving metadata filtering to address the issue.

read3 min views1 publishedAug 16, 2026
My RAG retrieval quality is tanking as my dataset grows
Image: Promptcube3 (auto-discovered)

I've been building a

Since I'm using

I'm noticing that cosine similarity often retrieves chunks that are semantically related but logically useless for the actual answer. I'm thinking about adding a reranker stage—pulling 50 candidates via FAISS and then narrowing it down to the top 5 using a Cross-Encoder. Does this actually solve the precision issue, or is it just adding latency to the pipeline?

I'm using

Right now, I store metadata in a separate Python list (

RAGpipeline usingSentenceTransformer

and FAISS. On a tiny test set, everything looks great, but as I scale up, I'm hitting a wall with retrieval precision. I'm currently using IndexFlatIP

with L2-normalized vectors to simulate cosine similarity. It's basically a brute-force search, which is fine for a few hundred documents, but I'm worried about the latency and accuracy trade-offs as I move toward a real-world deployment.Here is the core of my current implementation:

class VectorStore:

 def __init__(self):
 self.model = SentenceTransformer(EMBEDDING_MODEL)
 self.index = None
 self.chunks = []

 def build(self, chunks):

 self.chunks = chunks

 texts = [chunk["text"] for chunk in chunks]

 embeddings = self.model.encode(
 texts,
 convert_to_numpy=True,
 show_progress_bar=True
 ).astype("float32")

 faiss.normalize_L2(embeddings)

 dimension = embeddings.shape[1]

 self.index = faiss.IndexFlatIP(dimension)
 self.index.add(embeddings)

 def search(self, query, k=5):

 query_embedding = self.model.encode(
 [query],
 convert_to_numpy=True
 ).astype("float32")

 faiss.normalize_L2(query_embedding)

 scores, indices = self.index.search(
 query_embedding,
 k
 )

 results = []

 for score, index in zip(scores[0], indices[0]):
 if index == -1:
 continue

 results.append({
 "text": self.chunks[index]["text"],
 "chunk_id": self.chunks[index]["chunk_id"],
 "score": float(score)
 })

 return results

I've realized that just having "similar" vectors isn't enough for a production-grade AI workflow. I have a few specific technical hurdles I'm trying to clear:

The Indexing Bottleneck #

Since I'm using

IndexFlatIP

, every query scans the entire index. I'm considering switching to IndexHNSWFlat

or IndexIVFFlat

to speed things up, but I'm unsure about the recall hit. In a practical tutorial for RAG, you often see HNSW recommended for speed, but is the memory overhead worth it compared to something like IndexIVFPQ

for larger datasets?## The "Vector Search is Not Enough" Problem

I'm noticing that cosine similarity often retrieves chunks that are semantically related but logically useless for the actual answer. I'm thinking about adding a reranker stage—pulling 50 candidates via FAISS and then narrowing it down to the top 5 using a Cross-Encoder. Does this actually solve the precision issue, or is it just adding latency to the pipeline?

Embedding Model Selection #

I'm using

all-MiniLM-L6-v2

because it's fast, but I suspect it's the weak link. Should I be focusing on Recall@K metrics when picking a new model, or does the choice of embedding model actually impact how the FAISS index behaves?## Metadata Filtering Struggles

Right now, I store metadata in a separate Python list (

self.chunks

) and map it back via indices. This makes filtering (e.g., "only search within document_X") a nightmare because I have to filter afterthe search, which ruins my Top-K results. I need a better way to handle filtered vector search without iterating through the entire result set manually.Next My CMAKE_BUILD_TYPE checks are failing on Windows with MSVC →

Free AI toolbox — all free to use

Step-by-step guides and pitfalls for this path are in

an AI side-hustle playbook, with plenty of directly applicable cases.## All Replies (4)

S

K

Welcome to the club. Mine started hallucinating wild stuff the second I hit 1k docs.

0

J

Are you using a specific chunking strategy or just splitting by character count?

0

── more in #artificial-intelligence 4 stories · sorted by recency
thewatershed.markpesce.com · · #artificial-intelligence
AI Comes Home
── more on @sentencetransformer 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/my-rag-retrieval-qua…] indexed:0 read:3min 2026-08-16 ·