Optimizing Your Agent

1. System Prompts

Examples

// Generic Agent
"You are a helpful AI assistant..."  // ❌ Too vague

// Optimized Agent
"You are a customer service agent for an e-commerce store.
You can look up orders, process returns, and track shipments.
Always verify customer identity first.
Be friendly but efficient.
Never make up order information."    // ✅ Clear and specific

2. Tool Descriptions

Basic Description

{
  name: 'search_orders',
  description: 'Search for orders'  // ❌ Vague
}

Optimized Description

{
  name: 'search_orders',
  description: 'Search for customer orders using order_id or customer_email. Returns full order details including status, items purchased, and shipping information.'  // ✅ Clear and specific
}

3. Loop Protection

Basic Protections

Advanced Protections