Inferensys

Prompt

Evidence Gap Identification and Synthesis Prompt

A practical prompt playbook for using Evidence Gap Identification and Synthesis Prompt in production AI workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Define the job, reader, and constraints for the Evidence Gap Identification and Synthesis Prompt.

This prompt is for RAG system designers and AI engineers who need their application to detect when retrieved passages are insufficient to fully answer a user's question. The core job-to-be-done is producing a structured, machine-readable output that separates what the evidence covers from what remains unanswered, enabling the application to decide whether to request more context, escalate to a human, or deliver a qualified partial answer. The ideal user is building a production system where confident wrong answers are more damaging than honest refusal, such as in clinical decision support, legal research, financial analysis, or technical documentation assistants.

Use this prompt when your retrieval pipeline may return incomplete, tangentially relevant, or partially covering passages and you need the model to explicitly flag gaps rather than silently filling them with parametric knowledge. It is designed for workflows where the output must be parsed by downstream code—a confidence score, a list of covered topics, a list of unanswered questions, and a refusal trigger. Do not use this prompt for simple factoid QA where a single passage is expected to contain the full answer, or for creative generation tasks where factual grounding is not the primary concern. It is also not a replacement for retrieval quality improvements; if your retriever consistently fails to surface relevant documents, fix retrieval before adding gap detection.

The prompt requires several structured inputs: the user's original question, the set of retrieved passages with source identifiers, and optionally a risk level that adjusts the refusal threshold. The output schema includes a partial answer field, a confidence score, explicit lists of covered and uncovered aspects, and a boolean refusal flag. Before deploying, you must test this prompt against known-gap cases (where evidence is deliberately incomplete) and known-sufficient cases to calibrate the confidence thresholds. Pair this prompt with a validation harness that checks the output schema, verifies that flagged gaps correspond to actual missing information in the passages, and escalates to human review when the model claims sufficiency but your ground-truth evaluation shows otherwise.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Evidence Gap Identification and Synthesis Prompt delivers value and where it introduces risk. Use these cards to decide if this prompt fits your RAG pipeline before integrating it into production.

01

Good Fit: Incomplete Retrieval Pipelines

Use when: your RAG system retrieves passages that may not fully cover the user's question. The prompt excels at detecting partial coverage and preventing confident wrong answers. Guardrail: Pair with a retrieval sufficiency threshold—if the gap score exceeds 0.7, trigger re-retrieval with expanded queries before synthesis.

02

Bad Fit: Real-Time or Low-Latency Systems

Avoid when: your application requires sub-500ms response times. Gap identification adds an explicit reasoning step that increases latency by 30-60% compared to direct answer generation. Guardrail: Use a lightweight relevance classifier for latency-sensitive paths and reserve this prompt for high-stakes or async workflows.

03

Required Inputs: Scored Passage Set

What you need: a retrieval set with relevance scores, source metadata, and the original user query. Without relevance scores, the model cannot distinguish between weak and strong partial evidence. Guardrail: Pre-process all passages through a relevance scorer before passing them to this prompt. Reject passages below a minimum relevance threshold.

04

Operational Risk: Over-Refusal on Edge Cases

What to watch: the prompt may flag gaps for questions that are answerable with reasonable inference, causing unnecessary refusal. This is common with implicit or common-sense reasoning questions. Guardrail: Calibrate the gap threshold using a golden dataset of known-answerable and known-unanswerable queries. Log refusal rates by category and adjust the confidence calibration prompt weekly.

05

Operational Risk: Hallucinated Gap Claims

What to watch: the model may invent missing information categories that are not actually required to answer the question, inflating the gap score. Guardrail: Add a verification step that checks each identified gap against the original question's explicit requirements. Strip gaps that do not map to a specific question component.

06

Escalation Trigger: High-Confidence Gaps in Regulated Domains

What to watch: when the prompt identifies critical missing evidence in healthcare, legal, or financial contexts, a partial answer may still create liability. Guardrail: Route outputs with gap severity labeled 'critical' and confidence below 0.6 to a human review queue. Never auto-respond with partial answers in regulated workflows without explicit approval rules.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for identifying evidence gaps and producing a calibrated partial answer with explicit gap flags.

This template is designed to be copied directly into your prompt management system or codebase. It instructs the model to analyze a set of retrieved passages against a user question, identify what the evidence covers and what it does not, and produce a structured output that separates known answers from unknown gaps. The prompt uses square-bracket placeholders for all dynamic inputs, making it safe to template in any language without accidental variable interpolation.

text
You are an evidence analyst. Your job is to determine whether the provided passages contain sufficient information to answer the user's question fully and accurately.

## INPUTS

**User Question:**
[USER_QUESTION]

**Retrieved Passages:**
[RETRIEVED_PASSAGES]

**Confidence Threshold:** [CONFIDENCE_THRESHOLD]
**Maximum Gap Count:** [MAX_GAP_COUNT]

## INSTRUCTIONS

