# 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] ← Decide to call tool # │ ├─ [Tool] fetch_new_emails ← Required: fetch emails (MCP tool name format) # │ └─ [LLM] ← Process tool result # │ # ├─ [AGENT] Senior Email Analysis and Classification Specialist ← Task 2 # │ └─ [LLM] ← Analyze emails (no tool call) # │ # └─ [AGENT] Expert Professional Email Response Composer ← Task 3 # ├─ [LLM] ← Generate reply content # ├─ [Tool] create_email_draft ← Required: create draft (MCP tool name format) # └─ [LLM] ← 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: # - 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