SQLAssistant-A2A Evaluation Scripts
This directory contains evaluation scripts for analyzing the SQLAssistant-A2A project results across different language models.
Scripts
1. analyze_retry_patterns.py
Analyzes RETRY patterns in execution paths, including:
- Orchestrator RETRY: Framework-level retries (e.g.,
crew_execution (retry N)) - Business RETRY: Application-level retries (e.g.,
generate_sql (business_retry N))
Output Files:
retry_analysis.json- Detailed retry statisticsretry_summary.csv- Summary statistics by modelerror_by_agent.csv- Error location statistics by agentbusiness_retry_chapters.csv- Business retry location statistics
Usage:
python3 analyze_retry_patterns.py
2. evaluate_scores.py
Collects and analyzes score statistics from execution logs.
Output Files:
score_analysis.json- Detailed score datascore_summary.csv- Summary statistics by model
Usage:
python3 evaluate_scores.py
3. evaluate_success.py
Calculates success rates based on whether required tools were executed.
Success Criteria: Execution of get_database_schema tool (required to understand database structure)
Output Files:
success_detailed_results.json- Detailed results by sessionsuccess_rate.csv- Success rate summary by model
Usage:
python3 evaluate_success.py
4. evaluate_trajectory-Filter_Tools.py
Evaluates execution trajectories using 6 metrics:
- Exact match - Complete trajectory match
- In-order match - Required steps appear in order
- Any-order match - All required steps present
- Precision - Correctness of predicted steps
- Recall - Coverage of required steps
- Single-tool use - Individual tool usage rates
Configuration:
- Uses
reference_trajectory.yamlfor ground truth trajectory definition
Output Files:
evaluation_results.csv- Evaluation metrics by modelevaluation_results.md- Formatted results reportany_order_match_failures.csv- Failure analysis (with--diagnose-failures)
Usage:
python3 evaluate_trajectory-Filter_Tools.py --config reference_trajectory.yaml
python3 evaluate_trajectory-Filter_Tools.py --diagnose-failures # With failure analysis
Configuration
reference_trajectory.yaml
Defines the ground truth execution trajectory for the SQLAssistant-A2A project, including:
- Reference trajectory steps
- Target tools for evaluation
- Model list
- Extract types (SPAN, Chain, Agent, LLM, Tool)
Models Evaluated
- DeepSeek-R1
- DeepSeek-V3-1
- GPT-4o-mini
- GPT-5
- Gemini-2.5-flash
- Gemini-2.5-flash-nothinking
- Qwen3-235b
Data Structure
Scripts expect the following directory structure:
/Users/wzr/TOSEM-2025/RESULTS/
├── <model_name>/
│ └── SQLAssistant-A2A/
│ └── test_results/
│ ├── session_1/
│ │ ├── execution_path.md
│ │ └── execution_log.json
│ ├── session_2/
│ └── ...
Requirements
- Python 3.x
- pandas
- PyYAML
Notes
- All scripts automatically process all configured models
- Results are saved in the same directory as the scripts
- Scripts handle missing data gracefully and report warnings