wu981526092 commited on
Commit
6464c11
Β·
1 Parent(s): 66a2a90

πŸ”§ Fix Failure and Optimization Type Field Names

Browse files

CRITICAL FIX: Corrected field names causing failures and optimizations to display as 'OTHER' type in AgentGraph UI

🚨 ROOT CAUSE: Wrong field names in knowledge graphs
- Failures used 'type' instead of 'risk_type'
- Optimizations used 'type' instead of 'recommendation_type'

πŸ”§ FIXES APPLIED:

1. βœ… Failure Field Names:
BEFORE: "type": "EXECUTION_ERROR" (wrong)
AFTER: "risk_type": "EXECUTION_ERROR" (correct)

2. βœ… Optimization Field Names:
BEFORE: "type": "TOOL_ENHANCEMENT" (wrong)
AFTER: "recommendation_type": "TOOL_ENHANCEMENT" (correct)

3. 🧹 Cleanup Extra Fields:
- Removed 'severity' from failures (not in model)
- Removed 'priority' from optimizations (not in model)

πŸ“Š AFFECTED FILES & COUNTS:
- kg_algorithm_sample_1.json: 2 failures + 3 optimizations βœ…
- kg_algorithm_sample_3.json: 2 failures + 3 optimizations βœ…
- kg_algorithm_sample_14.json: 2 failures + 3 optimizations βœ…
- kg_algorithm_sample_16.json: 2 failures + 3 optimizations βœ…

βœ… VALIDATION RESULTS:
- 8 failures with correct risk_type field
- 12 optimizations with correct recommendation_type field
- All types match predefined valid types:
- EXECUTION_ERROR, RETRIEVAL_ERROR, PLANNING_ERROR
- TOOL_ENHANCEMENT, WORKFLOW_SIMPLIFICATION, PROMPT_REFINEMENT, AGENT_MERGING
- 0 type errors remaining

🎯 OUTCOME: Failures and optimizations will now display with proper type categories in AgentGraph UI instead of 'OTHER'

backend/database/samples/knowledge_graphs/kg_algorithm_sample_1.json CHANGED
@@ -301,8 +301,6 @@
301
  "failures": [
302
  {
303
  "id": "failure_001",
304
- "type": "EXECUTION_ERROR",
305
- "severity": "HIGH",
306
  "description": "Data Verification Expert failed to properly validate restaurant operating hours due to incorrect Python code implementation, leading to inaccurate 11pm availability data",
307
  "raw_text": "",
308
  "raw_text_ref": [
@@ -312,12 +310,11 @@
312
  "confidence": 0.9
313
  }
314
  ],
315
- "affected_id": "agent_003"
 
316
  },
317
  {
318
  "id": "failure_002",
319
- "type": "RETRIEVAL_ERROR",
320
- "severity": "MEDIUM",
321
  "description": "Location-Based Services Expert encountered API limitations when accessing real-time restaurant data, resulting in incomplete proximity analysis",
322
  "raw_text": "",
323
  "raw_text_ref": [
@@ -327,14 +324,13 @@
327
  "confidence": 0.85
328
  }
329
  ],
330
- "affected_id": "agent_001"
 
331
  }
332
  ],
333
  "optimizations": [
334
  {
335
  "id": "opt_001",
336
- "type": "TOOL_ENHANCEMENT",
337
- "priority": "HIGH",
338
  "description": "Enhance location-based services with caching mechanisms and fallback data sources to improve reliability and reduce API dependency",
339
  "raw_text": "Implement robust location service tools with redundancy",
340
  "raw_text_ref": [
@@ -346,12 +342,11 @@
346
  ],
347
  "affected_ids": [
348
  "agent_001"
349
- ]
 
350
  },
351
  {
352
  "id": "opt_002",
353
- "type": "WORKFLOW_SIMPLIFICATION",
354
- "priority": "MEDIUM",
355
  "description": "Combine restaurant data collection and operating hours validation into a single integrated task to reduce coordination overhead and improve data consistency",
356
  "raw_text": "Merge data collection and validation workflows",
357
  "raw_text_ref": [
@@ -366,12 +361,11 @@
366
  "agent_003",
367
  "task_002",
368
  "task_003"
369
- ]
 
370
  },
371
  {
372
  "id": "opt_003",
373
- "type": "PROMPT_REFINEMENT",
374
- "priority": "MEDIUM",
375
  "description": "Refine Data Verification Expert prompts to include specific error handling and validation procedures for time-sensitive restaurant data",
376
  "raw_text": "Improve validation prompts with error handling",
377
  "raw_text_ref": [
@@ -383,7 +377,8 @@
383
  ],
384
  "affected_ids": [
385
  "agent_003"
386
- ]
 
387
  }
388
  ]
