RAG & Knowledge Retrieval5.0 · 0 ratings

Retrieval Recall Gap Diagnoser

Diagnoses why a RAG pipeline failed to retrieve the right passage and prescribes concrete fixes.

Chain-of-ThoughtStep-by-StepSelf-Critique

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. 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. 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. 3

    Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.

Techniques in this prompt

Chain-of-Thought

Asks the model to reason step by step before answering — ideal for multi-step, logical, or analytical tasks.

Learn this technique
Step-by-Step

Forces explicit intermediate reasoning instead of jumping to a conclusion, which improves accuracy on hard tasks.

Learn this technique
Self-Critique

Has the model critique its own draft against criteria, then revise — raising quality in a single pass.

Learn this technique

Recommended models

claudegpt-4ogemini

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