This prompt is designed for a specific, high-stakes job: extracting the most relevant verbatim quotes from source documents that directly support a given claim. It is built for citation-aware QA builders, fact-checking pipelines, and any system where grounding must be transparent and auditable. The core value is forcing the model to select exact text spans rather than paraphrasing, producing structured output that maps each quote to its source location and a relevance score. Use this when you need to show users exactly which passage supports an answer, when you must pass audit requirements for evidence provenance, or when downstream answer generation depends on precise evidence selection.
Prompt
Claim-Supporting Quote Extraction Prompt Template

When to Use This Prompt
Understand the ideal use cases, required inputs, and critical boundaries for deploying a claim-supporting quote extraction prompt in production.
The ideal user is an engineering lead or AI builder integrating evidence extraction into a larger product workflow. Required inputs include a specific [CLAIM] to verify and one or more [SOURCE_DOCUMENTS] with clear identifiers. The prompt is most effective when the source documents are pre-segmented with stable IDs (e.g., doc_id, chunk_index) that can survive downstream processing. Do not use this prompt for open-ended summarization, creative generation, or tasks where verbatim extraction is unnecessary. It is also a poor fit when source documents are highly unstructured, contain heavy visual elements like charts, or when the claim is too vague to map to specific text spans. In those cases, a broader RAG synthesis or document intelligence prompt would be more appropriate.
Before deploying, ensure your evaluation harness measures both precision (are extracted quotes actually relevant?) and recall (are all supporting quotes found?) against human-annotated evidence spans. Common failure modes include the model extracting quotes that are topically related but do not actually support the claim, or missing key evidence buried in long documents. Plan for a human review step when the output will be surfaced in user-facing citations or audit trails. The next section provides the copy-ready prompt template you can adapt and wire into your application.
Use Case Fit
Where the Claim-Supporting Quote Extraction Prompt Template works and where it does not. Use these cards to decide if this prompt fits your pipeline before you integrate it.
Good Fit: Citation-Aware QA Systems
Use when: you are building a RAG application that must display verbatim source text alongside generated answers. Guardrail: the prompt expects pre-retrieved documents; ensure your retrieval step passes clean, deduplicated text chunks.
Bad Fit: Unstructured or Noisy Source Text
Avoid when: source documents contain heavy OCR artifacts, inconsistent formatting, or merged table cells. Guardrail: preprocess documents with layout-aware parsing before extraction; the prompt assumes readable, well-formed text spans.
Required Inputs
What you must provide: a specific claim string and one or more source document passages with identifiers. Guardrail: missing document IDs or passage boundaries will cause the output schema to fail validation; always include source_id and span_start/span_end metadata.
Operational Risk: Hallucinated Quotes
What to watch: the model may generate a quote that looks verbatim but does not appear in the source text. Guardrail: run every extracted quote through an exact substring match or fuzzy string comparison against the source passage before surfacing to users.
Operational Risk: Over-Extraction
What to watch: the model returns long, irrelevant passages instead of minimal supporting spans. Guardrail: set a maximum character or token limit per quote in the output schema and use a secondary LLM judge to score quote relevance.
Variant: Multi-Document Aggregation
Use when: a single claim must be supported by quotes from multiple documents. Guardrail: switch to the Multi-Document Quote Aggregation Prompt variant and track provenance per quote to avoid mixing sources without attribution.
Copy-Ready Prompt Template
A reusable prompt for extracting verbatim quotes from source documents that directly support a given claim, with structured output for quote text, source span, and relevance score.
This prompt template is designed for citation-aware QA builders who need to extract the most relevant verbatim quotes from source documents that directly support a specific claim. It enforces strict output structure, requires source anchoring, and includes relevance scoring to make evidence selection transparent and auditable. The template uses square-bracket placeholders that you replace with your application's inputs before sending the request to the model.
textYou are an evidence extraction specialist. Your task is to find verbatim quotes from the provided source documents that directly support the given claim. ## INPUT **Claim:** [CLAIM] **Source Documents:** [DOCUMENTS] ## INSTRUCTIONS 1. Read the claim carefully and identify what specific factual assertions it makes. 2. Search the source documents for verbatim text that directly supports each assertion. 3. Extract only quotes that provide direct evidence for the claim. Do not extract quotes that are merely topically related but do not actually support the claim. 4. For each extracted quote, identify the exact source span (document ID, section, paragraph, or character offsets if available). 5. Assign a relevance score from 0.0 to 1.0 where: - 0.9-1.0: The quote directly proves or strongly supports the claim. - 0.7-0.89: The quote provides substantial but partial support. - 0.5-0.69: The quote is relevant but requires inference to connect to the claim. - 0.0-0.49: The quote is tangentially related and should not be included. 6. If no quote meets the 0.5 threshold, return an empty quotes array with a brief explanation of the evidence gap. 7. Do not paraphrase, summarize, or modify the quote text. Extract exact verbatim text only. ## CONSTRAINTS - [CONSTRAINTS] ## OUTPUT SCHEMA Return a JSON object with this exact structure: { "claim": "[CLAIM]", "quotes": [ { "quote_text": "Exact verbatim text from the source document", "source": { "document_id": "Identifier for the source document", "location": "Section, paragraph, or character offset reference", "document_title": "Title or name of the source document if available" }, "relevance_score": 0.0, "relevance_rationale": "Brief explanation of why this quote supports the claim" } ], "sufficiency_assessment": { "is_sufficient": true, "explanation": "Whether the extracted quotes collectively provide sufficient evidence for the claim" } } ## EXAMPLES [EXAMPLES]
To adapt this template, replace the square-bracket placeholders with your application's actual values. The [CLAIM] placeholder should contain the specific claim you need evidence for. The [DOCUMENTS] placeholder should contain your retrieved source documents formatted with clear document IDs and section markers. The [CONSTRAINTS] placeholder lets you add domain-specific rules such as minimum quote length, maximum number of quotes, or required source metadata fields. The [EXAMPLES] placeholder should contain one or two few-shot examples showing the desired extraction behavior, especially for edge cases like partial support or conflicting evidence. Always test the adapted prompt against a golden dataset of human-annotated evidence spans to measure precision and recall before deploying to production.
Prompt Variables
Required inputs for the Claim-Supporting Quote Extraction Prompt Template. Each placeholder must be populated before the prompt is assembled and sent to the model. Validation notes describe how to verify the input is well-formed before execution.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CLAIM] | The assertion or statement that requires supporting evidence from source documents | The company's Q3 revenue exceeded analyst expectations by 12% | Must be a single declarative sentence. Reject if empty, multi-claim, or purely interrogative. Parse check: ends with period, contains subject and predicate. |
[SOURCE_DOCUMENTS] | The corpus of text passages to search for supporting quotes, typically from a retrieval step | Document 1: Q3 Earnings Release... Document 2: Analyst Call Transcript... | Must contain at least one non-empty document. Each document requires a unique [DOC_ID]. Reject if all documents are empty or if total character count exceeds model context window minus prompt overhead. |
[DOC_ID] | Unique identifier for each source document, used for provenance tracking in output spans | doc_earnings_q3_2025 | Must be unique within the batch. Format: alphanumeric with underscores. Null not allowed. Parse check: no duplicates in [SOURCE_DOCUMENTS] list. |
[NUM_QUOTES] | Maximum number of distinct quotes to extract per claim | 3 | Must be an integer between 1 and 10. Reject if 0 or negative. Default to 3 if not specified. Higher values increase token cost and may introduce lower-relevance quotes. |
[MIN_QUOTE_LENGTH] | Minimum character length for an extracted quote to prevent fragmentary or meaningless spans | 50 | Must be an integer >= 20. Reject if lower, as very short spans rarely provide meaningful support. Adjust upward for legal or regulatory use cases where full clause context is required. |
[RELEVANCE_THRESHOLD] | Minimum relevance score (0.0 to 1.0) for a quote to be included in output | 0.7 | Must be a float between 0.0 and 1.0. Reject if outside range. Lower thresholds increase recall but risk including tangentially related quotes. Calibrate against human-annotated evidence spans for the target domain. |
[OUTPUT_SCHEMA] | The expected JSON structure for each extracted quote, including fields for text, source span, and score | {"quote_text": string, "doc_id": string, "start_char": int, "end_char": int, "relevance_score": float, "rationale": string} | Must be a valid JSON Schema or example object. Parse check: valid JSON. Schema check: requires quote_text, doc_id, start_char, end_char, relevance_score fields at minimum. Reject if schema is missing required fields. |
Implementation Harness Notes
How to wire the claim-supporting quote extraction prompt into a production application with validation, retries, and observability.
The claim-supporting quote extraction prompt is designed to be called after retrieval and before answer generation in a RAG pipeline. The typical call pattern is: retrieve candidate documents, chunk them into manageable passages, and then invoke this prompt once per claim with the top-k passages as [SOURCE_DOCUMENTS]. Because the prompt returns structured JSON with quote text, source spans, and relevance scores, you can parse the output directly into your application's evidence store or citation renderer. Do not use this prompt on raw, unchunked documents—context windows will overflow and quote precision will degrade. Instead, pre-chunk documents into 500–1500 token passages with overlapping windows of 100–200 tokens to preserve quote boundaries, and pass only the top 5–15 passages per claim.
Validation is the first integration checkpoint. The output schema enforces quote_text, source_span (start and end character offsets), relevance_score (0.0–1.0), and reasoning. Before accepting any extracted quote, validate that: (1) the quote_text appears verbatim in the source document at the claimed offsets, (2) the relevance_score is a float in range, and (3) the reasoning field is non-empty. If validation fails, retry the prompt once with the validation error message appended to [CONSTRAINTS]. If the retry also fails, log the failure and escalate to a human review queue rather than silently accepting a malformed quote. For high-stakes domains like legal or compliance, always require human approval on quotes with relevance_score below 0.7 or where the source document contains contradictory language.
Model choice matters for this prompt. Use a model with strong instruction-following and structured output capabilities—GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro are good defaults. Avoid smaller models (under 7B parameters) for this task because they struggle with precise span boundary detection and tend to paraphrase rather than extract verbatim text. If you must use a smaller model, add a post-extraction verification step that checks exact string matching between the claimed quote and the source document. For latency-sensitive applications, consider batching multiple claims against the same document set in a single prompt call, but cap the batch at 5 claims to prevent attention dilution. Log every extraction with the prompt version, model, source document IDs, extracted quotes, validation results, and any human review decisions. This audit trail is essential for debugging hallucinated citations and for demonstrating grounding fidelity to compliance reviewers.
The most common production failure mode is the model extracting a quote that appears verbatim but is taken out of context—supporting the claim in isolation while the surrounding passage actually contradicts it. Mitigate this by including a [CONSTRAINTS] instruction that requires the model to read the full paragraph surrounding any candidate quote before extracting. A second failure mode is the model returning character offsets that are off by a few characters due to tokenization differences. Always implement fuzzy matching with a ±10 character tolerance when verifying span boundaries, and normalize whitespace before comparison. Finally, if your source documents contain tables, footnotes, or structured fields, preprocess them to flatten or annotate these elements before passing them to the prompt—the model will otherwise struggle to extract clean quotes from non-prose content.
Expected Output Contract
Validate every extracted quote against this contract before it enters your citation pipeline. Each field includes a concrete validation rule that can be automated in a post-processing harness.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
quotes | Array of objects | Must be a non-empty array. If no supporting quote exists, return an empty array and set evidence_sufficient to false. | |
quotes[].quote_text | String | Must be a verbatim substring of [SOURCE_DOCUMENT]. Perform exact string match; reject any paraphrase, summary, or altered text. | |
quotes[].source_span | Object with start and end integers | start and end must be non-negative integers. end must be greater than start. The substring from start to end in [SOURCE_DOCUMENT] must equal quote_text exactly. | |
quotes[].relevance_score | Number (0.0 to 1.0) | Must be a float between 0.0 and 1.0 inclusive. Reject if score is below [MIN_RELEVANCE_THRESHOLD] unless evidence_sufficient is false. | |
quotes[].relevance_rationale | String | Must contain a non-empty explanation linking the quote to [CLAIM]. Reject if rationale is generic, circular, or repeats the quote without analysis. | |
evidence_sufficient | Boolean | Must be true if at least one quote meets relevance threshold and directly addresses [CLAIM]. Set to false if quotes are tangential, incomplete, or contradictory. | |
insufficiency_reason | String or null | Required when evidence_sufficient is false. Must describe what is missing, outdated, or contradictory. Reject if null when evidence_sufficient is false. | |
extraction_timestamp | ISO 8601 string | Must be a valid UTC timestamp. Reject if missing or unparseable. Used for freshness checks against [SOURCE_DATE]. |
Common Failure Modes
What breaks first when extracting claim-supporting quotes and how to guard against it.
Hallucinated Quotes
What to watch: The model generates a quote that looks plausible but does not appear verbatim in the source document. This is the most dangerous failure mode because fabricated evidence undermines trust and creates audit risk. Guardrail: Require exact string matching or fuzzy matching with a high threshold against the source text. Add a validator that rejects any extracted span not found in the original document. Use a secondary verification prompt to confirm quote presence before returning results.
Out-of-Context Snippets
What to watch: The model extracts a technically verbatim quote but strips surrounding context that changes its meaning. A sentence that appears supportive in isolation may contradict the claim when read with the preceding paragraph. Guardrail: Enforce a minimum context window around every extracted quote. Include preceding and following sentences in the output schema. Add a context-fidelity check that compares the quote's meaning in isolation versus in its original surrounding text.
Relevance Drift
What to watch: The model returns quotes that are topically adjacent but do not directly support the specific claim. This happens when retrieval ranking bleeds into extraction and the model prioritizes prominent passages over precisely relevant ones. Guardrail: Use a dedicated relevance scoring step before quote extraction. Require the model to articulate why each quote supports the claim. Set a minimum relevance threshold and discard quotes that fail. Evaluate precision against human-annotated evidence spans.
Missing Critical Evidence
What to watch: The model returns supporting quotes but omits the strongest or most direct evidence in the document. This recall failure happens when the model fixates on the first matching passage or overlooks evidence in less prominent sections. Guardrail: Implement a coverage check that scans for known evidence patterns. Use a secondary extraction pass with explicit instructions to find additional quotes. Compare extracted spans against a human-annotated evidence set during evaluation. Flag low-recall outputs for human review.
Source Provenance Loss
What to watch: The model returns quote text without reliable source metadata, making it impossible to trace which document, section, or page the quote came from. This breaks audit trails and citation rendering. Guardrail: Enforce mandatory source anchoring in the output schema. Require document ID, section heading, page number, and retrieval rank for every extracted quote. Validate that every returned span includes complete provenance before the output leaves the extraction pipeline.
Near-Duplicate Quote Flooding
What to watch: The model returns multiple quotes that are semantically identical or differ by only a few words, flooding the output with redundant evidence and wasting context budget. Guardrail: Add a deduplication step that compares extracted quotes using semantic similarity or n-gram overlap. Keep only the most complete or authoritative version of each distinct piece of evidence. Set a maximum quote count per claim to prevent evidence bloat.
Evaluation Rubric
Use this rubric to test the quality of extracted quotes before integrating the prompt into a production pipeline. Each criterion targets a specific failure mode common in evidence extraction.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Quote Verbatim Fidelity | Extracted text matches the source document character-for-character, including punctuation and capitalization. | Paraphrased text, truncated words, or added/removed punctuation inside the quote span. | Automated string equality check between extracted [QUOTE] and the source document at [START_OFFSET] to [END_OFFSET]. |
Source Span Accuracy | [START_OFFSET] and [END_OFFSET] correctly locate the quote in the source document. | Off-by-one errors, offsets pointing to wrong paragraph, or negative span lengths. | Parse offsets as integers and verify the substring at those positions matches the extracted [QUOTE] exactly. |
Claim Relevance | The quote directly supports or refutes the target [CLAIM] without requiring external inference. | Quote is topically related but does not address the specific assertion in the claim. | LLM Judge pairwise comparison: human annotator rates relevance on a 1-5 scale; pass if score >= 4. |
Relevance Score Calibration | [RELEVANCE_SCORE] is a float between 0.0 and 1.0 that correlates with human relevance judgments. | Score is always 1.0, null, or inversely correlated with human judgment. | Calculate Spearman rank correlation between model-assigned [RELEVANCE_SCORE] and human relevance labels across 100+ test cases; pass if correlation > 0.7. |
No Hallucinated Content | The quote contains only text present in the source document; no fabricated details. | Quote includes dates, names, or figures not found in the source. | Run a hallucination detection prompt comparing [QUOTE] against the full source document; flag any span not present verbatim. |
Sufficiency Flag Correctness | [IS_SUFFICIENT] is true only when the quote alone provides enough evidence for the claim. | [IS_SUFFICIENT] is true for quotes that are merely suggestive or require additional context. | Human review of 50 random samples where [IS_SUFFICIENT] is true; pass if >= 90% are judged genuinely sufficient. |
Empty Result Handling | Returns an empty list or null [QUOTES] array when no quote in the source supports the claim. | Returns a low-relevance quote, a generic sentence, or fabricates a quote when evidence is absent. | Test with 20 claim-source pairs where no supporting quote exists; pass if 100% return empty or null [QUOTES]. |
Multi-Quote Deduplication | When multiple quotes are returned, no two quotes overlap by more than 50% character length. | Near-duplicate quotes with minor punctuation differences or overlapping spans. | Compute pairwise Jaccard similarity on character n-grams for all returned quotes; pass if max similarity < 0.5. |
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
Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet). Accept string output and parse JSON manually. Skip strict schema validation during early testing. Focus on whether quotes are verbatim and spans are correct.
Prompt modification
Remove the [OUTPUT_SCHEMA] block and replace with: Return a JSON array of objects with fields: quote, source_span, relevance_score, reasoning.
Watch for
- Model paraphrasing instead of extracting verbatim text
- Missing
source_spanfields when the model can't locate exact positions - Relevance scores that are all 0.9+ without discrimination
- JSON parse failures from unescaped quotes in extracted text

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