wu981526092 commited on
Commit
911b955
·
1 Parent(s): 9048e9b
agentgraph/methods/production/openai_structured_extractor.py CHANGED
@@ -88,6 +88,11 @@ WORKFLOW PATTERNS:
88
  - Simple (1-2 agents): Single consolidated task, basic relations
89
  - Complex (3+ agents): 3 high-level specialized tasks with NEXT relations (avoid over-decomposition)
90
 
 
 
 
 
 
91
  JSON PARSING FOCUS:
92
  Locate "observations", "agents", "data" sections. Count DISTINCT agents (not mentions).
93
  Look for *_Expert patterns and execution evidence.
@@ -221,7 +226,7 @@ ANALYSIS STEPS:
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
 
88
  - Simple (1-2 agents): Single consolidated task, basic relations
89
  - Complex (3+ agents): 3 high-level specialized tasks with NEXT relations (avoid over-decomposition)
90
 
91
+ ORDER VS HIERARCHY (MANDATORY):
92
+ - Use NEXT (Task→Task) for sequential pipelines where one task hands off to the next. If there are N tasks in a linear flow, expect exactly N-1 NEXT edges to cover the chain.
93
+ - Use SUBTASK_OF (Task→Task) only for hierarchical decomposition where a parent task contains child tasks executed within its scope. Do NOT use SUBTASK_OF for simple multi-stage pipelines without nesting.
94
+ - When both structures exist: use SUBTASK_OF for containment and NEXT among siblings to express order within the parent.
95
+
96
  JSON PARSING FOCUS:
97
  Locate "observations", "agents", "data" sections. Count DISTINCT agents (not mentions).
98
  Look for *_Expert patterns and execution evidence.
 
226
  * Output→Human (DELIVERS_TO): 1 relation only
227
  * Agent→Tool (USES): Include exactly one when a Tool exists
228
  * Tool→Task (REQUIRED_BY): Include one only when the task explicitly depends on a Tool (execution/platform dependency). Otherwise omit.
229
+ * Task→Task (SUBTASK_OF): ONLY when the trace explicitly states hierarchical containment (e.g., Decomposition is a component of Question Answering). Never substitute it for linear stage order.
230
 
231
  - FORBIDDEN: ASSIGNED_TO, INTERVENES
232
  - TARGET: Maximum 9–10 total relations for 3-agent workflows