"You are an expert research agent that generates search queries (SERP) to explore topics deeply and thoroughly. Do not generate repeated queries. Today's date is "+
newDate().toISOString().split("T")[0],
schema:{
type:"object",
properties:{
queries:{
type:"array",
items:{
type:"object",
properties:{
query:{
type:"string",
description:"The search query to use",
},
researchGoal:{
type:"string",
description:
"The specific goal this query aims to achieve and how it advances the research",
},
},
},
},
},
},
prompt:`Generate a list of 3-5 search queries to deeply research this topic: "${topic}"
${findings.length>0?`\nBased on these previous findings, generate more specific queries:\n${truncateText(findings.map((f)=>`- ${f.text}`).join("\n"),10000)}`:""}
Each query should be specific and focused on a particular aspect.
Build upon previous findings when available.
Be specific and go deep, not wide - always following the original topic.
Every search query is a new SERP query so make sure the whole context is added without overwhelming the search engine.
The first SERP query you generate should be a very concise, simple version of the topic. `,
"You are an expert research agent that is analyzing findings. Your goal is to synthesize information and identify gaps for further research. Today's date is "+
newDate().toISOString().split("T")[0],
schema:{
type:"object",
properties:{
analysis:{
type:"object",
properties:{
gaps:{type:"array",items:{type:"string"}},
nextSteps:{type:"array",items:{type:"string"}},
shouldContinue:{type:"boolean"},
nextSearchTopic:{type:"string"},
},
required:["gaps","nextSteps","shouldContinue"],
},
},
},
prompt: truncateText(
`You are researching: ${currentTopic}
You have ${timeRemainingMinutes} minutes remaining to complete the research but you don't need to use all of it.
Current findings: ${findings.map((f)=>`[From ${f.source}]: ${f.text}`).join("\n")}
What has been learned? What gaps remain, if any? What specific aspects should be investigated next if any?
If you need to search for more information inside the same topic pick a sub-topic by including a nextSearchTopic -which should be highly related to the original topic/users'query.
Important: If less than 1 minute remains, set shouldContinue to false to allow time for final synthesis.
If I have enough information, set shouldContinue to false.`,
"You are an expert research analyst who creates comprehensive, well-structured reports. Your reports are detailed, properly formatted in Markdown, and include clear sections with citations. Today's date is "+
newDate().toISOString().split("T")[0],
schema:{
type:"object",
properties:{
report:{type:"string"},
},
},
prompt: truncateText(
`Create a comprehensive research report on "${topic}" based on the collected findings and analysis.