389
  },
 
301
  "failures": [
302
  {
303
  "id": "failure_001",
 
 
304
  "description": "Data Verification Expert failed to properly validate restaurant operating hours due to incorrect Python code implementation, leading to inaccurate 11pm availability data",
305
  "raw_text": "",
306
  "raw_text_ref": [
 
310
  "confidence": 0.9
311
  }
312
  ],
313
+ "affected_id": "agent_003",
314
+ "risk_type": "EXECUTION_ERROR"
315
  },
316
  {
317
  "id": "failure_002",
 
 
318
  "description": "Location-Based Services Expert encountered API limitations when accessing real-time restaurant data, resulting in incomplete proximity analysis",
319
  "raw_text": "",
320
  "raw_text_ref": [
 
324
  "confidence": 0.85
325
  }
326
  ],
327
+ "affected_id": "agent_001",
328
+ "risk_type": "RETRIEVAL_ERROR"
329
  }
330
  ],
331
  "optimizations": [
332
  {
333
  "id": "opt_001",
 
 
334
  "description": "Enhance location-based services with caching mechanisms and fallback data sources to improve reliability and reduce API dependency",
335
  "raw_text": "Implement robust location service tools with redundancy",
336
  "raw_text_ref": [
 
342
  ],
343
  "affected_ids": [
344
  "agent_001"
345
+ ],
346
+ "recommendation_type": "TOOL_ENHANCEMENT"
347
  },
348
  {
349
  "id": "opt_002",
 
 
350
  "description": "Combine restaurant data collection and operating hours validation into a single integrated task to reduce coordination overhead and improve data consistency",
351
  "raw_text": "Merge data collection and validation workflows",
352
  "raw_text_ref": [
 
361
  "agent_003",
362
  "task_002",
363
  "task_003"
364
+ ],
365
+ "recommendation_type": "WORKFLOW_SIMPLIFICATION"
366
  },
367
  {
368
  "id": "opt_003",
 
 
369
  "description": "Refine Data Verification Expert prompts to include specific error handling and validation procedures for time-sensitive restaurant data",
370
  "raw_text": "Improve validation prompts with error handling",
371
  "raw_text_ref": [
 
377
  ],
378
  "affected_ids": [
379
  "agent_003"
380
+ ],
381
+ "recommendation_type": "PROMPT_REFINEMENT"
382
  }
383
  ]
384
  },
backend/database/samples/knowledge_graphs/kg_algorithm_sample_14.json CHANGED
@@ -301,8 +301,6 @@
301
  "failures": [
302
  {
303
  "id": "failure_001",
304
- "type": "RETRIEVAL_ERROR",
305
- "severity": "HIGH",
306
  "description": "Literary Analysis Expert incorrectly used arxiv_search tool instead of appropriate academic database tools, leading to failed literature retrieval and incomplete analysis",
307
  "raw_text": "",
308
  "raw_text_ref": [
@@ -312,12 +310,11 @@
312
  "confidence": 0.9
313
  }
314
  ],
315
- "affected_id": "agent_001"
 
316
  },
317
  {
318
  "id": "failure_002",
319
- "type": "PLANNING_ERROR",
320
- "severity": "MEDIUM",
321
  "description": "Inadequate coordination between literary and mythological analysis phases, resulting in fragmented research approach and missed interdisciplinary connections",
322
  "raw_text": "",
323
  "raw_text_ref": [
@@ -327,14 +324,13 @@
327
  "confidence": 0.85
328
  }
329
  ],
330
- "affected_id": "agent_002"
 
331
  }
332
  ],
