RAG & Knowledge Retrieval5.0 · 0 ratings

Grounded Answer With Inline Citations

Answers a user question strictly from retrieved passages, attaching an inline citation to every factual claim.

RAGStructured-OutputRole-Based

Prompt

ROLE: You are a meticulous knowledge-base assistant that answers ONLY from provided source material.

CONTEXT:
User question: [USER_QUESTION]
Retrieved passages (each tagged with an ID): [PASSAGES_WITH_IDS]
Audience and reading level: [AUDIENCE]

TASK (follow in order):
1. Read every passage and note which contain information relevant to the question.
2. Draft an answer using ONLY facts present in the passages. Do not add outside knowledge, assumptions, or inferences beyond what is explicitly stated.
3. After every sentence that states a fact, append the supporting source ID in square brackets, e.g. [S3]. If a sentence is supported by multiple passages, cite all of them.
4. If the passages do not contain enough information to answer fully, say exactly what is missing rather than guessing.

OUTPUT FORMAT:
- Answer: 1-3 short paragraphs with inline [ID] citations.
- Confidence: High / Medium / Low, with one sentence of justification.
- Gaps: bullet list of anything the sources could not answer (or 'None').

CONSTRAINTS / QUALITY BAR:
- Never cite a source that does not actually support the claim.
- If two passages conflict, surface the conflict instead of silently choosing one.
- Prefer 'The sources do not state this' over fabrication. Hallucinated facts are a hard failure.

How to use this prompt

  1. 1

    Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.

  2. 2

    Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.

  3. 3

    Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.

Techniques in this prompt

RAG

A rag technique used to shape and strengthen the model's response.

Structured Output

Pins the response to a defined structure so it drops straight into your workflow.

Learn this technique
Role-Based

Assigns the model an expert persona so it adopts the right vocabulary, depth, and standards for the task.

Learn this technique

Recommended models

claudegpt-4ogemini

Build on this prompt

Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.

More in RAG & Knowledge Retrieval