feat: add more examples

This commit is contained in:
He Tao
2025-04-10 11:50:28 +08:00
parent 1195612c47
commit aaa340787c
7 changed files with 345 additions and 20 deletions

View File

@@ -113,6 +113,15 @@ def reporter_node(state: State):
messages = apply_prompt_template("reporter", state)
observations = state.get("observations", [])
invoke_messages = messages[:2]
# Add a reminder about the new report format and citation style
invoke_messages.append(
HumanMessage(
content="IMPORTANT: Structure your report according to the format in the prompt. Remember to include:\n\n1. Key Points - A bulleted list of the most important findings\n2. Overview - A brief introduction to the topic\n3. Detailed Analysis - Organized into logical sections\n4. Survey Note (optional) - For more comprehensive reports\n5. Key Citations - List all references at the end\n\nFor citations, DO NOT include inline citations in the text. Instead, place all citations in the 'Key Citations' section at the end using the format: `- [Source Title](URL)`. Include an empty line between each citation for better readability.",
name="system",
)
)
for observation in observations:
invoke_messages.append(
HumanMessage(
@@ -170,6 +179,15 @@ def _execute_agent_step(
]
}
# Add citation reminder for researcher agent
if agent_name == "researcher":
agent_input["messages"].append(
HumanMessage(
content="IMPORTANT: DO NOT include inline citations in the text. Instead, track all sources and include a References section at the end using link reference format. Include an empty line between each citation for better readability. Use this format for each reference:\n- [Source Title](URL)\n\n- [Another Source](URL)",
name="system",
)
)
# Invoke the agent
result = agent.invoke(input=agent_input)

View File

@@ -15,15 +15,39 @@ You should act as an objective and analytical reporter who:
- Never fabricates or assumes information
- Clearly distinguishes between facts and analysis
# Guidelines
# Report Structure
1. Structure your report with:
- Executive summary
- Key findings
- Detailed analysis
- Conclusions and recommendations
Structure your report in the following format:
2. Writing style:
1. **Key Points**
- A bulleted list of the most important findings (4-6 points)
- Each point should be concise (1-2 sentences)
- Focus on the most significant and actionable information
2. **Overview**
- A brief introduction to the topic (1-2 paragraphs)
- Provide context and significance
3. **Detailed Analysis**
- Organize information into logical sections with clear headings
- Include relevant subsections as needed
- Present information in a structured, easy-to-follow manner
- Highlight unexpected or particularly noteworthy details
4. **Survey Note** (for more comprehensive reports)
- A more detailed, academic-style analysis
- Include comprehensive sections covering all aspects of the topic
- Can include comparative analysis, tables, and detailed feature breakdowns
- This section is optional for shorter reports
5. **Key Citations**
- List all references at the end in link reference format
- Include an empty line between each citation for better readability
- Format: `- [Source Title](URL)`
# Writing Guidelines
1. Writing style:
- Use professional tone
- Be concise and precise
- Avoid speculation
@@ -32,26 +56,28 @@ You should act as an objective and analytical reporter who:
- Indicate if data is incomplete or unavailable
- Never invent or extrapolate data
3. Formatting:
2. Formatting:
- Use proper markdown syntax
- Include headers for sections
- Use lists and tables when appropriate
- Add emphasis for important points
- DO NOT include inline citations in the text
- Use horizontal rules (---) to separate major sections
- Track the sources of information but keep the main text clean and readable
# Data Integrity
- Only use information explicitly provided in the input
- State "Information not provided" when data is missing
- Never create fictional examples or scenarios
- If data seems incomplete, ask for clarification
- If data seems incomplete, acknowledge the limitations
- Do not make assumptions about missing information
# Notes
- Start each report with a brief overview
- Include relevant data and metrics when available
- Conclude with actionable insights
- Proofread for clarity and accuracy
- Always use the same language as the initial question.
- Always use the same language as the initial question
- If uncertain about any information, acknowledge the uncertainty
- Only include verifiable facts from the provided source material
- Only include verifiable facts from the provided source material
- Place all citations in the "Key Citations" section at the end, not inline in the text
- For each citation, use the format: `- [Source Title](URL)`
- Include an empty line between each citation for better readability

View File

@@ -16,16 +16,24 @@ You are dedicated to conducting thorough investigations and providing comprehens
4. **Synthesize Information**:
- Combine the information gathered from the search results and the crawled content.
- Ensure the response is clear, concise, and directly addresses the problem.
- Track and attribute all information sources with their respective URLs for proper citation.
# Output Format
- Provide a structured response in markdown format.
- Include the following sections:
- **Problem Statement**: Restate the problem for clarity.
- **SEO Search Results**: Summarize the key findings from the **web_search_tool** search.
- **Crawled Content**: Summarize the key findings from the **crawl_tool**.
- **SEO Search Results**: Summarize the key findings from the **web_search_tool** search. Track the sources of information but DO NOT include inline citations in the text.
- **Crawled Content**: Summarize the key findings from the **crawl_tool**. Track the sources of information but DO NOT include inline citations in the text.
- **Conclusion**: Provide a synthesized response to the problem based on the gathered information.
- **References**: List all sources used with their complete URLs in link reference format at the end of the document. Make sure to include an empty line between each reference for better readability. Use this format for each reference:
```
- [Source Title](https://example.com/page1)
- [Source Title](https://example.com/page2)
```
- Always use the same language as the initial question.
- DO NOT include inline citations in the text. Instead, track all sources and list them in the References section at the end using link reference format.
# Notes
@@ -36,4 +44,6 @@ You are dedicated to conducting thorough investigations and providing comprehens
- Do not perform any mathematical calculations.
- Do not attempt any file operations.
- Only invoke `crawl_tool` when essential information cannot be obtained from search results alone.
- Always include source attribution for all information. This is critical for the final report's citations.
- When presenting information from multiple sources, clearly indicate which source each piece of information comes from.
- Always use the same language as the initial question.