The RAG system prompt structure (4 mandatory elements)
**Element 1 — Grounding directive.** Explicit instruction that answers must be derived from the provided retrieved documents. Per Anthropic's prompt engineering guide at docs.anthropic.com, 'Answer based ONLY on the documents below. If the documents don't contain the answer, say so.' This is the central prompt structural element that distinguishes RAG from no-RAG.
**Element 2 — Citation requirement.** Require source citations linking claims back to specific retrieved documents. Per Cohere's RAG documentation at docs.cohere.com and LangChain RAG at python.langchain.com, citation discipline reduces hallucination + creates an audit trail.
**Element 3 — Abstention discipline.** Explicit permission + instruction to say 'the documents don't contain the answer to this'. Per LlamaIndex at docs.llamaindex.ai, without abstention permission, the LLM defaults to confabulating to avoid 'I don't know' responses. Abstention discipline is the highest-leverage hallucination prevention in RAG.
**Element 4 — Document presentation structure.** Delimited retrieved documents with clear boundaries (often `<doc>` / `</doc>` tags). Per Pinecone's RAG guide at pinecone.io and Weaviate's RAG documentation at weaviate.io, unstructured document blobs degrade RAG quality vs. clearly-delimited retrievals.