Examples are the cornerstone of training effective AI agents in StateSet ReSponse. By providing real conversation examples, you teach your agents how to handle various scenarios, maintain consistent tone, and deliver accurate responses. This guide will show you how to create, manage, and optimize examples for maximum agent performance.
const example = await client.examples.create({ category: 'order_status', user_input: 'Where is my order? I placed it 3 days ago.', agent_response: `I'd be happy to help you track your order! To locate it quickly, could you please provide your order number or the email address used for the purchase? Once I have that information, I'll check the current status and expected delivery date for you right away.`, tags: ['order_tracking', 'polite_request', 'information_gathering'], sentiment: 'neutral', effectiveness_score: 0.95});
const orderExample = await client.examples.create({ category: 'order_status', user_input: 'My order #12345 hasn\'t arrived yet', agent_response: `I understand your concern about order #12345. Let me check that for you right away.I can see your order was shipped on [date] via [carrier] with tracking number [tracking]. According to the latest update, it's currently in [location] and expected to arrive by [date].If it doesn't arrive by then, please let me know and I'll be happy to help resolve this for you, including exploring replacement or refund options.`, tags: ['order_tracking', 'proactive_solution', 'empathy'], metadata: { requires_data: ['order_number', 'shipping_info'], tone: 'empathetic_professional' }});
const productExample = await client.examples.create({ category: 'product_inquiry', user_input: 'What\'s the difference between the Pro and Standard versions?', agent_response: `Great question! Let me break down the key differences between our Pro and Standard versions:**Standard Version:**- Core features for everyday use- 5GB storage- Email support- Perfect for individuals**Pro Version:**- All Standard features PLUS:- Unlimited storage- Priority 24/7 support- Advanced analytics- Team collaboration tools- API accessThe Pro version is ideal if you need team features or extensive storage. Would you like me to help you choose which one best fits your needs?`, tags: ['product_comparison', 'structured_response', 'upsell_opportunity'], effectiveness_score: 0.92});
const troubleshootingExample = await client.examples.create({ category: 'technical_support', user_input: 'The app keeps crashing when I try to upload photos', agent_response: `I'm sorry you're experiencing crashes with photo uploads. Let's troubleshoot this together:1. **Quick Fix** - Try these first: - Force close the app and restart it - Check if you have at least 500MB free storage - Ensure you're on WiFi (large uploads can fail on cellular)2. **If still crashing:** - Update to the latest app version (Settings > About > Check Updates) - Clear app cache (Settings > Storage > Clear Cache)3. **Still having issues?** - What device and OS version are you using? - What's the file size of the photos? - Does it crash with all photos or specific ones?Let me know what happens, and I'll help you get this resolved!`, tags: ['troubleshooting', 'step_by_step', 'diagnostic_questions'], metadata: { escalation_point: 'step_3', requires_follow_up: true }});
const upsellExample = await client.examples.create({ category: 'sales_upsell', user_input: 'I\'m running out of storage space', agent_response: `I see you're getting close to your storage limit! You're currently using 4.8GB of your 5GB Standard plan.Here are your options:**Immediate Solution:**- Free up space by removing old files (I can help identify large files)**Long-term Solution - Upgrade to Pro:**- Unlimited storage (never worry about limits again)- Only $10/month more than your current plan- Includes bonus features like priority support and advanced analytics- **Special offer**: Upgrade today and get the first month 50% off!Would you like me to help free up space now, or shall I tell you more about the Pro benefits?`, tags: ['upsell', 'problem_solving', 'value_proposition', 'urgency'], conversion_rate: 0.34});
const complaintExample = await client.examples.create({ category: 'complaint_resolution', user_input: 'This product is terrible! I want a full refund immediately!', agent_response: `I sincerely apologize that our product hasn't met your expectations. Your satisfaction is extremely important to us, and I want to make this right.I can absolutely help you with a refund. To process this quickly:1. I'll initiate a full refund to your original payment method2. You'll receive a confirmation email within the next hour3. The refund will appear in your account within 3-5 business daysAdditionally, I'd love to understand what went wrong so we can improve. Would you mind sharing what specific issues you experienced? This helps us serve customers better in the future.Is there anything else I can help resolve for you today?`, tags: ['de-escalation', 'refund_process', 'feedback_request', 'empathy'], sentiment: 'negative', resolution_score: 0.89});
// ❌ Poor Example - Too brief, no personality{ user_input: "Where's my order?", agent_response: "Check your email for tracking info."}// ✅ Good Example - Helpful, branded, actionable{ user_input: "Where's my order?", agent_response: `I'd be happy to help locate your order! To find it quickly, I'll need either: - Your order number (starts with #) - The email address used for purchase Once you share that, I'll pull up the tracking details and expected delivery date immediately.`}
// Create examples for complex, multi-turn conversationsconst multiTurnExample = await client.examples.create({ category: 'complex_support', conversation_flow: [ { turn: 1, user: "I can't log into my account", agent: "I'd be happy to help you regain access. Are you receiving any error messages?" }, { turn: 2, user: "Yes, it says 'Invalid credentials'", agent: "Thanks for that information. Let's verify your account. What email address are you using to log in?" }, { turn: 3, user: "john@example.com", agent: "I found your account. For security, I'll send a password reset link to jo***@example.com. You should receive it within 5 minutes. Would you like me to send it now?" } ], tags: ['multi_turn', 'account_recovery', 'security_conscious']});