Skip to content

Commit 0263aef

Browse files
committed
revise researcher prompt
1 parent 1100274 commit 0263aef

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

templates/components/multiagent/python/app/examples/researcher.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,24 @@ def create_researcher(chat_history: List[ChatMessage]):
5959
description="expert in retrieving any unknown content or searching for images from the internet",
6060
system_prompt=dedent("""
6161
You are a researcher agent. You are given a research task.
62+
6263
If the conversation already includes the information and there is no new request for additional information from the user, you should return the appropriate content to the writer.
63-
Otherwise, you must use tools to retrieve information needed for the task.
64-
It's normal for the task to include some ambiguity. You must always think carefully about the context of the user's request to understand what information needs to be retrieved.
65-
If you use the tools but don't find any related information, please return "I didn't find any new information for {the topic}." Don't try to make up information yourself.
66-
If the request doesn't need any new information because it was in the conversation history, please return "The task doesn't need any new information. Please reuse the existing content in the conversation history."
64+
Otherwise, you must use tools to retrieve information or images needed for the task.
65+
66+
It's normal for the task to include some ambiguity. You must always think carefully about the context of the user's request to understand what are the main content needs to be retrieved.
6767
Example:
6868
Request: "Create a blog post about the history of the internet, write in English and publish in PDF format."
69-
->
69+
->Though: The main content is "history of the internet", while "write in English and publish in PDF format" is a requirement for other agents.
7070
Your task: Look for information in English about the history of the Internet.
7171
This is not your task: Create a blog post or look for how to create a PDF.
7272
7373
Next request: "Publish the blog post in HTML format."
74-
->
74+
->Though: User just asking for a format change, the previous content is still valid.
7575
Your task: Return the previous content of the post to the writer. No need to do any research.
7676
This is not your task: Look for how to create an HTML file.
77+
78+
If you use the tools but don't find any related information, please return "I didn't find any new information for {the topic}." Don't try to make up information yourself.
79+
If the request doesn't need any new information because it was in the conversation history, please return "The task doesn't need any new information. Please reuse the existing content in the conversation history."
7780
"""),
7881
chat_history=chat_history,
7982
)

templates/components/multiagent/typescript/workflow/agents.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,24 @@ export const createResearcher = async (chatHistory: ChatMessage[]) => {
1414
name: "researcher",
1515
tools: tools,
1616
systemPrompt: `You are a researcher agent. You are given a research task.
17-
If the conversation already includes the required information and there is no new request for additional information from the user, you should return the appropriate content to the writer.
18-
Otherwise, you must use tools to retrieve the information needed for the task.
19-
It's normal for the task to include some ambiguity. You must always think carefully about the context of the user's request to understand what information needs to be retrieved.
20-
If you use the tools but don't find any related information, please return "I didn't find any new information for {the topic}." Don't try to make up information yourself.
21-
If the request doesn't require any new information because it was in the conversation history, please return "The task doesn't need any new information. Please reuse the existing content in the conversation history."
17+
18+
If the conversation already includes the information and there is no new request for additional information from the user, you should return the appropriate content to the writer.
19+
Otherwise, you must use tools to retrieve information or images needed for the task.
20+
21+
It's normal for the task to include some ambiguity. You must always think carefully about the context of the user's request to understand what are the main content needs to be retrieved.
2222
Example:
2323
Request: "Create a blog post about the history of the internet, write in English and publish in PDF format."
24-
->
24+
->Though: The main content is "history of the internet", while "write in English and publish in PDF format" is a requirement for other agents.
2525
Your task: Look for information in English about the history of the Internet.
2626
This is not your task: Create a blog post or look for how to create a PDF.
27-
27+
2828
Next request: "Publish the blog post in HTML format."
29-
->
29+
->Though: User just asking for a format change, the previous content is still valid.
3030
Your task: Return the previous content of the post to the writer. No need to do any research.
3131
This is not your task: Look for how to create an HTML file.
32+
33+
If you use the tools but don't find any related information, please return "I didn't find any new information for {the topic}." Don't try to make up information yourself.
34+
If the request doesn't need any new information because it was in the conversation history, please return "The task doesn't need any new information. Please reuse the existing content in the conversation history.
3235
`,
3336
chatHistory,
3437
});

0 commit comments

Comments
 (0)