333
  "optimizations": [
334
  {
335
  "id": "opt_001",
336
- "type": "TOOL_ENHANCEMENT",
337
- "priority": "HIGH",
338
  "description": "Implement specialized academic database search tools with proper journal and publication filtering to replace generic search mechanisms",
339
  "raw_text": "Enhanced academic database search capabilities",
340
  "raw_text_ref": [
@@ -347,12 +343,11 @@
347
  "affected_ids": [
348
  "agent_001",
349
  "agent_004"
350
- ]
 
351
  },
352
  {
353
  "id": "opt_002",
354
- "type": "WORKFLOW_SIMPLIFICATION",
355
- "priority": "MEDIUM",
356
  "description": "Create integrated literary-mythological analysis workflow to improve coordination between specialized experts and reduce research fragmentation",
357
  "raw_text": "Unified interdisciplinary analysis workflow",
358
  "raw_text_ref": [
@@ -365,12 +360,11 @@
365
  "affected_ids": [
366
  "task_001",
367
  "task_002"
368
- ]
 
369
  },
370
  {
371
  "id": "opt_003",
372
- "type": "PROMPT_REFINEMENT",
373
- "priority": "MEDIUM",
374
  "description": "Enhance Literary Analysis Expert prompts with specific guidance for academic database selection and interdisciplinary research methodologies",
375
  "raw_text": "Improved academic research prompts and methodologies",
376
  "raw_text_ref": [
@@ -382,7 +376,8 @@
382
  ],
383
  "affected_ids": [
384
  "agent_001"
385
- ]
 
386
  }
387
  ]
388
  },
 
301
  "failures": [
302
  {
303
  "id": "failure_001",
 
 
304
  "description": "Literary Analysis Expert incorrectly used arxiv_search tool instead of appropriate academic database tools, leading to failed literature retrieval and incomplete analysis",
305
  "raw_text": "",
306
  "raw_text_ref": [
 
310
  "confidence": 0.9
311
  }
312
  ],
313
+ "affected_id": "agent_001",
314
+ "risk_type": "RETRIEVAL_ERROR"
315
  },
316
  {
317
  "id": "failure_002",
 
 
318
  "description": "Inadequate coordination between literary and mythological analysis phases, resulting in fragmented research approach and missed interdisciplinary connections",
319
  "raw_text": "",
320
  "raw_text_ref": [
 
324
  "confidence": 0.85
325
  }
326
  ],
327
+ "affected_id": "agent_002",
328
+ "risk_type": "PLANNING_ERROR"
329
  }
330
  ],
331
  "optimizations": [
332
  {
333
  "id": "opt_001",
 
 
334
  "description": "Implement specialized academic database search tools with proper journal and publication filtering to replace generic search mechanisms",
335
  "raw_text": "Enhanced academic database search capabilities",
336
  "raw_text_ref": [
 
343
  "affected_ids": [
344
  "agent_001",
345
  "agent_004"
346
+ ],
347
+ "recommendation_type": "TOOL_ENHANCEMENT"
348
  },
349
  {
350
  "id": "opt_002",
 
 
351
  "description": "Create integrated literary-mythological analysis workflow to improve coordination between specialized experts and reduce research fragmentation",
352
  "raw_text": "Unified interdisciplinary analysis workflow",
353
  "raw_text_ref": [
 
360
  "affected_ids": [
361
  "task_001",
362
  "task_002"
363
+ ],
364
+ "recommendation_type": "WORKFLOW_SIMPLIFICATION"
365
  },
366
  {
367
  "id": "opt_003",
 
 
368
  "description": "Enhance Literary Analysis Expert prompts with specific guidance for academic database selection and interdisciplinary research methodologies",
369
  "raw_text": "Improved academic research prompts and methodologies",
370
  "raw_text_ref": [
 
376
  ],
377
  "affected_ids": [
378
  "agent_001"
379
+ ],
380
+ "recommendation_type": "PROMPT_REFINEMENT"
381
  }
382
  ]
383
  },
backend/database/samples/knowledge_graphs/kg_algorithm_sample_16.json CHANGED
@@ -301,8 +301,6 @@
301
  "failures": [
302
  {
303
  "id": "failure_001",
304
- "type": "RETRIEVAL_ERROR",
305
- "severity": "HIGH",
306
  "description": "Data Analysis Expert failed to locate the correct USGS dataset URL, preventing access to essential wildlife monitoring data and compromising the entire analysis pipeline",
307
  "raw_text": "",
308
  "raw_text_ref": [
@@ -312,12 +310,11 @@
312
  "confidence": 0.89
313
  }
314
  ],
315
- "affected_id": "agent_001"
 
316
  },
317
  {
318
  "id": "failure_002",
319
- "type": "EXECUTION_ERROR",
320
- "severity": "MEDIUM",
321
  "description": "Statistical Analysis Expert encountered data format incompatibilities when processing government datasets, leading to calculation errors and incomplete population statistics",
322
  "raw_text": "",
323
  "raw_text_ref": [
@@ -327,14 +324,13 @@
327
  "confidence": 0.84
328
  }
329
  ],
330
- "affected_id": "agent_002"
 
331
  }
332
  ],
