wu981526092 commited on
Commit
9048e9b
·
1 Parent(s): 91c2a08
agentgraph/methods/production/openai_structured_extractor.py CHANGED
@@ -105,6 +105,12 @@ NAMING STYLE & CANONICALIZATION:
105
  - Domain templates (use when content clearly matches):
106
  * Location-based discovery: Tasks → Geographic Proximity Analysis → Restaurant Data Collection → Operating Hours Validation; Output → Restaurant Recommendations; System → Location-Based Restaurant Discovery System
107
  * Wildlife data analysis: Tasks → Government Dataset Processing → Population Statistics Calculation → Ecological Data Validation; Human → Wildlife Researcher; System → Wildlife Data Analysis and Ecological Monitoring System
 
 
 
 
 
 
108
 
109
  == FEW-SHOT EXAMPLE (COMPLEX DISCOVERY WORKFLOW) ==
110
 
@@ -177,6 +183,7 @@ ANALYSIS STEPS:
177
  * Contains "cost", "savings", "ticket", "verification" → VERIFICATION (3 specialized tasks)
178
  * Contains "location", "restaurant", "proximity", "search" → DISCOVERY (3 sequential tasks)
179
  * Contains "probability", "game theory", "chemistry" → INTERDISCIPLINARY (3 domain tasks)
 
180
  * Simple single-agent scenarios → SIMPLE (1 agent, 1 task)
181
 
182
  - GENERATE tasks accordingly (Independent Task Allocation):
@@ -214,6 +221,7 @@ ANALYSIS STEPS:
214
  * Output→Human (DELIVERS_TO): 1 relation only
215
  * Agent→Tool (USES): Include exactly one when a Tool exists
216
  * Tool→Task (REQUIRED_BY): Include one only when the task explicitly depends on a Tool (execution/platform dependency). Otherwise omit.
 
217
 
218
  - FORBIDDEN: ASSIGNED_TO, INTERVENES
219
  - TARGET: Maximum 9–10 total relations for 3-agent workflows
@@ -229,6 +237,9 @@ NAMING & CANONICALIZATION:
229
  - Title Case + spaces only (no underscores in names)
230
  - Prefer canonical domain templates (see system rules) when content/tags match
231
  - Prefer concise outputs like "Restaurant Recommendations" for discovery workflows
 
 
 
232
 
233
  FORMATTING:
234
  - IDs: agent_001, task_001, tool_001, etc.
 
105
  - Domain templates (use when content clearly matches):
106
  * Location-based discovery: Tasks → Geographic Proximity Analysis → Restaurant Data Collection → Operating Hours Validation; Output → Restaurant Recommendations; System → Location-Based Restaurant Discovery System
107
  * Wildlife data analysis: Tasks → Government Dataset Processing → Population Statistics Calculation → Ecological Data Validation; Human → Wildlife Researcher; System → Wildlife Data Analysis and Ecological Monitoring System
108
+ * Enterprise QA / Document QA (tags/keywords: aif, inference, classification, decomposition, rephrasing, retrieval, answer synthesis, business response):
109
+ - Tasks (3–5 max, choose those evidenced in the trace):
110
+ Query Classification → Subquestion Decomposition and Rephrasing → Context Retrieval and Assembly → Domain Question Answering → (optional) Review/Validation
111
+ - Agents (examples): Query Classifier, Question Rephrasing Specialist, Oxford Economics Assistant
112
+ - Input/Output: User Query → Answer Response (or domain-specific final artifact)
113
+ - Tool: Computer Terminal (model/API execution)
114
 
115
  == FEW-SHOT EXAMPLE (COMPLEX DISCOVERY WORKFLOW) ==
116
 
 
183
  * Contains "cost", "savings", "ticket", "verification" → VERIFICATION (3 specialized tasks)
184
  * Contains "location", "restaurant", "proximity", "search" → DISCOVERY (3 sequential tasks)
185
  * Contains "probability", "game theory", "chemistry" → INTERDISCIPLINARY (3 domain tasks)
186
+ * Contains "classification", "decompose", "retrieval", "answer", "business response", "Oxford Economics" → ENTERPRISE_QA/DOC_QA (3–5 tasks from the template)
187
  * Simple single-agent scenarios → SIMPLE (1 agent, 1 task)
188
 
189
  - GENERATE tasks accordingly (Independent Task Allocation):
 
221
  * Output→Human (DELIVERS_TO): 1 relation only
222
  * Agent→Tool (USES): Include exactly one when a Tool exists
223
  * Tool→Task (REQUIRED_BY): Include one only when the task explicitly depends on a Tool (execution/platform dependency). Otherwise omit.
224
+ * Task→Task (SUBTASK_OF): Use sparingly when the trace explicitly states that one task is a component inside another (e.g., Decomposition inside Question Answering). Do not replace NEXT; both may coexist when justified.
225
 
226
  - FORBIDDEN: ASSIGNED_TO, INTERVENES
227
  - TARGET: Maximum 9–10 total relations for 3-agent workflows
 
237
  - Title Case + spaces only (no underscores in names)
238
  - Prefer canonical domain templates (see system rules) when content/tags match
239
  - Prefer concise outputs like "Restaurant Recommendations" for discovery workflows
240
+ - For Enterprise QA/Document QA, prefer the following canonical names when supported by evidence:
241
+ * Query Classification, Subquestion Decomposition and Rephrasing, Context Retrieval and Assembly, Domain Question Answering
242
+ * Input: User Query; Output: Answer Response
243
 
244
  FORMATTING:
245
  - IDs: agent_001, task_001, tool_001, etc.