Skip to content

Commit 888c0cc

Browse files
author
maksimov maksim
committed
correct system prompt and desc tools
1 parent e10968e commit 888c0cc

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

sgr_deep_research/core/tools/base.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,19 @@ class FinalAnswerTool(BaseTool):
124124
completed.
125125
126126
Usage: Call after you complite research task
127+
128+
CRITICAL FOR FACTUAL ACCURACY:
129+
- For questions with dates/numbers/versions: provide EXACT values only
130+
- Double-check day/month/year precision before finalizing
131+
- If sources conflict on factual details, search again or indicate uncertainty
132+
- Never approximate or round dates/numbers (October 21 ≠ October 22, 6.88b ≠ 6.88c)
127133
"""
128134

129-
reasoning: str = Field(description="Why task is now complete")
130-
completed_steps: list[str] = Field(description="Summary of completed steps", min_length=1, max_length=5)
131-
answer: str = Field(description="Comprehensive final answer to the research task")
135+
reasoning: str = Field(description="Why task is now complete and how answer was verified")
136+
completed_steps: list[str] = Field(
137+
description="Summary of completed steps including verification", min_length=1, max_length=5
138+
)
139+
answer: str = Field(description="Comprehensive final answer with EXACT factual details (dates, numbers, names)")
132140
status: Literal[AgentStatesEnum.COMPLETED, AgentStatesEnum.FAILED] = Field(description="Task completion status")
133141

134142
async def __call__(self, context: ResearchContext) -> str:

sgr_deep_research/core/tools/research.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,13 @@ class WebSearchTool(BaseTool):
103103
- For acronyms, add context: "SGR Schema-Guided Reasoning"
104104
- Use quotes for exact phrases: "Structured Output OpenAI"
105105
- Search queries in SAME LANGUAGE as user request
106-
-
106+
- For date/number questions, include specific year/context in query
107107
- Use ExtractPageContentTool to get full content from found URLs
108+
109+
IMPORTANT FOR FACTUAL QUESTIONS:
110+
- Search snippets often contain direct answers - check them carefully
111+
- For questions with specific dates/numbers, snippets may be more accurate than full pages
112+
- If snippet directly answers the question, you may not need to extract full page
108113
"""
109114

110115
reasoning: str = Field(description="Why this search is needed and what to expect")
@@ -163,6 +168,13 @@ class ExtractPageContentTool(BaseTool):
163168
Best for: Deep analysis of specific pages, extracting structured data
164169
165170
Usage: Call after WebSearchTool to get detailed information from promising URLs
171+
172+
CRITICAL WARNINGS:
173+
- Extracted pages may show data from DIFFERENT years/time periods than asked
174+
- ALWAYS verify that extracted content matches the question's temporal context
175+
- Example: Question asks about 2022, but page shows 2024 data - REJECT this source
176+
- If extracted content contradicts search snippet, prefer snippet for factual questions
177+
- For date/number questions, cross-check extracted values with search snippets
166178
"""
167179

168180
reasoning: str = Field(description="Why extract these specific pages")

sgr_deep_research/prompts/system_prompt.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ ADAPTIVITY: Actively change plan when discovering new data.
2525
ANALYSIS EXTRACT DATA: Always analysis data they you took in extractpagecontenttool через поле
2626
</REASONING_GUIDELINES>
2727

28+
<PRECISION_GUIDELINES>
29+
CRITICAL FOR FACTUAL ACCURACY:
30+
When answering questions about specific dates, numbers, versions, or names:
31+
1. EXACT VALUES: Extract the EXACT value from sources (day, month, year for dates; precise numbers for quantities)
32+
2. VERIFY YEAR: If question mentions a specific year (e.g., "in 2022"), verify extracted content is about that SAME year
33+
3. CROSS-VERIFICATION: When sources provide contradictory information, prefer:
34+
- Official sources and primary documentation over secondary sources
35+
- Search result snippets that DIRECTLY answer the question over extracted page content
36+
- Multiple independent sources confirming the same fact
37+
4. DATE PRECISION: Pay special attention to exact dates - day matters (October 21 ≠ October 22)
38+
5. NUMBER PRECISION: For numbers/versions, exact match required (6.88b ≠ 6.88c, Episode 31 ≠ Episode 32)
39+
6. SNIPPET PRIORITY: If search snippet clearly states the answer, trust it unless extract proves it wrong
40+
7. TEMPORAL VALIDATION: When extracting page content, check if the page shows data for correct time period
41+
</PRECISION_GUIDELINES>
42+
2843
<AGENT_TOOL_USAGE_GUIDELINES>:
2944
{available_tools}
3045
</AGENT_TOOL_USAGE_GUIDELINES>

0 commit comments

Comments
 (0)