333
  "optimizations": [
334
  {
335
  "id": "opt_001",
336
- "type": "TOOL_ENHANCEMENT",
337
- "priority": "HIGH",
338
  "description": "Implement specialized government data access tools with automated URL discovery and dataset validation to improve reliability of ecological data retrieval",
339
  "raw_text": "Enhanced government dataset access and validation tools",
340
  "raw_text_ref": [
@@ -347,12 +343,11 @@
347
  "affected_ids": [
348
  "agent_001",
349
  "agent_004"
350
- ]
 
351
  },
352
  {
353
  "id": "opt_002",
354
- "type": "WORKFLOW_SIMPLIFICATION",
355
- "priority": "MEDIUM",
356
  "description": "Create integrated ecological data pipeline combining data processing, statistical analysis, and validation into a streamlined workflow to reduce coordination overhead",
357
  "raw_text": "Unified ecological data analysis pipeline",
358
  "raw_text_ref": [
@@ -366,12 +361,11 @@
366
  "task_001",
367
  "task_002",
368
  "task_003"
369
- ]
 
370
  },
371
  {
372
  "id": "opt_003",
373
- "type": "AGENT_MERGING",
374
- "priority": "LOW",
375
  "description": "Consider merging Data Analysis and Statistical Analysis experts for ecological projects to reduce handoff delays and improve data consistency in population studies",
376
  "raw_text": "Merge data and statistical analysis roles for efficiency",
377
  "raw_text_ref": [
@@ -384,7 +378,8 @@
384
  "affected_ids": [
385
  "agent_001",
386
  "agent_002"
387
- ]
 
388
  }
389
  ]
390
  },
 
301
  "failures": [
302
  {
303
  "id": "failure_001",
 
 
304
  "description": "Data Analysis Expert failed to locate the correct USGS dataset URL, preventing access to essential wildlife monitoring data and compromising the entire analysis pipeline",
305
  "raw_text": "",
306
  "raw_text_ref": [
 
310
  "confidence": 0.89
311
  }
312
  ],
313
+ "affected_id": "agent_001",
314
+ "risk_type": "RETRIEVAL_ERROR"
315
  },
316
  {
317
  "id": "failure_002",
 
 
318
  "description": "Statistical Analysis Expert encountered data format incompatibilities when processing government datasets, leading to calculation errors and incomplete population statistics",
319
  "raw_text": "",
320
  "raw_text_ref": [
 
324
  "confidence": 0.84
325
  }
326
  ],
327
+ "affected_id": "agent_002",
328
+ "risk_type": "EXECUTION_ERROR"
329
  }
330
  ],
331
  "optimizations": [
332
  {
333
  "id": "opt_001",
 
 
334
  "description": "Implement specialized government data access tools with automated URL discovery and dataset validation to improve reliability of ecological data retrieval",
335
  "raw_text": "Enhanced government dataset access and validation tools",
336
  "raw_text_ref": [
 
343
  "affected_ids": [
344
  "agent_001",
345
  "agent_004"
346
+ ],
347
+ "recommendation_type": "TOOL_ENHANCEMENT"
348
  },
349
  {
350
  "id": "opt_002",
 
 
351
  "description": "Create integrated ecological data pipeline combining data processing, statistical analysis, and validation into a streamlined workflow to reduce coordination overhead",
352
  "raw_text": "Unified ecological data analysis pipeline",
353
  "raw_text_ref": [
 
361
  "task_001",
362
  "task_002",
363
  "task_003"
364
+ ],
365
+ "recommendation_type": "WORKFLOW_SIMPLIFICATION"
366
  },
367
  {
368
  "id": "opt_003",
 
 
369
  "description": "Consider merging Data Analysis and Statistical Analysis experts for ecological projects to reduce handoff delays and improve data consistency in population studies",
370
  "raw_text": "Merge data and statistical analysis roles for efficiency",
371
  "raw_text_ref": [
 
378
  "affected_ids": [
379
  "agent_001",
380
  "agent_002"
381
+ ],
382
+ "recommendation_type": "AGENT_MERGING"
383
  }
384
  ]
385
  },
backend/database/samples/knowledge_graphs/kg_algorithm_sample_3.json CHANGED
@@ -301,8 +301,6 @@
301
  "failures": [
302
  {
303
  "id": "failure_001",
304
- "type": "EXECUTION_ERROR",
305
- "severity": "HIGH",
306
  "description": "Probability Expert made critical errors in simulation implementation, leading to incorrect probability distributions and unreliable game theory predictions",
307
  "raw_text": "",
308
  "raw_text_ref": [
@@ -312,12 +310,11 @@
312
  "confidence": 0.91
313
  }
314
  ],
315
- "affected_id": "agent_001"
 
316
  },
317
  {
318
  "id": "failure_002",
319
- "type": "PLANNING_ERROR",
320
- "severity": "MEDIUM",
321
  "description": "Interdisciplinary coordination breakdown between probability and chemistry experts, resulting in misaligned analytical approaches and conflicting methodologies",
322
  "raw_text": "",
323
  "raw_text_ref": [
@@ -327,14 +324,13 @@
327
  "confidence": 0.86
328
  }
329
  ],
330
- "affected_id": "agent_002"
 
331
  }
