You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: lib/deep-research.ts
+7-5
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ export function generateSearchQueries({
112
112
lp+=` Use ${searchLanguage} for the SERP queries.`
113
113
}
114
114
constprompt=[
115
-
`Given the following prompt from the user, generate a list of SERP queries to research the topic. Return a maximum of ${numQueries} queries, but feel free to return less if the original prompt is clear. Make sure each query is unique and not similar to each other: <prompt>${query}</prompt>\n\n`,
115
+
`Given the following prompt from the user, generate a list of highly effective Google search queries to research the topic. Return a maximum of ${numQueries} queries, but feel free to return less if the original prompt is clear. Make sure each query is creative, unique and not similar to each other: <prompt>${query}</prompt>`,
116
116
learnings
117
117
? `Here are some learnings from previous research, use them to generate more specific queries: ${learnings.join(
118
118
'\n',
@@ -182,7 +182,7 @@ function processSearchResult({
`Given the following contents from a SERP search for the query <query>${query}</query>, extract key learnings from the contents. For each learning, include the source URL. Return a maximum of ${numLearnings} learnings, but feel free to return less if the contents are clear. Make sure each learning is unique and not similar to each other. The learnings should be as detailed and information dense as possible. Include any entities like people, places, companies, products, things, etc in the learnings, as well as any exact metrics, numbers, or dates. Also generate up to ${numFollowUpQuestions} follow-up questions that could help explore this topic further.`,
185
+
`Given the following contents from a SERP search for the query <query>${query}</query>, extract ${numLearnings}key learnings from the contents. Make sure each learning is unique and not similar to each other. The learnings should be as detailed and information dense as possible. Include any entities like people, places, companies, products, things, etc in the learnings, as well as any exact metrics, numbers, or dates. Also generate up to ${numFollowUpQuestions} follow-up questions that could help explore this topic further.`,
186
186
`<contents>${contents
187
187
.map(
188
188
(content,index)=>
@@ -211,8 +211,10 @@ export function writeFinalReport({
@@ -221,7 +223,7 @@ export function writeFinalReport({
221
223
`<prompt>${prompt}</prompt>`,
222
224
`Here are all the learnings from previous research:`,
223
225
`<learnings>\n${learningsString}\n</learnings>`,
224
-
`Write the report using Markdown. When citing information, use numbered citations with superscript numbers in square brackets (e.g., [1], [2], [3]). Each citation should correspond to the index of the source in your learnings list. DO NOT include the actual URLs in the report text - only use the citation numbers.`,
226
+
`Write the report using Markdown. Be factual, NEVER lie or make things up. Cite learnings from previous research when needed, using numbered citations like "[1]". Each citation should correspond to the index of the source in your learnings list. DO NOT include the actual URLs in the report text - only use the citation numbers.`,
`Given the following query from the user, ask ${numQuestions} follow up questions to clarify the research direction. Return a maximum of ${numQuestions} questions, but feel free to return less if the original query is clear: <query>${query}</query>`,
32
+
`Given the following query from the user, ask several follow up questions to clarify the research direction. Return a maximum of ${numQuestions} questions. Feel free to return less if the original query is clear, but always provide at least 1 question.`,
33
+
`<query>${query}</query>`,
33
34
`You MUST respond in JSON matching this JSON schema: ${jsonSchema}`,
0 commit comments