---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

Search & Discovery

8 min read

Updated 2026-07-13

# How Do I Debug Bad Retrieval Results in RAG and Vector Search?

Bad retrieval fails in one of five layers (corpus, embedding space, query, filters, or fusion) and each layer's failure masquerades as the one below it. A practical debugging methodology: the five-layer checklist, why raw similarity scores mislead, stage-boundary tracing with a real silent-decimation incident, and what a retrieval explain plan should contain.

![Ethan Steininger](/people/ethan.webp)

By [Ethan Steininger](/blog/authors/ethan), Founder & CEO, Mixpeek

Retrieval Debugging

RAG

Vector Search

Explainability

Observability

[Run this on your own data. Try it as you read.Search your own archive →](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=guide_cta&utm_campaign=mvs_onramp)

[One-click templatesStart from a templateEach template deploys a working search app on your own files.Browse templates](/templates)

## The Short Answer

  
  
Bad retrieval almost always fails in one of five layers (the corpus, the embedding space, the query, the filters, or the fusion/rerank stage) and the fastest way to find which one is to trace a single failing query through each layer with its intermediate outputs, rather than tweaking prompts or swapping models blind. Similarity scores alone will not tell you: a cosine score is only meaningful relative to the query's own score distribution, so debugging is about comparing candidates within a query, checking what each pipeline stage received and dropped, and probing the embedding space directly.  
  

## Which layer is failing? The five-layer checklist

  
  

Layer

Symptom

First check

Corpus / ingest

The right document can never be found

Is it indexed at all? Was its text/frames actually extracted, or did ingest silently skip it?

Embedding space

Results are topically adjacent but wrong

Embed the query and the expected document; check the expected doc's rank among the query's neighbors

Query formulation

Works when rephrased

Compare retrieval for the raw query vs a [rewritten/expanded one](/guides/query-transformation-pipelines-for-agentic-retrieval)

Filters

Fewer results than expected, or none

Count candidates before and after each filter; check for silent drops on missing fields

Fusion / rerank

Right docs retrieved, wrong order

Inspect per-source contributions [before and after fusion](/guides/hybrid-search-fusion-rrf-score-normalization)

  
  
Work top to bottom: each layer's failure masquerades as the one below it, and hours get lost tuning a reranker when the real problem is that ingest never extracted the slide text.  
  

## Why can't I just read the similarity scores?

  
  
Because raw scores are not calibrated. Cosine similarities live in model-specific bands (a [SigLIP](/models/siglip-base-patch16-224) 0.3 can mean a strong match while an OpenAI-embedding 0.3 is noise), scores drift across model versions, and cross-modal scores sit in systematically different ranges than same-modality ones: the [modality gap](/guides/modality-gap-cross-modal-retrieval). Two rules of thumb: compare scores only WITHIN a single query's result list, never across queries or models; and look at the gap structure (a cliff after result 3 usually means the tail is noise; a flat band means the query didn't discriminate at all). If you need scores that behave like probabilities, that is a separate engineering step: [calibrating similarity scores](/guides/calibrating-similarity-scores).  
  

## How do I trace a query through a multi-stage pipeline?

  
  
The single most effective technique: capture the document COUNT and a few document IDs at every stage boundary, then find the boundary where the expected document disappears. Real production example from our own incident log: a two-stage search-then-summarize pipeline where search returned 20 documents and the summarize stage received 1, an execute-level filter was being re-applied to every stage, and the intermediate documents did not carry the filtered field, so 19 of 20 were silently dropped between stages. No error, no warning; the answer just looked mysteriously thin. The generalizable checks at each boundary: how many documents entered and left, which fields they actually carried (payload-lean intermediates are a classic silent killer), and whether the stage served a cached result or computed fresh, stale caches make you debug a pipeline that is not the one running.  
  

## What belongs in a retrieval explain plan?

  
  
When you formalize the trace above, you get retrieval's equivalent of a database explain plan. A useful one answers five questions per stage: how many candidates entered and exited (and why the delta, filter conditions with hit/drop counts); which features or sources contributed each surviving document, with per-source scores before fusion; what the stage cost (latency, and money for LLM stages); whether the output was cached and from when; and what the final ordering decision was (fusion weights or rerank scores). If your stack cannot answer those, you are debugging blind: instrument before you tune.  
  

## How does this work in Mixpeek?

  
  
Every retriever execution returns [per-stage telemetry](/docs/retrieval/retrievers): `stage_statistics` carries duration and a `cache_hit` flag per stage (cache provenance is stamped at every level, so a served-from-cache answer is always distinguishable from a fresh one), and a `budget` block accounts for what the execution cost. Filters bind only to filter-type stages, the silent inter-stage decimation above is a class of bug the pipeline contract now rules out, and each stage's inputs and outputs are inspectable in [Studio's retriever workbench](/retrievers), where you can run one query and read the stage-by-stage trace instead of reconstructing it from logs. Ranking-quality problems that survive tracing usually belong to the ordering layer: see [two-stage retrieval and reranking](/guides/budget-aware-multi-vector-retrieval) for the rerank half, and [retrieval feedback loops](/guides/retrieval-feedback-loops-learning-to-rank-from-interactions) for turning debugged failures into training signal so the same miss stops recurring. If you are still choosing the stack underneath, start at [MVS](/mvs) or the [retriever stage catalog](/docs/retrieval/stages/overview); rate economics live on [pricing](/pricing).  
  
If the problem turns out to be cost or latency rather than relevance, [query planning for multimodal retrieval](/guides/query-planning-multimodal-retrieval) covers stage ordering, filter pushdown and candidate budgets.

## Run this on your own data

Point Mixpeek at the storage you already have and search your video, images, audio, and documents the way this guide describes. Build starts at $25/mo for up to 1M vectors.

[Search your own archive](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=guide_cta&utm_campaign=mvs_onramp)[Read Docs](/docs)

[Explore MVS](/mvs)[See pricing](/pricing)

## Related guides

[

Search & Discovery

### Why Does My Document Search Miss the Answer That Is in a Chart or Table?

To search a folder of PDFs when the answer is inside a chart, index what each page shows as well as what it says: extract charts and tables into text, index the page images, or have a vision model describe each figure. This guide explains why ordinary PDF search misses chart and table answers, how to test your own folder, and which of the three fixes to use.

Read guide →](/guides/why-does-my-document-search-miss-answers-in-charts-and-tables)[

Search & Discovery

### Why Does My Vector Search Return Fewer Results When I Add a Filter?

Most vector indexes find candidates first and filter afterwards, so a narrow filter leaves fewer results than you asked for, or a full page that misses the true nearest matches. How to check filtered recall on your own data, what to change in pgvector, Qdrant and Weaviate, and our own before and after numbers on 1 million vectors.

Read guide →](/guides/why-vector-search-returns-fewer-results-with-filter)[

Search & Discovery

### Why Can't My Search Find Exact Part Numbers, Codes or Names?

Semantic search compares meanings, and a part number, an error code or an unusual surname carries almost none, so the index returns records that look alike instead of the one that matches. Run a keyword (BM25) search beside the vector search, merge the two lists by rank, and use an exact filter when the identifier lives in its own field.

Read guide →](/guides/why-search-cant-find-exact-part-numbers-codes-names)