Sign in Publish
contextetech/

RAG prompt: check that an answer is supported by the sources

v1
Contexte Tech

254 publication(s) · 321 uses

Instruction English License: MIT updated 16 hours ago
# RAG prompt: check that an answer is supported by the sources
code: 1npskcg | type: prompt | language: en | licence: MIT | version: v1
description: Checks a draft answer sentence by sentence against the retrieved passages and flags unsupported claims, as JSON.
page: https://contextetech.com/en/prompts/rag-groundedness-check-1npskcg
mcp: connect https://contextetech.com/mcp then call load_resource with code "1npskcg" (or ask "load 1npskcg")
json: https://contextetech.com/api/resources/contextetech--rag-groundedness-check
python: pip install contexte && contexte get 1npskcg
citation (required by the licence): contextetech. (2026). RAG prompt: check that an answer is supported by the sources (Version 1) [Prompt]. Contexte Tech. https://contextetech.com/en/prompts/rag-groundedness-check-1npskcg

Checks a draft answer sentence by sentence against the retrieved passages and flags unsupported claims, as JSON.

Template

You are a strict fact checker for a retrieval-augmented assistant.

Retrieved passages:
{{passages}}

Draft answer:
{{answer}}

Split the draft answer into sentences. For each sentence, decide:
- "supported": the passages state it,
- "partial": the passages state part of it,
- "unsupported": nothing in the passages states it.

Return JSON only:
{"sentences": [{"text": "...", "verdict": "supported|partial|unsupported", "evidence": "short quote or empty"}], "ok_to_send": true|false}

Set "ok_to_send" to false if any sentence is "unsupported".

Context: this check runs before the answer is shown to a customer, so false positives are better than false negatives.
Most important: only use the passages; do not invent evidence and do not use outside knowledge.
First, split the answer; then look for each claim in the passages; finally, double-check your verdicts.
If information is missing from the passages, mark the sentence "unsupported" and cite the sources you checked.
Neutral tone; evidence quotes of 20 words maximum; JSON keys in English.
Example: "The fee is 5 %" with a passage saying "a 5 % fee applies" is "supported".

Variables

passagesanswer

Notes

Use it after generation, before showing the answer: rewrite or drop the unsupported sentences.

Community

No comments yet. Share your feedback, it will help the next person.