Back to prompts

RAG Query Answering

extraction0 savesSource

This template facilitates the retrieval-augmented generation (RAG) process by allowing users to input a specific query and relevant documents, ensuring that responses are contextually accurate and directly address the question without unnecessary introduction. It is particularly useful for generating precise answers in knowledge-intensive applications, such as customer support or research assistance.

Prompt Text

You have been tasked with helping us to answer the following query:
<query>
{{query}}
</query>
You have access to the following documents which are meant to provide context as you answer the query:
<documents>
{{documents}}
</documents>
Please remain faithful to the underlying context, and only deviate from it if you are 100% sure that you know the answer already.
Answer the question now, and avoid providing preamble such as 'Here is the answer', etc

Evaluation Results

1/29/2026
Overall Score
4.02/5

Average across all 3 models

Best Performing Model
Low Confidence
openai:gpt-5-mini
4.14/5
openai:gpt-5-mini
#1 Ranked
4.14
/5.00
adh
4.1
cla
4.8
com
3.5
In
515
Out
1,443
Cost
$0.0030
anthropic:claude-3-5-haiku
#2 Ranked
3.98
/5.00
adh
4.0
cla
4.7
com
3.2
In
580
Out
277
Cost
$0.0016
google:gemini-2.5-flash-lite
#3 Ranked
3.93
/5.00
adh
4.0
cla
4.6
com
3.2
In
535
Out
215
Cost
$0.0001
Test Case:

Tags