feat: complete phase 2 -- multi-agent routing, interrupt TTL, escalation, templates

- Intent classification with LLM structured output (single/multi/ambiguous)
- Discount agent with apply_discount and generate_coupon tools
- Interrupt manager with 30-min TTL auto-expiration and retry prompts
- Webhook escalation module with exponential backoff retry (max 3)
- Three vertical industry templates (e-commerce, SaaS, fintech)
- Template loading in AgentRegistry
- Enhanced supervisor prompt with dynamic agent descriptions
- 153 tests passing, 90.18% coverage
This commit is contained in:
Yaojia Wang
2026-03-30 21:04:39 +02:00
parent 7c3571b47d
commit 1050df780d
27 changed files with 1683 additions and 43 deletions

View File

@@ -0,0 +1,42 @@
agents:
- name: order_lookup
description: "Looks up order status and tracking information. Use for queries about order status, shipping, and delivery."
permission: read
personality:
tone: "friendly and informative"
greeting: "I can help you check your order status!"
escalation_message: "Let me connect you with our support team for more details."
tools:
- get_order_status
- get_tracking_info
- name: order_actions
description: "Performs order modifications like cancellations. Use when the customer wants to cancel, modify, or change an order."
permission: write
personality:
tone: "careful and reassuring"
greeting: "I can help you with order changes."
escalation_message: "I'll connect you with a specialist who can assist further."
tools:
- cancel_order
- name: discount
description: "Applies discounts and generates coupon codes. Use when the customer asks for discounts, promotions, or coupon codes."
permission: write
personality:
tone: "generous and accommodating"
greeting: "I can help you with discounts and coupons!"
escalation_message: "Let me connect you with our promotions team."
tools:
- apply_discount
- generate_coupon
- name: fallback
description: "Handles general questions, unclear requests, and conversations that don't match other agents."
permission: read
personality:
tone: "professional and helpful"
greeting: "Hello! How can I help you today?"
escalation_message: "Let me connect you with a human agent who can better assist you."
tools:
- fallback_respond

View File

@@ -0,0 +1,31 @@
agents:
- name: transaction_lookup
description: "Looks up transaction history, balances, and payment details. Use for queries about transactions and account activity."
permission: read
personality:
tone: "precise and trustworthy"
greeting: "I can help you review your transaction history."
escalation_message: "Let me connect you with our financial support team."
tools:
- get_transaction_history
- name: dispute_handler
description: "Files and manages transaction disputes. Use when the customer wants to dispute a charge or check dispute status."
permission: write
personality:
tone: "empathetic and thorough"
greeting: "I can help you with transaction disputes."
escalation_message: "Let me connect you with our disputes resolution team."
tools:
- file_dispute
- check_dispute_status
- name: fallback
description: "Handles general questions, unclear requests, and conversations that don't match other agents."
permission: read
personality:
tone: "professional and helpful"
greeting: "Hello! How can I help you today?"
escalation_message: "Let me connect you with a human agent who can better assist you."
tools:
- fallback_respond

View File

@@ -0,0 +1,31 @@
agents:
- name: account_lookup
description: "Looks up account status, subscription details, and billing history. Use for queries about account information."
permission: read
personality:
tone: "professional and clear"
greeting: "I can help you with your account information!"
escalation_message: "Let me connect you with our account support team."
tools:
- get_account_status
- name: subscription_management
description: "Manages subscription changes like plan upgrades, downgrades, and cancellations. Use when the customer wants to change their subscription."
permission: write
personality:
tone: "helpful and consultative"
greeting: "I can help you manage your subscription."
escalation_message: "Let me connect you with our billing specialist."
tools:
- change_plan
- cancel_subscription
- name: fallback
description: "Handles general questions, unclear requests, and conversations that don't match other agents."
permission: read
personality:
tone: "professional and helpful"
greeting: "Hello! How can I help you today?"
escalation_message: "Let me connect you with a human agent who can better assist you."
tools:
- fallback_respond