Inferensys

Prompt

Context Completeness Scoring Prompt Template

A practical prompt playbook for assigning a numerical completeness score to a retrieval set against a query, with dimension-level breakdowns suitable for retrieval quality monitoring dashboards.
Elegant overhead shot of a polished wooden communal table in a sun-drenched WeWork lounge, laptops and tablets displaying AI workflow dashboards, plants and pendant lights in background.
PROMPT PLAYBOOK

When to Use This Prompt

A practical guide for RAG pipeline architects and search engineers to monitor retrieval quality at scale using a structured completeness scorecard.

This prompt is a pre-generation diagnostic tool for RAG pipeline architects and search engineers who need to monitor retrieval quality at scale. Its job is to produce a structured, multi-dimensional scorecard that tells you whether the retrieved context is complete enough to answer a user query. Use it when you need a numerical completeness score with dimension-level breakdowns for factual coverage, temporal relevance, authority, and specificity. The output is designed to feed directly into retrieval quality dashboards, A/B test evaluation frameworks, and continuous monitoring pipelines. It is not a replacement for answer generation or hallucination detection—it operates upstream, before the model attempts to produce an answer.

The prompt expects two inputs: a user query and a set of retrieved passages. It returns a structured scorecard with an overall completeness score, dimension-level subscores, and a binary sufficiency flag. Wire this into your retrieval evaluation harness by running it against sampled query-retrieval pairs from production logs. Store the scores alongside retrieval metadata (retriever version, index snapshot, embedding model) to enable A/B comparisons. For high-stakes applications, set a sufficiency threshold below which the system should trigger re-retrieval, clarification requests, or human review rather than proceeding to answer generation. The prompt works best with retrieval sets of 3-10 passages; larger sets may require summarization or pre-filtering to stay within context windows.

Do not use this prompt as a user-facing response or as a substitute for answer grounding verification. It evaluates retrieval completeness, not answer faithfulness. If you need to verify that a generated answer is supported by evidence, pair this with a grounding verification prompt from the Answer Grounding and Faithfulness Verification playbook. Start by running this prompt against a labeled evaluation set where you know the ground-truth completeness to calibrate thresholds before deploying it as a production gate. Avoid using it for open-ended creative queries where completeness is inherently subjective—this prompt is designed for fact-seeking queries with verifiable information needs.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Context Completeness Scoring Prompt delivers reliable value and where it introduces risk or operational overhead.

01

Good Fit: Retrieval Pipeline Monitoring

Use when: you need continuous, automated quality scoring of retrieval sets in production RAG pipelines. The structured scorecard output is ideal for dashboards, SLA tracking, and A/B test evaluation. Guardrail: Pair with a regression test suite of known-sufficient and known-insufficient retrieval sets to detect scoring drift.

02

Good Fit: Pre-Generation Quality Gates

Use when: you need a structured decision before answer generation to route low-quality retrievals to fallback, re-retrieval, or human review. The dimension-level breakdown helps diagnose why retrieval is insufficient. Guardrail: Set explicit score thresholds per dimension and log all gate decisions for audit. Never use the score alone without the dimension breakdown.

03

Bad Fit: Real-Time User-Facing Latency Paths

Avoid when: the scoring prompt adds unacceptable latency to a synchronous user request. Multi-dimensional scoring with explanations is token-heavy and slow. Guardrail: Run this prompt asynchronously or on a sampled subset for monitoring. Use a lightweight binary classifier prompt for synchronous pre-generation checks.

04

Bad Fit: Unstructured or Ambiguous Retrieval Sources

Avoid when: retrieved passages lack clear provenance, timestamps, or authorship metadata. The authority and temporal relevance dimensions require these signals to produce meaningful scores. Guardrail: Enrich retrieval metadata before scoring. If metadata is missing, constrain the prompt to only score dimensions with available evidence and flag missing signals.

05

Required Inputs