332
  ],
333
  "optimizations": [
334
  {
335
  "id": "opt_001",
336
- "type": "TOOL_ENHANCEMENT",
337
- "priority": "HIGH",
338
  "description": "Develop specialized simulation tools with built-in error checking and validation to improve probability calculation accuracy and reduce execution errors",
339
  "raw_text": "Enhance probability simulation tools with validation",
340
  "raw_text_ref": [
@@ -347,12 +343,11 @@
347
  "affected_ids": [
348
  "agent_001",
349
  "agent_004"
350
- ]
 
351
  },
352
  {
353
  "id": "opt_002",
354
- "type": "AGENT_MERGING",
355
- "priority": "MEDIUM",
356
  "description": "Create unified interdisciplinary expert combining probability and chemistry knowledge to reduce coordination overhead and improve cross-domain integration",
357
  "raw_text": "Merge probability and chemistry expertise for better integration",
358
  "raw_text_ref": [
@@ -365,12 +360,11 @@
365
  "affected_ids": [
366
  "agent_001",
367
  "agent_002"
368
- ]
 
369
  },
370
  {
371
  "id": "opt_003",
372
- "type": "WORKFLOW_SIMPLIFICATION",
373
- "priority": "MEDIUM",
374
  "description": "Implement parallel processing for probability and chemistry analyses to reduce sequential dependencies and improve overall system efficiency",
375
  "raw_text": "Enable parallel interdisciplinary analysis",
376
  "raw_text_ref": [
@@ -383,7 +377,8 @@
383
  "affected_ids": [
384
  "task_001",
385
  "task_002"
386
- ]
 
387
  }
388
  ]
389
  },
 
301
  "failures": [
302
  {
303
  "id": "failure_001",
 
 
304
  "description": "Probability Expert made critical errors in simulation implementation, leading to incorrect probability distributions and unreliable game theory predictions",
305
  "raw_text": "",
306
  "raw_text_ref": [
 
310
  "confidence": 0.91
311
  }
312
  ],
313
+ "affected_id": "agent_001",
314
+ "risk_type": "EXECUTION_ERROR"
315
  },
316
  {
317
  "id": "failure_002",
 
 
318
  "description": "Interdisciplinary coordination breakdown between probability and chemistry experts, resulting in misaligned analytical approaches and conflicting methodologies",
319
  "raw_text": "",
320
  "raw_text_ref": [
 
324
  "confidence": 0.86
325
  }
326
  ],
327
+ "affected_id": "agent_002",
328
+ "risk_type": "PLANNING_ERROR"
329
  }
330
  ],
331
  "optimizations": [
332
  {
333
  "id": "opt_001",
 
 
334
  "description": "Develop specialized simulation tools with built-in error checking and validation to improve probability calculation accuracy and reduce execution errors",
335
  "raw_text": "Enhance probability simulation tools with validation",
336
  "raw_text_ref": [
 
343
  "affected_ids": [
344
  "agent_001",
345
  "agent_004"
346
+ ],
347
+ "recommendation_type": "TOOL_ENHANCEMENT"
348
  },
349
  {
350
  "id": "opt_002",
 
 
351
  "description": "Create unified interdisciplinary expert combining probability and chemistry knowledge to reduce coordination overhead and improve cross-domain integration",
352
  "raw_text": "Merge probability and chemistry expertise for better integration",
353
  "raw_text_ref": [
 
360
  "affected_ids": [
361
  "agent_001",
362
  "agent_002"
363
+ ],
364
+ "recommendation_type": "AGENT_MERGING"
365
  },
366
  {
367
  "id": "opt_003",
 
 
368
  "description": "Implement parallel processing for probability and chemistry analyses to reduce sequential dependencies and improve overall system efficiency",
369
  "raw_text": "Enable parallel interdisciplinary analysis",
370
  "raw_text_ref": [
 
377
  "affected_ids": [
378
  "task_001",
379
  "task_002"
380
+ ],
381
+ "recommendation_type": "WORKFLOW_SIMPLIFICATION"
382
  }
383
  ]
384
  },