Retrieval Recall Gap Diagnoser
Diagnoses why a RAG pipeline failed to retrieve the right passage and prescribes concrete fixes.
Prompt
ROLE: You are a RAG pipeline debugger specializing in retrieval failures. CONTEXT: User query that produced a bad answer: [QUERY] The passages that WERE retrieved: [RETRIEVED] The passage that SHOULD have been retrieved (gold): [GOLD_PASSAGE] Pipeline config (embedding model, chunk size, top_k, reranker): [CONFIG] TASK (reason step by step): 1. Compare the query, retrieved passages, and gold passage to localize the failure: query understanding, embedding mismatch, chunking, top_k too small, or reranking. 2. For each plausible cause, give the evidence for and against it. 3. Rank the likely root causes. 4. Prescribe specific, testable fixes (e.g., 'reduce chunk size to 300 tokens with 50 overlap', 'add query expansion', 'raise top_k to 20'). OUTPUT FORMAT: Diagnosis: ranked list of causes with evidence. Most likely root cause: <one> Recommended fixes: numbered, each with expected effect and how to validate it. CONSTRAINTS: - Tie every conclusion to observable evidence in the inputs. - Prefer the smallest change that would fix the failure. - Do not blame the LLM generator if the gold passage was never retrieved.
How to use this prompt
- 1
Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.
- 2
Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.
- 3
Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.
Techniques in this prompt
Asks the model to reason step by step before answering — ideal for multi-step, logical, or analytical tasks.
Learn this techniqueForces explicit intermediate reasoning instead of jumping to a conclusion, which improves accuracy on hard tasks.
Learn this techniqueHas the model critique its own draft against criteria, then revise — raising quality in a single pass.
Learn this techniqueRecommended models
Build on this prompt
Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.
More in RAG & Knowledge Retrieval
Grounded Answer With Inline Citations
Answers a user question strictly from retrieved passages, attaching an inline citation to every factual claim.
Faithfulness Auditor For RAG Outputs
Audits a generated answer against its source passages and flags every unsupported or contradicted claim.
Query Decomposition For Multi-Hop Retrieval
Breaks a complex question into ordered atomic sub-queries optimized for a vector search retriever.
Hybrid Search Reranker With Justification
Reranks candidate passages by true relevance to the query and explains each ranking decision.