Requires: the original user query, the full set of retrieved passages with source identifiers, and metadata for each passage including date, author, and source type when available. Guardrail: Validate that retrieval sets are non-empty before invoking the scorer. An empty set should short-circuit to a zero score with a 'no evidence retrieved' reason code.

06

Operational Risk: Score Calibration Drift

Risk: numerical completeness scores can drift over time as query distributions, knowledge bases, or retrieval systems change. A score of 0.7 may mean different things across different model versions or domains. Guardrail: Periodically recalibrate against human-annotated sufficiency judgments. Track score distributions over time and alert on statistically significant shifts.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt that scores retrieval set completeness across factual coverage, temporal relevance, authority, and specificity dimensions.

This prompt template produces a structured completeness scorecard for a retrieval set against a user query. It evaluates four dimensions—factual coverage, temporal relevance, authority, and specificity—and returns a numerical score for each, plus an overall composite score. The output is designed to feed directly into retrieval quality monitoring dashboards, A/B test evaluations, and pre-generation guardrails. Replace every square-bracket placeholder with your own data before running the prompt in your evaluation harness.

text
You are a retrieval quality evaluator. Your task is to assess how completely a set of retrieved passages covers the information needed to answer a user query.

## INPUT
Query: [QUERY]
Retrieved Passages:
[PASSAGE_1]
[PASSAGE_2]
[PASSAGE_3]
...

## EVALUATION DIMENSIONS
Score each dimension from 0.0 (completely insufficient) to 1.0 (fully sufficient).

1. Factual Coverage: Do the passages contain the facts, entities, and relationships needed to answer the query?
2. Temporal Relevance: Are the passages current enough for the query's time sensitivity? Flag if dates are missing or outdated.
3. Authority: Do the passages come from credible, appropriate sources for this query domain?
4. Specificity: Do the passages provide detail at the right level of granularity, or are they too vague/general?

## CONSTRAINTS
- Only use information present in the provided passages. Do not bring in external knowledge.
- If a dimension cannot be assessed due to missing metadata, score it as 0.0 and note the reason.
- If the query has no explicit time requirement, score Temporal Relevance as 0.5 and note the assumption.
- Flag any passages that contradict each other.

## OUTPUT SCHEMA
Return valid JSON matching this schema:
{
  "overall_completeness_score": <float 0.0-1.0>,
  "dimension_scores": {
    "factual_coverage": <float>,
    "temporal_relevance": <float>,
    "authority": <float>,
    "specificity": <float>
  },
  "missing_information": ["<string describing a specific gap>"],
  "contradictions": ["<string describing conflicting passages>"],
  "assessment_notes": "<string summarizing key findings>"
}

## RISK LEVEL
[RISK_LEVEL]

## EXAMPLES
[EXAMPLES]

Adaptation notes: If your retrieval pipeline already provides source metadata such as publication dates or domain authority scores, inject those into the passage blocks as structured fields rather than relying on the model to infer them. For high-stakes domains such as healthcare or finance, set [RISK_LEVEL] to high and route outputs scoring below 0.7 to human review before any downstream answer generation. The [EXAMPLES] placeholder should contain at least two scored examples showing both sufficient and insufficient retrieval sets to calibrate the model's scoring behavior. Validate the output JSON against the schema before ingestion into monitoring systems; malformed missing_information arrays or missing dimension scores are common failure modes when the model encounters ambiguous queries.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Context Completeness Scoring prompt. Each placeholder must be populated before the prompt is sent to the model. Missing or malformed inputs are the most common cause of invalid scorecard output.

PlaceholderPurposeExampleValidation Notes

[QUERY]

The user question or information need being evaluated against the retrieval set

What are the side effects of semaglutide for type 2 diabetes patients with renal impairment?

Must be non-empty string. Check for vague queries that cannot be scored meaningfully. If query is ambiguous, scoring dimensions will produce low-confidence results.

[RETRIEVAL_SET]

