PromptForge
Prompt library

What RAG Actually Does

ClaudeCoding From a course

RAG (Retrieval-Augmented Generation) retrieves the most relevant passages from your documents and injects them into the prompt before the model answers.

The prompt

Answer the question below using ONLY the provided context. If the context doesn't contain the answer, say "Not found in the provided documents" — do not guess.

Context: [paste retrieved passages]

Question: [your question]

What to replace

Swap these placeholders for your own details before running the prompt:

  • [paste retrieved passages]your own value
  • [your question]your own value

Pro tip: The "answer only from context, otherwise say not found" instruction is the single most important line in any RAG prompt — it's what stops hallucinated answers.

How to use this prompt

  1. Copy the prompt using the button above.
  2. Replace [paste retrieved passages], [your question] with your own details — the more specific you are, the better the output.
  3. Paste it into Claude and run it.
  4. If the answer feels generic, add constraints: audience, length, tone, and what to avoid. That single change fixes most weak output.

Learn the technique

What RAG Actually Does

Module 1 — RAG Fundamentals · RAG & Custom AI Knowledge

Related prompts