From ba0520baaa1f84d9fb08d3b2880c68302d28350a Mon Sep 17 00:00:00 2001 From: "A.J. Shulman" Date: Sat, 7 Sep 2024 13:07:33 -0400 Subject: added clarifying structural info to ReAct prompt (still ~69% shorter than previous prompt) and shortened the RAG prompt --- .../views/nodes/chatbot/agentsystem/prompts.ts | 28 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'src/client/views/nodes/chatbot/agentsystem') 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 Ensure that **ALL answers follow the answer structure**: grounded text wrapped in tags with corresponding citations, normal text in tags, and three follow-up questions at the end. + + + + 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. + + + + + + + + Always describe what the action will do in the tag. Be clear about how the tool will process the input and why it is appropriate for this stage. + + + + Provide the actual inputs for the action in the 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). + + + + + - All information derived from tools or user documents must be wrapped in these tags with proper citation. - - Use this tag for text not derived from tools or user documents. + - 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. - - Provide proper citations for each , referencing the tool or document chunk used. + - Provide proper citations for each , referencing the tool or document chunk used. ENSURE THAT THERE IS A CITATION WHOSE INDEX MATCHES FOR EVERY GROUNDED TEXT CITATION INDEX. - Provide exactly three user-perspective follow-up questions. - Summarize the actions and tools used in the conversation. @@ -41,7 +62,8 @@ export function getReactPrompt(tools: Tool[], summaries: () => string, chatHisto **Wrap ALL tool-based information** in tags and provide citations. Use separate tags for distinct information or when switching to a different tool or document. - Ensure that **EVERY** tag includes a citation index referencing the source of the information. + Ensure that **EVERY** tag includes a citation index aligned with a citation that you provide that references the source of the information. + There should be a one-to-one relationship between tags and citations. Over-citing is discouraged—only cite the information that is directly relevant to the user's query. -- cgit v1.2.3-70-g09d2