The collection of passages, documents, or chunks retrieved for answering the query

JSON array of objects with id, text, source, and date fields

Must contain at least one passage. Validate JSON structure before prompt assembly. Empty array triggers automatic score of 0 with gap flag. Each passage must have text field.

[RETRIEVAL_METADATA]

Source-level metadata for authority and recency scoring dimensions

{"source": "FDA label", "date": "2024-03-15", "authority": "regulatory"}

Optional but strongly recommended. Missing metadata forces authority and temporal relevance dimensions to return null with reason code. Validate date format as ISO 8601.

[SCORING_DIMENSIONS]

The dimensions to include in the completeness scorecard

["factual_coverage", "temporal_relevance", "authority", "specificity"]

Must be non-empty array of valid dimension names. Invalid dimension names cause parse errors downstream. Supported values: factual_coverage, temporal_relevance, authority, specificity, source_diversity, contradiction_flag.

[THRESHOLD_CONFIG]

Score thresholds that determine sufficiency classification

{"sufficient": 0.8, "partial": 0.5, "insufficient_below": 0.5}

Must include sufficient, partial, and insufficient_below keys with float values between 0.0 and 1.0. sufficient must be greater than partial. Invalid config causes classification to default to null.

[OUTPUT_SCHEMA]

The expected JSON structure for the scorecard output

See output-contract table for field definitions

Must be valid JSON Schema or explicit field list. Schema mismatch between prompt instruction and application parser is the top cause of production failures. Validate schema before prompt assembly.

[FOCUS_AREAS]

Specific aspects of the query that require heightened scrutiny during scoring

["renal impairment subgroup", "drug-drug interactions", "dosing adjustment"]

Optional. When provided, specificity and factual_coverage dimensions weight these areas higher. Empty array or null is acceptable and triggers uniform weighting across query aspects.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Context Completeness Scoring prompt into an evaluation pipeline or monitoring dashboard.

The Context Completeness Scoring prompt is designed to be a programmatic component within a RAG evaluation harness, not a one-off manual check. Its structured scorecard output—with dimension-level breakdowns for factual coverage, temporal relevance, authority, and specificity—makes it directly ingestible by monitoring dashboards and automated quality gates. To integrate it, wrap the prompt in a function that accepts a query and a list of retrieved passages, calls your LLM with a low temperature (e.g., 0.0–0.2) for deterministic scoring, and parses the JSON response into your metrics store. The primary goal is to generate a continuous signal of retrieval quality that can be tracked over time, compared across experiments, and used to trigger alerts when scores degrade below defined thresholds.

A robust implementation requires validation and retry logic. After parsing the model's JSON output, validate that all required fields (completeness_score, dimensions, missing_aspects) are present and that numerical scores fall within the expected 0.0–1.0 range. If validation fails, implement a single retry with the error message appended to the prompt context; if it fails again, log the raw output and emit a null score to avoid poisoning your metrics. For high-stakes pipelines, route low-confidence scores (e.g., completeness_score < 0.5) to a human review queue or a secondary LLM judge for confirmation. Log every scoring event with the query, passage IDs, scores, and model version to enable traceability and regression analysis when retrieval performance shifts. This structured logging is essential for correlating completeness scores with downstream task accuracy.

When deploying this prompt in a monitoring dashboard, avoid treating the numerical score as an absolute truth. Instead, use it as a relative signal: track rolling averages, compare score distributions between production and candidate retrieval pipelines during A/B tests, and set dynamic thresholds based on historical baselines rather than arbitrary cutoffs. The dimension-level breakdown is particularly valuable for diagnosing specific failure modes—a drop in temporal_relevance might indicate a stale index, while a drop in authority could signal a crawl of low-quality sources. Do not use this prompt as a real-time gate before answer generation unless you have measured and accepted the added latency; it is best suited for asynchronous evaluation, nightly regression runs, and continuous monitoring of retrieval quality in production.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, types, and validation rules for the JSON scorecard returned by the Context Completeness Scoring prompt. Use this contract to parse, validate, and store scores in retrieval quality monitoring dashboards.

