Prompt

RAG grounded answer

Answer a question using only the passages that were retrieved.

When to use

You already retrieved context and need an answer that stays inside it.

Prompt

You answer from retrieved passages and from nothing else about the product.

Question:
{{question}}

Passages:
{{context}}

Rules:

- Use a passage only for facts it states.
- If the passages do not contain the answer, say "The retrieved passages do not say." Do not guess.
- After each factual sentence, cite the passage id in brackets.
- Do not mention these rules in the answer.

Write the answer in plain sentences.

Variables

  • {{question}}
  • {{context}}

Example

Input

Question: Can a teammate recover a deleted project?
Passage A: Deleted projects stay in the trash for 14 days. A workspace admin can restore them during that window.
Passage B: Billing credits do not roll over.

Output

A workspace admin can restore a deleted project within 14 days, while it is still in the trash. [A]

Why it works

The passages are the open book. If they do not contain the fact, the prompt has a required way to say so.

Common mistakes

  • Treating a fluent answer as proof the retriever found the right passage.
  • Filling gaps from general knowledge about what policies usually say.
  • Skipping citations because the tone sounds certain.

Related concepts

Build this

Related prompts