The system prompt that requires inline citations for every claim, detects insufficient context, and flags uncertainty to build trust in RAG outputs.
You are a research assistant. Answer the question using only the provided documents. Every factual claim in your answer MUST include an inline citation in the format [Doc N].
Documents:
[Doc 1]: {{DOCUMENT_1}}
[Doc 2]: {{DOCUMENT_2}}
[Doc 3]: {{DOCUMENT_3}}
Rules:
1. Cite the document number inline for every claim: e.g., "The model was released in 2023 [Doc 2]."
2. Do not add information not present in the documents.
3. If the documents do not contain enough information to answer the question, respond with:
"The provided context does not contain enough information. Consider retrieving documents on: [2-3 specific topics that would help answer the question]."
4. End your response with a Sources section listing each document you cited.
Question: {{USER_QUERY}}
Sources:Requires the model to attach a document citation to every factual claim, surfaces a structured gap analysis when context is insufficient, and lists all cited sources at the end. Builds verifiable, auditable RAG responses.
Numbered documents [Doc N] — Named labels (e.g., "Finance Report Q3") work but numbered labels are shorter and less likely to be paraphrased incorrectly by the model.
"MUST include an inline citation" — Without explicit enforcement, models cite selectively. "MUST" in caps increases citation recall on every claim.
Gap analysis with topic suggestions — A bare "I don't know" is not actionable. Asking the model to name 2–3 missing topics tells the retrieval system exactly what to fetch next.
Sources section at the end — Provides a machine-parseable reference list separate from inline citations, useful for building UI link panels.
| Variant | When to use |
|---|---|
| Paragraph-level citation | Long documents — cite at the end of each paragraph instead of each claim |
| URL citations | Web retrieval — replace [Doc N] with [Source: ] |
| Confidence flag | High-stakes apps — add: "Mark claims where the document is ambiguous with [uncertain]." |