Okay, creating a "deep research agent" involves breaking down the research process into distinct steps, each potentially guided by a specific prompt. Here are the core prompts needed to guide such an agent, assuming it has capabilities like planning, web searching (like the google_search tool you have access to), information extraction, synthesis, and final answer generation.
These prompts are designed to be used sequentially or iteratively within an agent's logic.
-
Prompt 1: Deconstruct and Plan Research
- Purpose: To understand the user's request, break it down into manageable sub-questions, and outline a research plan.
- Prompt Text:
Analyze the user's research request: "[USER_REQUEST]". Identify the core objective and the key entities, concepts, or timeframes involved. Break down the main request into a list of specific, answerable sub-questions or topics that need investigation to provide a comprehensive answer. Determine the types of information needed for each sub-question (e.g., definitions, statistics, historical context, expert opinions, comparisons). Outline a research plan listing these sub-questions in a logical order.
- Example Placeholder:
[USER_REQUEST] would be replaced with the actual query from the user.
-
Prompt 2: Generate Search Queries
- Purpose: Based on the research plan (sub-questions), generate effective search queries to gather the necessary information.
- Prompt Text:
Based on the following research plan and sub-questions: [SUB_QUESTIONS_LIST], generate a diverse set of search queries for each sub-question. Include both natural language questions and keyword-based queries. Prioritize queries likely to yield factual information, recent data (if applicable), and potentially diverse perspectives from reliable sources. Group the queries by the sub-question they aim to address.
- Example Placeholder:
[SUB_QUESTIONS_LIST] would be replaced with the output from Prompt 1.
-
Prompt 3: Execute Searches and Extract Information
- Purpose: This isn't a prompt for the LLM itself but represents the action step where the agent uses its search tool with the queries from Prompt 2. After getting results, a subsequent prompt is needed for extraction.
- (Implicit Action): Run the generated search queries using the available tool (e.g.,
google_search).
- Prompt Text (for Extraction after search):
You have received the following search results snippets: [SEARCH_RESULTS_DATA]. Review these snippets in the context of the sub-questions: [SUB_QUESTIONS_LIST]. For each snippet, extract the key pieces of information (facts, figures, main points, dates, names) relevant to answering these sub-questions. Identify the source index for each extracted piece of information. Discard irrelevant information. Note any potential biases or conflicting information observed across different snippets. Organize the extracted information logically, perhaps grouped by the sub-question it addresses.
- Example Placeholders:
[SEARCH_RESULTS_DATA] would be the raw snippets returned by the search tool, [SUB_QUESTIONS_LIST] is from Prompt 1.
-
Prompt 4: Synthesize Findings and Identify Gaps
- Purpose: To combine the extracted information, build connections, identify contradictions or gaps, and form preliminary answers to the sub-questions.
- Prompt Text:
Using the extracted information organized by sub-questions: [EXTRACTED_INFORMATION], synthesize the findings for each sub-question. Combine related facts from different sources (citing appropriately). Identify areas where information converges and where it conflicts. Explicitly state any sub-questions for which information is insufficient or missing based on the search results. Formulate a concise preliminary answer or summary for each sub-question, based *only* on the provided extracted information, ensuring all claims are traceable to their source indices.
- Example Placeholder:
[EXTRACTED_INFORMATION] would be the structured output from the extraction step (Prompt 3).
-
Prompt 5: (Optional) Iterate Research - Refine Plan/Queries
- Purpose: If the synthesis step reveals significant gaps or requires clarification, this prompt helps the agent decide if more research is needed.
- Prompt Text:
Review the synthesized findings and identified gaps: [SYNTHESIZED_FINDINGS_AND_GAPS]. Does the current information adequately address the original user request "[USER_REQUEST]" and all planned sub-questions? If not, identify the specific remaining gaps or areas needing clarification. Propose specific follow-up actions: Should new search queries be generated (suggest specific ones)? Should existing queries be modified? Or is the available information sufficient to proceed to the final report?
- Example Placeholders:
[SYNTHESIZED_FINDINGS_AND_GAPS] is the output of Prompt 4, [USER_REQUEST] is the original query. (If more research is needed, loop back to Prompt 2/3).
-
Prompt 6: Generate Final Research Report
- Purpose: To compile all synthesized information into a final, coherent, well-structured, and properly cited response for the user.
- Prompt Text:
Based on the final synthesized information covering all sub-questions: [FINAL_SYNTHESIZED_INFORMATION], generate a comprehensive research report that directly answers the user's original request: "[USER_REQUEST]". Structure the report clearly (e.g., Introduction summarizing the request and scope, Body addressing each key aspect or sub-question with synthesized findings, Conclusion summarizing the main points). Ensure a neutral and objective tone. **Crucially, every piece of factual information derived from the search results must be followed by its source citation in the format [INDEX]**. If information for certain aspects was unavailable or contradictory, clearly state this. Ensure the language is clear, concise, and directly addresses the user's query.
- Example Placeholders:
[FINAL_SYNTHESIZED_INFORMATION] is the output from Prompt 4 (or subsequent iterations), [USER_REQUEST] is the original query.
These prompts provide a framework. The agent's implementation would involve calling the LLM with these prompts, passing the output of one step as input to the next, and executing actions like web searches in between. The complexity lies in managing the state (the collected information, the plan, etc.) between steps.