Field or ElementType or FormatRequiredValidation Rule

completeness_score

number (0.0–1.0)

Must be a float between 0 and 1 inclusive. Reject if outside range or non-numeric.

dimension_scores

object

Must contain all four required keys: factual_coverage, temporal_relevance, authority, specificity. Each value must be a number 0.0–1.0.

dimension_scores.factual_coverage

number (0.0–1.0)

Score for how many query sub-facts are addressed by retrieved passages. Null not allowed.

dimension_scores.temporal_relevance

number (0.0–1.0)

Score for whether passage timestamps match the query's time horizon. If query has no temporal aspect, default to 1.0.

dimension_scores.authority

number (0.0–1.0)

Score for source credibility, domain expertise, and publication trustworthiness. Must degrade for unknown or self-published sources.

dimension_scores.specificity

number (0.0–1.0)

Score for how precisely passages address the query versus providing general or tangential information.

gap_summary

string or null

A concise description of the most critical evidence gaps. Must be null if completeness_score >= 0.9. Must be non-null string if completeness_score < 0.7.

missing_dimensions

array of strings

List of dimension names that scored below 0.5. Must be empty array if all dimensions >= 0.5. Valid values: factual_coverage, temporal_relevance, authority, specificity.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when scoring context completeness and how to guard against it.

01

Overconfident Scores on Thin Evidence

What to watch: The model assigns a high completeness score when only one or two passages exist, mistaking retrieval precision for coverage. A single highly relevant document does not mean the context is complete. Guardrail: Require a minimum passage count threshold before scoring. Add a 'breadth' dimension that explicitly penalizes low document diversity. Cross-validate the score against a simple heuristic: if fewer than 3 distinct sources are present, cap the maximum score at 0.6.

02

Dimension Score Inflation

What to watch: The model gives high marks across all dimensions (factual coverage, temporal relevance, authority, specificity) because the prompt lacks anchors. Without behavioral descriptions for each score level, the model defaults to generous, undifferentiated ratings. Guardrail: Include a detailed rubric with explicit criteria for scores 1-5 on each dimension. Provide few-shot examples of low, medium, and high scores with justification. Run a calibration eval comparing model scores to human-annotated ground truth.

03

Ignoring Temporal Mismatch

What to watch: The query asks for 2024 data but the retrieved passages are from 2022. The model still scores temporal relevance as high because the content is topically related. Guardrail: Extract and compare dates from the query and each passage before scoring. Add a hard rule: if the temporal gap exceeds a defined threshold (e.g., 1 year for fast-moving domains), cap the temporal relevance score. Include a 'staleness flag' in the output schema.

04

Hallucinated Source Authority

What to watch: The model invents authority assessments for sources it does not recognize, guessing that a domain sounds credible or fabricating publication reputations. Guardrail: Provide an explicit allowlist or denylist of known authoritative domains. Instruct the model to output 'unknown' for authority when the source is not in the provided list. Never let the model infer authority from surface-level URL patterns alone. Log all 'unknown' authority scores for human review.

05

Specificity Confusion with Verbosity

What to watch: The model equates long, detailed passages with high specificity, even when the details are irrelevant to the query. A 2,000-word document about tangential topics scores higher than a 200-word passage that directly answers the question. Guardrail: Define specificity as 'density of query-relevant facts per token,' not passage length. Include a counter-example in the prompt showing a verbose but irrelevant passage receiving a low specificity score. Use a separate relevance filter before the specificity dimension is scored.

06

Score Drift Across Batches

