File size: 5,774 Bytes
8c10cf2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | # Complete Reference Trajectory Configuration - EmailResponder-MCP Project
#
# Version: Ideal trajectory based on code design (applicable to all models)
# Principle: Only include steps explicitly required by code design, not based on test statistics
#
# MCP Version Features:
# - Tools provided via MCP Server, tool names in lowercase+underscore format
# - Both Agents use mcp_adapter.tools (same tool set)
#
# Code Design Analysis (based on Mock mode):
# 1. Required tool: fetch_new_emails
# - tasks.yaml explicitly requires this tool to fetch emails
#
# 2. Required tool: create_email_draft
# - tasks.yaml: "If auto_create_drafts is enabled, use..."
# - main.py: auto_create_drafts=True (hardcoded)
#
# 3. Optional tool: get_gmail_thread
# - Not providing additional value in Mock mode (fetch_new_emails already returns complete info)
# Project name
project_name: "EmailResponder-MCP"
# Trajectory extraction type configuration
# Focus on: SPAN, Chain, AGENT, LLM, Tool
# Ignore: Task Created, Crew Created and other non-core content
extract_types:
- "SPAN" # Level 1: Top-level execution span
- "Chain" # Level 2: Crew execution chain
- "AGENT" # Level 3: Agent execution
- "LLM" # Level 4: LLM calls
- "Tool" # Level 4: Tool calls
# ============================================================================
# Reference Trajectory (Ground Truth) - Based on Code Design (MCP Version)
# ============================================================================
#
# Graphical Structure (ideal execution path):
#
# [SPAN] email_auto_responder
# └─ [Chain] Crew***.kickoff
# ├─ [AGENT] Senior Email Analysis and Classification Specialist ← Task 1
# │ ├─ [LLM] <model> ← Decide to call tool
# │ ├─ [Tool] fetch_new_emails ← Required: fetch emails (MCP tool name format)
# │ └─ [LLM] <model> ← Process tool result
# │
# ├─ [AGENT] Senior Email Analysis and Classification Specialist ← Task 2
# │ └─ [LLM] <model> ← Analyze emails (no tool call)
# │
# └─ [AGENT] Expert Professional Email Response Composer ← Task 3
# ├─ [LLM] <model> ← Generate reply content
# ├─ [Tool] create_email_draft ← Required: create draft (MCP tool name format)
# └─ [LLM] <model> ← Confirm completion
#
# Design Rationale (based on Mock mode):
# - Task 1: tasks.yaml explicitly requires fetch_new_emails
# - Task 2: In Mock mode, fetch_new_emails already returns all info (snippet),
# get_gmail_thread won't provide additional value, so not called
# - Task 3: tasks.yaml requires creating draft when auto_create_drafts=True
# main.py: auto_create_drafts=True (hardcoded)
#
# Notes:
# - <model> represents any LLM, not limited to specific model
# - MCP tool names use lowercase+underscore format (fetch_new_emails, create_email_draft)
# ============================================================================
reference_trajectory:
# ===== Level 1: SPAN =====
- "SPAN: email_auto_responder"
# ===== Level 2: Chain (wildcard for UUID) =====
- "Chain: Crew***.kickoff"
# ===== Task 1: fetch_emails_task =====
# Required: fetch_new_emails (MCP tool, lowercase+underscore format)
- "Agent: Senior Email Analysis and Classification Specialist"
- "LLM: *" # Any model
- "Tool: fetch_new_emails"
- "LLM: *"
# ===== Task 2: filter_emails_task =====
# Only analyze emails, no tool call (in Mock mode fetch_new_emails already returns all info)
- "Agent: Senior Email Analysis and Classification Specialist"
- "LLM: *"
# ===== Task 3: generate_responses_task =====
# Required: create_email_draft (MCP tool, auto_create_drafts=True)
- "Agent: Expert Professional Email Response Composer and Communication Strategist"
- "LLM: *"
- "Tool: create_email_draft"
- "LLM: *"
# Target tools list (for single-tool use metric)
# Only includes actual tool calls, used to detect tool usage
target_tools:
# MCP tools (lowercase+underscore format)
- "Tool: fetch_new_emails"
- "Tool: get_gmail_thread"
- "Tool: create_email_draft"
# Models to evaluate
models:
- "GPT-5"
- "GPT-4o-mini"
- "DeepSeek-V3-1"
- "DeepSeek-R1"
- "Gemini-2.5-flash"
- "Gemini-2.5-flash-nothinking"
- "Qwen3-235b"
# Usage Instructions:
#
# 1. Trajectory Hierarchy:
# - Top: SPAN (email_auto_responder)
# - Level 2: Chain (Crew***.kickoff, wildcard for UUID)
# - Level 3: AGENT (specific Agent name, must match exactly)
# - Level 4: LLM and Tool (alternating)
#
# 2. Wildcard Handling:
# - Crew_b02af339-6c40-4ecb-b174-ec6fbe8e2081.kickoff -> Crew***.kickoff
# - Script automatically converts Crew_UUID.kickoff format to Crew***.kickoff
#
# 3. Exact Match Requirements:
# - SPAN name: exact match "email_auto_responder"
# - Chain name: wildcard match "Crew***.kickoff"
# - AGENT name: exact match (e.g., "Senior Email Analysis and Classification Specialist")
# - LLM name: exact match model name (e.g., "gpt-4o-mini")
# - Tool name: exact match tool name (e.g., "fetch_new_emails")
#
# 4. Evaluation Metrics:
# - Exact Match: requires all nodes to be identical (including LLM call count)
# - In-order Match: allows extra LLM calls, but core sequence must be in order
# - Any-order Match: only requires all necessary nodes to be present
# - Precision/Recall: calculates accuracy and recall for all nodes
#
# 5. Run Command:
# python3 evaluate_trajectory.py --config reference_trajectory.yaml
#
# 6. Notes:
# - Different models may have different LLM call counts (thinking, retries, etc.)
# - Complete trajectory evaluation is stricter than Tool-only evaluation
# - Exact Match scores may be low, focus on In-order Match and Any-order Match
|