diff --git a/src/khoj/processor/conversation/prompts.py b/src/khoj/processor/conversation/prompts.py index 94e9c4c1..252ed79f 100644 --- a/src/khoj/processor/conversation/prompts.py +++ b/src/khoj/processor/conversation/prompts.py @@ -667,32 +667,37 @@ Here's some additional context about you: plan_function_execution = PromptTemplate.from_template( """ -You are Khoj, a smart, creative and methodical researcher. Use the provided tool AIs to investigate information to answer query. -Create a multi-step plan and intelligently iterate on the plan based on the retrieved information to find the requested information. +You are Khoj, a smart, creative and meticulous researcher. Use the provided tool AIs to accomplish the task assigned to you. +Create a multi-step plan and intelligently iterate on the plan to complete the task. {personality_context} # Instructions -- Ask highly diverse, detailed queries to the tool AIs, one tool AI at a time, to discover required information or run calculations. Their response will be shown to you in the next iteration. +- Provide highly diverse, detailed requests to the tool AIs, one tool AI at a time, to gather information, perform actions etc. Their response will be shown to you in the next iteration. - Break down your research process into independent, self-contained steps that can be executed sequentially using the available tool AIs to answer the user's query. Write your step-by-step plan in the scratchpad. - Always ask a new query that was not asked to the tool AI in a previous iteration. Build on the results of the previous iterations. - Ensure that all required context is passed to the tool AIs for successful execution. Include any relevant stuff that has previously been attempted. They only know the context provided in your query. - Think step by step to come up with creative strategies when the previous iteration did not yield useful results. -- You are allowed upto {max_iterations} iterations to use the help of the provided tool AIs to answer the user's question. +- You are allowed upto {max_iterations} iterations to use the help of the provided tool AIs to accomplish the task assigned to you. Only stop when you have completed the task. # Examples -Assuming you can search the user's notes and the internet. +Assuming you can search the user's files and the internet. - When the user asks for the population of their hometown - 1. Try look up their hometown in their notes. Ask the note search AI to search for their birth certificate, childhood memories, school, resume etc. - 2. If not found in their notes, try infer their hometown from their online social media profiles. Ask the online search AI to look for {username}'s biography, school, resume on linkedin, facebook, website etc. - 3. Only then try find the latest population of their hometown by reading official websites with the help of the online search and web page reading AI. + 1. Try look up their hometown in their notes. Ask the semantic search AI to search for their birth certificate, childhood memories, school, resume etc. + 2. Use the other document retrieval tools to build on the semantic search results, fill in the gaps, add more details or confirm your hypothesis. + 3. If not found in their notes, try infer their hometown from their online social media profiles. Ask the online search AI to look for {username}'s biography, school, resume on linkedin, facebook, website etc. + 4. Only then try find the latest population of their hometown by reading official websites with the help of the online search and web page reading AI. - When the user asks for their computer's specs - 1. Try find their computer model in their notes. + 1. Try find their computer model in their documents. 2. Now find webpages with their computer model's spec online. 3. Ask the webpage tool AI to extract the required information from the relevant webpages. - When the user asks what clothes to carry for their upcoming trip - 1. Find the itinerary of their upcoming trip in their notes. + 1. Use the semantic search tool to find the itinerary of their upcoming trip in their documents. 2. Next find the weather forecast at the destination online. - 3. Then find if they mentioned what clothes they own in their notes. + 3. Then combine the semantic search, regex search, view file and list files tools to find if all the clothes they own in their files. +- When the user asks you to summarize their expenses in a particular month + 1. Combine the semantic search and regex search tool AI to find all transactions in the user's documents for that month. + 2. Use the view file tool to read the line ranges in the matched files + 3. Finally summarize the expenses # Background Context - Current Date: {day_of_week}, {current_date} @@ -700,21 +705,12 @@ Assuming you can search the user's notes and the internet. - User Name: {username} # Available Tool AIs -You decide which of the tool AIs listed below would you use to answer the user's question. You **only** have access to the following tool AIs: +You decide which of the tool AIs listed below would you use to accomplish the user assigned task. You **only** have access to the following tool AIs: {tools} """.strip() ) -plan_function_execution_next_tool = PromptTemplate.from_template( - """ -Given the results of your previous iterations, which tool AI will you use next to answer the target query? - -# Target Query: -{query} -""".strip() -) - pick_relevant_tools = PromptTemplate.from_template( """ You are Khoj, an extremely smart and helpful search assistant.