What to watch: The same retrieval set scored in different batches or with different surrounding context produces inconsistent scores. This breaks dashboard reliability and makes A/B test comparisons meaningless. Guardrail: Fix the scoring prompt as a versioned template. Run a golden set of 20 query-context pairs through every prompt change and flag any score variance above 0.2. Use a fixed temperature (0 or very low) for scoring tasks. Store the prompt version alongside each score in your monitoring database.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to evaluate the quality of the Context Completeness Scoring Prompt output before integrating it into a production monitoring dashboard. Each criterion targets a specific failure mode common in retrieval quality scoring.

CriterionPass StandardFailure SignalTest Method

Dimension Score Completeness

All five dimensions (factual_coverage, temporal_relevance, authority, specificity, overall) are present with a numerical score between 0.0 and 1.0.

Missing dimension key, null score, or score outside the 0.0-1.0 range.

Schema validation against the expected output contract. Assert len(output.dimensions) == 5 and all scores are floats between 0 and 1.

Score Justification Quality

Each dimension score is accompanied by a non-empty justification string that references specific evidence passages or query requirements.

Generic justification like 'good coverage' or an empty string. Justification does not mention any specific source or query aspect.

LLM-as-judge check: prompt a second model to verify that each justification contains at least one concrete reference to the query or a passage ID.

Overall Score Calibration

The overall score reflects a weighted aggregation of dimension scores and is not an independent, uncalibrated guess.

Overall score is identical to a single dimension score without justification, or is higher than all individual dimension scores.

Calculate the expected overall score from dimension weights and assert it is within a 0.15 tolerance of the generated overall score.

Missing Evidence Identification

The missing_information field lists specific facts, entities, or data ranges absent from the retrieval set.

missing_information is an empty array when a dimension score is below 0.7, or it lists vague concepts like 'more data'.

For a curated test set with known gaps, assert that missing_information contains at least one specific entity or fact string from the ground-truth gap list.

Retrieval Set Grounding

The passage_ids array correctly references the indices of passages from the input [RETRIEVED_PASSAGES] that were used in the assessment.

A passage ID is hallucinated (not in the input set) or the array is empty when evidence was clearly used in justifications.

Parse the output and cross-reference each ID in passage_ids against the input passage index. Assert no foreign IDs exist.

Temporal Relevance Accuracy

The temporal_relevance score is low (<0.5) when the query contains a time constraint and the passages are clearly outdated.

A high temporal relevance score for a query requiring 'latest' data when all passages are over two years old.

Use a static test case: query='latest Q3 earnings', passages dated 2021. Assert temporal_relevance < 0.5.

Output Format Stability

The output is valid JSON matching the [OUTPUT_SCHEMA] exactly, with no extra commentary or markdown fences.

The model returns a JSON object wrapped in a markdown code block, or includes explanatory text before the JSON.

Attempt to parse the raw model response with a JSON parser. Assert no JSONDecodeError. If parsing fails, trigger the repair harness.

Refusal for Empty Retrieval Set

When [RETRIEVED_PASSAGES] is an empty list, the overall score is 0.0 and missing_information indicates a total lack of evidence.

The model hallucinates a score above 0.0 or fabricates passage IDs when no passages are provided.

Run the prompt with an empty [] retrieval set. Assert output.overall_score == 0.0 and len(output.passage_ids) == 0.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single model call and manual review of scorecards. Remove strict output schema enforcement initially—accept JSON-like output and validate manually. Start with a small set of 10–20 query–retrieval pairs to calibrate scoring behavior before scaling.

Prompt modification

  • Relax [OUTPUT_SCHEMA] to accept free-text dimension notes instead of strict numeric fields.
  • Replace [CONSTRAINTS] with a short instruction: "Provide a completeness score from 1–5 and a one-sentence justification per dimension."
  • Skip temporal and authority dimensions if your retrieval set doesn't yet carry metadata.

Watch for

  • Score inflation on incomplete retrieval sets when the model defaults to generous ratings.
  • Inconsistent dimension definitions across runs without schema enforcement.
  • Missing calibration against human judgments before trusting scores.
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.