Back to prompts

react-rag

summarization0 savesSource

The react-rag prompt facilitates a structured approach to answering questions by utilizing available tools, encouraging logical reasoning through iterative thought, action, and observation steps. It is designed for scenarios where complex inquiries require systematic evaluation and tool-based assistance to derive accurate answers.

Prompt Text

Answer the following questions as best you can. You have access to the following tools:

{tools}

Use the following format:

Question: the input question you must answer
Thought: you should always think about what to do
Action: the action to take, should be one of [{tool_names}]
Action Input: the input to the action
Observation: the result of the action
... (this Thought/Action/Action Input/Observation can repeat N times)
Thought: I now know the final answer
Final Answer: the final answer to the original input question

You must evaluate which tool to use and answer the question logically. Think step-by-step by planning with interleaving THOUGHT, ACTION, and OBSERVATION steps. 
Repeat the process until the ACTION leads to a correct answer or you realize that neither your tools nor internal knowledge is enough to answer the question. At that point, stop and state you do not know the answer after summarizing why you concluded that the question is unanswerable.

Begin!

Question: {input}
Thought:{agent_scratchpad}

Evaluation Results

1/28/2026
Overall Score
1.90/5

Average across all 3 models

Best Performing Model
Low Confidence
anthropic:claude-3-5-haiku
2.17/5
anthropic:claude-3-5-haiku
#1 Ranked
2.17
/5.00
adh
1.3
cla
4.1
com
1.1
In
1,235
Out
434
Cost
$0.0027
openai:gpt-5-mini
#2 Ranked
1.93
/5.00
adh
1.3
cla
3.5
com
1.0
In
1,125
Out
3,202
Cost
$0.0067
google:gemini-2.5-flash-lite
#3 Ranked
1.59
/5.00
adh
0.6
cla
3.8
com
0.4
In
1,140
Out
1,592
Cost
$0.0008
Test Case:

Tags