1. Read the user question and all retrieved passages carefully.
2. Identify every claim or sub-question implied by the user question.
3. For each claim or sub-question, determine whether the passages provide sufficient evidence to answer it.
4. If evidence is insufficient, contradictory, or missing, flag it as a gap.
5. Produce a partial answer that covers only what the evidence supports.
6. Do not fabricate, infer, or assume information not present in the passages.
7. If no passages are relevant, refuse to answer and explain why.

## OUTPUT SCHEMA

Return a single JSON object with this exact structure:

{
  "question": "string (the original user question)",
  "answerable": true or false,
  "partial_answer": "string or null (the best answer supported by evidence, with inline citation markers like [1])",
  "confidence": "high" | "medium" | "low" | "none",
  "gaps": [
    {
      "gap_id": "string",
      "question_or_claim": "string (what the user needs to know that evidence doesn't cover)",
      "gap_type": "missing_evidence" | "insufficient_detail" | "contradictory_sources" | "outdated_evidence" | "irrelevant_passages",
      "severity": "blocking" | "major" | "minor",
      "explanation": "string (why this gap matters for answering the question)"
    }
  ],
  "evidence_coverage": {
    "passages_used": [1, 2, 3],
    "passages_ignored": [4],
    "ignored_reason": "string (why certain passages were not used)"
  },
  "escalation": {
    "should_escalate": true or false,
    "escalation_reason": "string or null (why a human or additional retrieval is needed)",
    "suggested_action": "retry_retrieval" | "ask_user" | "human_review" | "none"
  }
}

## CONSTRAINTS

- Never include information not present in the retrieved passages.
- If confidence is "low" or "none", partial_answer must be null or explicitly state that the question cannot be answered.
- Set should_escalate to true if any gap has severity "blocking" or if confidence is "none".
- Use citation markers like [1], [2] to link claims to specific passages.
- If [RISK_LEVEL] is "high", require human review before delivering the answer.

## EXAMPLES

[FEW_SHOT_EXAMPLES]

Adaptation guidance: Replace each bracketed placeholder with values from your application context. [USER_QUESTION] and [RETRIEVED_PASSAGES] are required for every call. [CONFIDENCE_THRESHOLD] controls how aggressively the model flags gaps—lower thresholds produce more gap flags. [MAX_GAP_COUNT] prevents the output from becoming a laundry list of minor omissions. [FEW_SHOT_EXAMPLES] should include 2–3 worked examples showing correct gap identification and partial answer construction for your domain. [RISK_LEVEL] can be set dynamically based on the query category or user context; when set to "high", add a downstream human approval step before the answer reaches the user.

Validation and safety: After the model returns the JSON, validate that gaps is present even when answerable is true—a fully answerable question should produce an empty gaps array, not a missing field. Check that partial_answer is null when confidence is "none". If should_escalate is true, route the output to your escalation handler rather than displaying it to the user. For high-risk domains, run a secondary faithfulness check that verifies each claim in partial_answer against the cited passage before release.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the Evidence Gap Identification and Synthesis Prompt. Each placeholder must be populated before the prompt is sent to the model. Validation notes describe how to verify the input is well-formed and safe.

PlaceholderPurposeExampleValidation Notes

[USER_QUERY]

The original question or request that triggered evidence retrieval

What are the side effects of drug X in patients over 65 with renal impairment?

Must be non-empty string. Check for prompt injection patterns before passing. Truncate if over 2000 chars.

[RETRIEVED_PASSAGES]

The set of passages returned by the retrieval system, with source metadata

[{"source_id": "pubmed_123", "text": "...", "date": "2024-01", "authority_score": 0.85}]

Must be valid JSON array. Each passage requires source_id and text fields. Reject if empty array; trigger fallback retrieval or refusal path.

[PASSAGE_COUNT]

Total number of retrieved passages provided to the model

7

Must be integer >= 1. If 0, skip gap identification and route to refusal prompt. Log if count exceeds context window budget.

[REQUIRED_COVERAGE_DIMENSIONS]

Specific aspects the answer must address to be considered complete

["efficacy", "safety", "dosing", "drug interactions", "monitoring"]

Optional. If provided, must be valid JSON array of strings. Each dimension used as a coverage check axis. Null allowed.

[CONFIDENCE_THRESHOLD]

Minimum aggregate confidence score required to return an answer without a gap flag

0.7

Must be float between 0.0 and 1.0. Default 0.7 if not specified. Answers below threshold must include explicit gap flags and uncertainty language.

[MAX_PARTIAL_ANSWER_LENGTH]

Maximum character length for the partial answer when gaps are present

500

Must be positive integer. Default 500. Prevents verbose speculation when evidence is incomplete. Enforce with output truncation if model exceeds limit.

[ESCALATION_TRIGGERS]

Conditions that require immediate refusal and human escalation instead of a partial answer

["safety_critical_gap", "contraindication_uncertainty", "missing_population_data"]

Optional. If provided, must be valid JSON array of trigger labels. Each trigger checked against gap analysis output. Null allowed for non-critical domains.

[OUTPUT_SCHEMA_VERSION]

Schema version identifier for the structured output format

2.1

Must match expected schema version in application parser. Mismatch triggers schema migration or rejection. Default to latest stable version if not specified.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when identifying evidence gaps and how to guard against it in production.

