This prompt is designed for search architects and RAG pipeline engineers who need to move beyond flat, numerical relevance scores and instead assign categorical relevance tiers to retrieved evidence passages. The core job-to-be-done is explicit, auditable filtering: before answer generation, you need to bucket passages into discrete tiers such as directly-supporting, contextually-relevant, tangentially-related, and irrelevant. This categorical approach makes downstream decisions—like context window allocation, citation selection, and answer abstention—deterministic and explainable. Use this prompt when your retrieval system returns a batch of passages and you require consistent, tiered assignments that can be reviewed, logged, and used to control how much context each passage contributes to the final prompt.
Prompt
Evidence Relevance Tier Assignment Prompt

When to Use This Prompt
Defines the ideal job-to-be-done, user profile, required context, and clear boundaries for when the Evidence Relevance Tier Assignment Prompt should and should not be used.
The ideal user is an engineer or architect who already has a working retrieval pipeline but struggles with inconsistent or opaque passage selection. You should use this prompt when you have a defined set of tier boundaries that align with your product's tolerance for noise and hallucination. For example, a medical RAG system might route only directly-supporting passages to the answer generator, while a research assistant might include contextually-relevant passages with a caveat. This prompt is not a replacement for initial retrieval or embedding-based semantic search. It is a post-retrieval, pre-generation classification step. You must provide the prompt with a batch of passages, the user query, and your organization's tier definitions. If you cannot articulate clear, mutually exclusive tier boundaries, this prompt will produce inconsistent results.
Do not use this prompt when you need a single ranked list of passages by a continuous score. For that, use a numerical relevance scoring prompt. Do not use it when your retrieval set is so large that per-passage classification becomes cost-prohibitive; in that case, apply a cheaper filtering step first. Do not use it when the downstream system cannot consume categorical labels or when you lack a mechanism to enforce tier-based filtering in code. Finally, avoid this prompt if your tier definitions are vague or overlap significantly—ambiguity in tier boundaries is the primary failure mode. Before implementing, define your tiers with concrete, testable criteria, and plan to run consistency checks across retrieval batches to ensure the model is applying your definitions reliably.
Use Case Fit
Where the Evidence Relevance Tier Assignment Prompt works, where it breaks, and what you need before wiring it into a retrieval pipeline.
Good Fit: Pre-Filtering Large Retrieval Sets
Use when: You have 20+ candidate passages from hybrid search and need coarse categorical bucketing before fine-grained re-ranking. Guardrail: Set explicit tier boundary definitions with examples of each tier to prevent inconsistent assignments across batches.
Bad Fit: Binary Relevance Decisions
Avoid when: You only need a simple relevant/irrelevant filter. Tier assignment adds latency and complexity without benefit for binary use cases. Guardrail: Use a threshold-based filtering prompt instead when the decision space is two-class.
Required Inputs: Query, Passages, and Tier Definitions
What you need: The original user query, the full text of each candidate passage, and a calibrated tier taxonomy with boundary examples. Guardrail: Missing tier definitions cause the model to invent its own categories, producing inconsistent assignments that downstream ranking cannot recover from.
Operational Risk: Tier Boundary Drift Across Batches
What to watch: When processing retrieval results in batches, tier boundary interpretation can shift between calls, especially for edge-case passages near category boundaries. Guardrail: Include a fixed calibration example set in every prompt call and run consistency checks across batches by re-scoring a holdout passage set.
Operational Risk: Over-Assignment to Contextually-Relevant
What to watch: Models tend to over-assign passages to the middle tier when uncertain, inflating contextually-relevant counts and diluting downstream selection quality. Guardrail: Require explicit justification for each tier assignment and monitor tier distribution ratios in production logs to detect drift toward safe middle categories.
Not a Replacement for Fine-Grained Scoring
Avoid when: You need precise numerical scores for re-ranking. Tier assignment produces ordinal buckets, not calibrated scores. Guardrail: Use tier assignment as a pre-filter before a numerical scoring prompt, not as the final ranking step. Combine with evidence weighting prompts for production pipelines.
Copy-Ready Prompt Template
A reusable prompt with square-bracket placeholders for assigning evidence passages to relevance tiers in your RAG pipeline.
This template assigns each retrieved passage to one of four relevance tiers: directly-supporting, contextually-relevant, tangentially-related, or irrelevant. It is designed to be dropped into a retrieval re-ranking or filtering step before answer generation. The prompt enforces structured JSON output with explicit tier definitions and requires the model to justify each assignment, making the bucketing auditable and debuggable. Use this when you need categorical evidence filtering rather than continuous scores, and when downstream components need to know not just what is relevant but how relevant each passage is.
textYou are an evidence relevance classifier for a retrieval-augmented generation system. Your task is to assign each provided passage to exactly one relevance tier based on how directly it supports or relates to the given query. ## TIER DEFINITIONS - **directly-supporting**: The passage contains specific facts, data, or claims that directly answer or substantiate the query. It provides concrete information that would appear in a well-grounded answer. - **contextually-relevant**: The passage provides background, definitions, related concepts, or broader context that helps understand the query domain but does not directly answer it. It would be useful as supplementary context. - **tangentially-related**: The passage mentions the query topic or adjacent concepts but does not provide useful information for answering the query. It shares keywords but lacks substantive connection. - **irrelevant**: The passage has no meaningful connection to the query. It may share incidental words but addresses a different topic entirely. ## INPUT **Query:** [QUERY] **Passages to classify:** [PASSAGES] ## OUTPUT SCHEMA Return a JSON object with the following structure: { "classifications": [ { "passage_id": "string", "tier": "directly-supporting | contextually-relevant | tangentially-related | irrelevant", "justification": "One-sentence explanation referencing specific passage content that supports this tier assignment.", "key_evidence_snippet": "Short quote or paraphrase from the passage that most influenced this classification, or null if irrelevant." } ], "tier_summary": { "directly_supporting_count": integer, "contextually_relevant_count": integer, "tangentially_related_count": integer, "irrelevant_count": integer } } ## CONSTRAINTS - Every passage in the input must appear exactly once in the output. - Assign each passage to the highest tier that accurately describes its relationship to the query. Do not inflate tiers. - If a passage could arguably fit two tiers, choose the higher one and note the ambiguity in the justification. - The justification must reference specific content from the passage, not generic statements. - If no passages are directly-supporting, set directly_supporting_count to 0 and do not fabricate support. - Preserve the original passage_id exactly as provided in the input. ## EXAMPLES [EXAMPLES] ## RISK LEVEL [RISK_LEVEL]
Adaptation guidance: Replace [QUERY] with the user's original question or search intent statement. [PASSAGES] should be a JSON array of objects, each containing at minimum a passage_id and text field. The [EXAMPLES] placeholder should contain 2-4 few-shot examples showing correct tier assignments with edge cases such as near-miss passages that share keywords but are irrelevant, and passages that provide context without direct support. Set [RISK_LEVEL] to high for regulated domains where misclassification could cause harm, which will trigger additional conservatism in tier assignment and require human review of directly-supporting classifications. For production use, validate the output JSON against the schema before passing classifications downstream, and log any passages where the model's justification contradicts the assigned tier for pipeline debugging.
Prompt Variables
Required inputs for the Evidence Relevance Tier Assignment Prompt. Each placeholder must be populated before the prompt is sent. Validation notes describe how to verify the input is well-formed before execution.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[QUERY] | The user question or information need that evidence is being ranked against | What are the side effects of drug X in elderly patients? | Must be non-empty string. Check for ambiguous pronouns or unresolved references. If query contains multiple questions, split into separate prompt calls. |
[PASSAGES] | The retrieved evidence passages to classify into relevance tiers | [{"id": "p1", "text": "Clinical trial results show..."}, {"id": "p2", "text": "Drug X was approved in 2015..."}] | Must be valid JSON array with id and text fields per passage. Null or empty array should trigger early return with empty tiers. Validate each passage has non-empty text. |
[TIER_DEFINITIONS] | The categorical tier boundaries with descriptions and inclusion criteria | {"directly_supporting": "Passage contains specific evidence that directly answers the query", "contextually_relevant": "Passage provides background or related context but does not directly answer", "tangentially_related": "Passage mentions related concepts but does not address the query", "irrelevant": "Passage has no meaningful connection to the query"} | Must be valid JSON object with 3-5 tier keys. Each tier must have a non-empty description string. Tier names must be consistent across all prompt calls in a batch. Validate no overlapping tier definitions. |
[OUTPUT_SCHEMA] | The expected JSON structure for tier assignments | {"tier_assignments": [{"passage_id": "p1", "tier": "directly_supporting", "rationale": "Contains specific efficacy data for elderly subgroup"}]} | Must be valid JSON schema or example structure. Schema must include passage_id, tier, and rationale fields. Validate that tier values in schema match [TIER_DEFINITIONS] keys. |
[CONSTRAINTS] | Behavioral rules and edge-case handling instructions | Assign each passage to exactly one tier. If a passage fits multiple tiers, choose the highest relevance tier. If uncertain between two adjacent tiers, default to the lower tier and note uncertainty in rationale. | Must be non-empty string or array of strings. Check for contradictory constraints. Validate that constraints cover edge cases: empty passages, ambiguous passages, passages in wrong language, and passages that partially match multiple tiers. |
[BATCH_SIZE] | Number of passages to process in a single prompt call for consistency | 25 | Must be positive integer. Recommended range 10-50 based on passage length. Larger batches risk tier boundary drift within a batch. Validate that total token count of batch does not exceed model context window minus prompt overhead. |
[CONSISTENCY_ANCHORS] | Reference examples of previously tiered passages to maintain consistent tier boundaries across batches | [{"passage_text": "Drug X shows 40% reduction in symptoms", "assigned_tier": "directly_supporting"}] | Must be valid JSON array or null. If provided, each anchor must have passage_text and assigned_tier fields. Anchors should represent clear examples near tier boundaries. Validate that anchor tiers match [TIER_DEFINITIONS] keys. |
[UNCERTAINTY_THRESHOLD] | Confidence level below which the model should flag a tier assignment as uncertain | 0.7 | Must be float between 0.0 and 1.0. Used to trigger rationale flags like 'LOW_CONFIDENCE' in output. Validate that threshold is not set to 0.0 or 1.0 extremes without explicit intent. Null allowed if uncertainty flagging is not needed. |
Implementation Harness Notes
How to wire the Evidence Relevance Tier Assignment Prompt into a production RAG pipeline with validation, retries, and human review gates.
The tier assignment prompt is designed to sit between retrieval and answer generation in a RAG pipeline. It consumes a query and a batch of retrieved passages, then outputs a structured tier label for each passage. The implementation harness must handle batching, output validation, tier boundary consistency, and fallback behavior when the model produces ambiguous or malformed tier assignments. This prompt is not a standalone classifier; it is a pipeline component that requires surrounding application logic to be production-safe.
Batching and Throughput: Retrieved passages should be grouped into batches of 5–15 per prompt call to balance latency and context window limits. Each batch must include the original query, a unique passage identifier, and the passage text. The application layer should track passage IDs across batches to reconstruct the full tiered retrieval set. For high-throughput systems, parallelize batch calls across multiple model instances and merge results using the passage ID as the join key. Output Validation: Parse the model response as JSON and validate that every passage ID in the input batch appears exactly once in the output, that each tier label matches the allowed enum (directly-supporting, contextually-relevant, tangentially-related, irrelevant), and that the rationale field is present and non-empty. Reject and retry any batch where validation fails. Log validation failures with the raw model output for debugging.
Retry and Fallback Logic: Implement a retry loop with a maximum of 2 retries for validation failures. On the first retry, append the validation error message to the prompt context. On the second retry, lower the temperature to 0 and request a stricter output format. If both retries fail, route the batch to a human review queue and apply a conservative default tier (contextually-relevant) to all unclassified passages to prevent pipeline blockage. Tier Boundary Calibration: Run the prompt against a golden evaluation set of 50–100 passage-query pairs with human-assigned tier labels. Measure Cohen's kappa between model and human labels. If agreement drops below 0.7, review tier boundary definitions in the prompt and adjust the tier descriptions, not the model temperature. Recalibrate after any prompt change or model version upgrade.
Model Choice: Use a model with strong instruction-following and structured output capabilities, such as GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro. Avoid smaller models for this task unless fine-tuned on tier assignment data, as tier boundary judgment requires nuanced relevance reasoning. Logging and Observability: Log every tier assignment call with the query hash, batch ID, model version, prompt version, raw output, validation status, retry count, and final tier labels. This audit trail is essential for debugging tier drift, detecting model behavior changes, and providing evidence for compliance reviews. Human Review Integration: For high-stakes domains such as legal or medical RAG, route all directly-supporting tier assignments to a sampling-based human review queue. Reviewers should confirm that passages labeled as directly supporting the query are not misclassified contextually-relevant passages that happen to share keywords. This gate prevents overconfident evidence selection from propagating into answer generation.
Avoid These Pitfalls: Do not use the tier assignment prompt as a final relevance filter without downstream answer generation checks—a passage can be correctly tiered but still misused by the answer synthesis model. Do not skip output validation; even structured-output models occasionally drop passage IDs or produce invalid enum values under load. Do not assume tier boundaries are stable across model versions; recalibrate after every model upgrade. Finally, do not treat tier assignment as a replacement for retrieval quality monitoring—if retrieval consistently returns irrelevant passages, fix retrieval before layering on tier classification.
Expected Output Contract
Defines the exact JSON schema, field types, validation rules, and constraints for the Evidence Relevance Tier Assignment Prompt output. Use this contract to build downstream parsers, validators, and retry logic.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
tier | string enum: directly-supporting | contextually-relevant | tangentially-related | irrelevant | Must match one of the four allowed enum values exactly. Case-sensitive. No custom tiers allowed. | |
confidence | number (0.0 to 1.0) | Must be a float between 0.0 and 1.0 inclusive. Parse check: reject non-numeric strings. If confidence < 0.5, tier must be tangentially-related or irrelevant. | |
rationale | string (1-3 sentences) | Must contain a direct quote or specific reference to the passage content. Length check: 50-500 characters. Must not be a generic restatement of the tier definition. | |
passage_id | string | Must match the [PASSAGE_ID] provided in the input. Schema check: reject if passage_id is missing, null, or does not match the input identifier. | |
key_evidence_span | string or null | If tier is directly-supporting or contextually-relevant, this field must contain a verbatim quote from the passage. If tier is tangentially-related or irrelevant, null is allowed. Null check: reject empty strings. | |
query_alignment_gap | string or null | Required when tier is tangentially-related or irrelevant. Must explain what specific information is missing or misaligned. Null allowed for higher tiers. Length check: 30-300 characters if present. | |
tier_boundary_flag | boolean | Must be true if confidence is between 0.45-0.55 or if the passage could reasonably fit two adjacent tiers. Triggers human review in downstream systems. Default: false. |
Common Failure Modes
What breaks first when assigning evidence to relevance tiers and how to guard against it.
Tier Boundary Drift Across Batches
What to watch: The model assigns the same passage to 'directly-supporting' in one batch and 'contextually-relevant' in another because tier boundaries shift without explicit anchors. Guardrail: Provide fixed tier definitions with 2-3 anchor examples per tier in the system prompt. Run a consistency check across batches by re-scoring a held-out calibration set and flagging tier-boundary variance above 10%.
Over-Assignment to 'Directly-Supporting'
What to watch: The model inflates relevance to avoid missing important evidence, pushing tangentially-related passages into the top tier and overwhelming downstream selection. Guardrail: Require the model to extract a verbatim quote from the passage that directly answers the query before assigning the top tier. If no quote exists, the passage cannot be 'directly-supporting'. Audit tier distributions for skew.
Length Bias in Tier Assignment
What to watch: Longer passages receive higher relevance tiers regardless of content because the model associates length with informativeness. Guardrail: Normalize passage lengths before scoring or include a 'specificity density' check in the prompt. Test by inserting a long but irrelevant passage into a batch and verifying it lands in 'irrelevant' or 'tangentially-related'.
Query-Intent Mismatch in Tier Logic
What to watch: The model assigns tiers based on surface-level keyword overlap rather than the query's actual information need, promoting passages that mention terms but miss intent. Guardrail: Include an explicit 'intent restatement' step before tier assignment. Have the model rephrase the query's core information need and score passages against that restatement, not the raw query string.
Confidence Inflation on Ambiguous Passages
What to watch: The model assigns high-confidence tier labels to passages where relevance is genuinely ambiguous, creating a false sense of precision for downstream selection. Guardrail: Add an 'uncertain' flag to the output schema. Require the model to mark passages where tier assignment confidence is low and route those to a human review queue or a secondary scoring pass.
Tier Collapse Under Retrieval Noise
What to watch: When retrieval returns mostly low-quality passages, the model still distributes them across tiers instead of assigning most to 'irrelevant', polluting downstream selection with noise. Guardrail: Set an explicit expectation that 'irrelevant' is the default tier. Include a pre-tiering gate that asks: 'Does this passage contain any information related to the query domain?' Only proceed to tier assignment if the answer is yes.
Evaluation Rubric
Criteria for testing whether the Evidence Relevance Tier Assignment Prompt produces consistent, calibrated, and auditable tier assignments before shipping to production.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Tier Boundary Consistency | Same passage assigned to same tier across 3+ identical runs with different random seeds | Tier flips between directly-supporting and contextually-relevant on identical input | Run prompt 5 times on same [PASSAGE] and [QUERY]; measure tier assignment agreement rate; require >= 80% exact match |
Tier Distribution Calibration | Tier distribution across 50-passage batch roughly matches expected retrieval quality profile for the corpus | All passages assigned to directly-supporting or all to irrelevant; no middle tiers used | Run prompt on 50-passage retrieval batch; check that at least 3 of 4 tiers appear; flag if any tier has 0 or >80% of assignments |
Directly-Supporting Precision | Passages labeled directly-supporting contain specific facts, quotes, or data that directly answer [QUERY] | Directly-supporting tier contains vague background context or passages that only mention query terms without answering | Human reviewer or LLM judge checks 20 directly-supporting assignments; >= 85% must contain answer-relevant specific evidence |
Irrelevant Tier Recall | Passages with no topical or factual connection to [QUERY] are assigned to irrelevant tier | Irrelevant tier contains passages that are topically related but lack specific support; tier boundary too aggressive | Insert 5 known-irrelevant passages into batch; verify all 5 land in irrelevant tier; flag any that land in higher tiers |
Tangential vs Contextual Boundary | Tangentially-related tier captures same-domain but off-topic passages; contextually-relevant captures useful background without direct answer | Tangential and contextual tiers are used interchangeably with no discernible pattern | Human reviewer classifies 10 borderline passages; compare to model assignments; require >= 70% agreement on boundary cases |
Tier Justification Quality | Each tier assignment includes a 1-2 sentence justification citing specific passage content that supports the tier choice | Justifications are generic templates like 'this passage is relevant' with no passage-specific evidence | Parse justification field; check for presence of quoted text spans or specific content references from [PASSAGE]; require >= 90% contain passage-specific detail |
Batch Consistency Across Retrieval Sets | Tier assignment logic is stable when same passage appears in different retrieval batches with different surrounding passages | Same passage gets different tier when surrounded by stronger or weaker passages; context contamination | Insert same 5 anchor passages into 3 different retrieval batches; measure tier agreement for anchors; require >= 80% consistency |
Confidence Flag Accuracy | Low-confidence tier assignments are flagged when passage is ambiguous or contains mixed signals | Confidence flag never triggered or triggered randomly; no correlation with actual ambiguity | Create 10 intentionally ambiguous passages; verify confidence flag triggers on >= 7; create 10 clear-cut passages; verify flag triggers on <= 2 |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt and a small retrieval set (10-20 passages). Remove strict schema requirements initially—accept plain text tier labels. Use a single model call per batch.
codeAssign each passage to one tier: [DIRECTLY_SUPPORTING], [CONTEXTUALLY_RELEVANT], [TANGENTIALLY_RELATED], or [IRRELEVANT]. Passage: [PASSAGE_TEXT] Query: [QUERY]
Watch for
- Tier boundary drift when passages are borderline
- Inconsistent labeling across similar passages
- Model defaulting to [CONTEXTUALLY_RELEVANT] as a safe middle ground

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us