aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/agentsystem
diff options
context:
space:
mode:
authorA.J. Shulman <Shulman.aj@gmail.com>2024-09-07 13:07:33 -0400
committerA.J. Shulman <Shulman.aj@gmail.com>2024-09-07 13:07:33 -0400
commitba0520baaa1f84d9fb08d3b2880c68302d28350a (patch)
treedb38b62a6942906d51a8fb7c66eee1f31fd6623f /src/client/views/nodes/chatbot/agentsystem
parent4791cd23af08da70895204a3a7fbaf889d9af2d5 (diff)
added clarifying structural info to ReAct prompt (still ~69% shorter than previous prompt) and shortened the RAG prompt
Diffstat (limited to 'src/client/views/nodes/chatbot/agentsystem')
-rw-r--r--src/client/views/nodes/chatbot/agentsystem/prompts.ts28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/client/views/nodes/chatbot/agentsystem/prompts.ts b/src/client/views/nodes/chatbot/agentsystem/prompts.ts
index 9daabc35f..7000d8634 100644
--- a/src/client/views/nodes/chatbot/agentsystem/prompts.ts
+++ b/src/client/views/nodes/chatbot/agentsystem/prompts.ts
@@ -26,12 +26,33 @@ export function getReactPrompt(tools: Tool[], summaries: () => string, chatHisto
<point>Ensure that **ALL answers follow the answer structure**: grounded text wrapped in <grounded_text> tags with corresponding citations, normal text in <normal_text> tags, and three follow-up questions at the end.</point>
</critical_points>
+ <thought_structure>
+ <thought>
+ <description>
+ Always provide a thought before each action to explain why you are choosing the next step or tool. This helps clarify your reasoning for the action you will take.
+ </description>
+ </thought>
+ </thought_structure>
+
+ <action_input_structure>
+ <action_input>
+ <action_input_description>
+ Always describe what the action will do in the <action_input_description> tag. Be clear about how the tool will process the input and why it is appropriate for this stage.
+ </action_input_description>
+ <inputs>
+ <description>
+ Provide the actual inputs for the action in the <inputs> tag. Ensure that each input is specific to the tool being used. Inputs should match the expected parameters for the tool (e.g., a search term for the website scraper, document references for RAG).
+ </description>
+ </inputs>
+ </action_input>
+ </action_input_structure>
+
<answer_structure>
<answer>
<grounded_text> - All information derived from tools or user documents must be wrapped in these tags with proper citation.</grounded_text>
- <normal_text> - Use this tag for text not derived from tools or user documents.</normal_text>
+ <normal_text> - Use this tag for text not derived from tools or user documents. It should only be for narrative-like text or extremely common knowledge information.</normal_text>
<citations>
- <citation> - Provide proper citations for each <grounded_text>, referencing the tool or document chunk used.</citation>
+ <citation> - Provide proper citations for each <grounded_text>, referencing the tool or document chunk used. ENSURE THAT THERE IS A CITATION WHOSE INDEX MATCHES FOR EVERY GROUNDED TEXT CITATION INDEX. </citation>
</citations>
<follow_up_questions> - Provide exactly three user-perspective follow-up questions.</follow_up_questions>
<loop_summary> - Summarize the actions and tools used in the conversation.</loop_summary>
@@ -41,7 +62,8 @@ export function getReactPrompt(tools: Tool[], summaries: () => string, chatHisto
<grounded_text_guidelines>
<step>**Wrap ALL tool-based information** in <grounded_text> tags and provide citations.</step>
<step>Use separate <grounded_text> tags for distinct information or when switching to a different tool or document.</step>
- <step>Ensure that **EVERY** <grounded_text> tag includes a citation index referencing the source of the information.</step>
+ <step>Ensure that **EVERY** <grounded_text> tag includes a citation index aligned with a citation that you provide that references the source of the information.</step>
+ <step>There should be a one-to-one relationship between <grounded_text> tags and citations.</step>
<step>Over-citing is discouraged—only cite the information that is directly relevant to the user's query.</step>
</grounded_text_guidelines>