01

False Completeness

What to watch: The model confidently declares the evidence is sufficient when critical information is missing, producing a polished answer that hides gaps. This happens most often when retrieved passages are topically related but lack the specific detail needed. Guardrail: Require the model to list what the evidence explicitly covers AND what questions remain unanswered before generating any answer. Add a separate verification step that checks whether each claim in the output traces to a specific passage.

02

Over-Refusal on Partial Evidence

What to watch: The model refuses to answer entirely when some evidence exists but is incomplete, leaving users with nothing when a qualified partial answer would be useful. This is the mirror failure of false completeness. Guardrail: Define explicit refusal thresholds in the prompt. Require the model to distinguish between 'no evidence,' 'partial evidence,' and 'sufficient evidence,' and to produce a confidence-calibrated partial answer with gap flags for the middle case.

03

Gap Description Drift

What to watch: The model identifies gaps but describes them in vague or generic terms ('more information needed') rather than specifying exactly what is missing and why it matters. This makes gap flags useless for downstream retrieval or human review. Guardrail: Constrain gap descriptions to a structured schema with fields for the missing information type, the specific question it would answer, and the impact on confidence. Validate that gap descriptions contain concrete, query-specific content.

04

Confidence Miscalibration

What to watch: The model assigns high confidence to answers built on thin or tangential evidence, or low confidence to answers well-supported by multiple passages. This undermines the entire purpose of evidence gap identification. Guardrail: Include few-shot examples that demonstrate correct confidence calibration for partial evidence scenarios. Add an eval step that compares model-assigned confidence against human-judged evidence sufficiency on a held-out set.

05

Silent Evidence Contamination

What to watch: The model draws on parametric knowledge to fill perceived gaps rather than flagging them, producing answers that mix retrieved evidence with ungrounded information. The output looks well-sourced but contains fabricated details. Guardrail: Add an explicit instruction to mark any statement not directly attributable to a retrieved passage. Run a post-generation faithfulness check that verifies every factual claim against the provided evidence set, flagging unsupported statements.

06

Escalation Trigger Failure

What to watch: The model correctly identifies a critical evidence gap but fails to trigger the escalation or refusal path defined in the application contract, instead producing a hedged answer that reaches the user without review. Guardrail: Define structured escalation triggers in the output schema itself—not just in instructions. Require a boolean field that gates whether the partial answer should be shown to users or routed to a human review queue. Validate this field in the application layer before any response is delivered.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for testing the Evidence Gap Identification and Synthesis prompt before production deployment. Each criterion includes a pass standard, a failure signal, and a test method that can be automated or run manually against a golden dataset.

CriterionPass StandardFailure SignalTest Method

Gap Detection Completeness

All known information gaps in the test set are identified in the output

Output claims full coverage when evidence is missing for a sub-question

Run against 10 curated retrieval sets with known gaps; compare identified gaps to ground-truth gap list

Coverage Boundary Accuracy

Output correctly distinguishes what the evidence covers from what it does not cover

Output includes claims in the 'covered' section that lack source support

Parse the 'covered' field; for each claim, verify a supporting passage exists in the input using automated NLI check

Unanswered Question Enumeration

All unanswered sub-questions are listed with explicit gap flags

Unanswered questions are omitted or answered speculatively without a gap flag

Compare the 'unanswered_questions' array against a human-annotated list of expected unanswered questions

Confidence Calibration

Confidence score reflects actual evidence completeness; high confidence only when all sub-questions are covered

Confidence score is 'high' when critical evidence is missing or 'low' when evidence is sufficient

Bin outputs by confidence level; measure whether 'high' confidence outputs have zero known gaps in the test set

Refusal Trigger Accuracy

Refusal is triggered when evidence is insufficient for any safety-critical or factual claim

Output provides a confident answer without refusal when key evidence is absent

Inject retrieval sets with critical gaps; verify the 'refusal_triggered' field is true and a refusal reason is provided

Escalation Trigger Accuracy

Escalation is recommended when the gap requires human judgment or additional retrieval

Output neither escalates nor flags the gap when the question requires domain-expert review

Test with questions requiring legal, medical, or financial judgment; verify 'escalation_recommended' is true

Partial Answer Faithfulness

Partial answer contains only claims directly supported by the provided evidence

Partial answer includes unsupported details, fabrications, or claims from model parametric knowledge

Extract all claims from the 'partial_answer' field; run automated faithfulness verification against input passages

Output Schema Compliance

Output is valid JSON matching the defined schema with all required fields present

Output is missing required fields, uses wrong types, or is not parseable JSON

Validate output against the JSON schema; flag any missing fields, type mismatches, or extra fields

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet) and manual review. Focus on getting the gap structure right before adding automation. Replace [EVIDENCE_PASSAGES] with a flat list of retrieved chunks. Keep [QUESTION] as a single user query. Run 10-15 examples and review every output for gap detection accuracy.

Watch for

  • The model claiming coverage when evidence is thin
  • Missing the "partial answer" section entirely
  • Overconfident confidence scores (0.8+ on weak evidence)
  • Skipping the refusal trigger when evidence is absent
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.