Skip to main content

Prompts & Behavior Controls

Prompts and behavior controls let you fine-tune how your agent responds, handles specific situations, and maintains conversation flow.

System Prompts

The system prompt is the foundation instruction that shapes all agent behavior.

Basic Structure

{
  "system_prompt": "You are Sarah, a receptionist at Acme Medical Clinic.\n\nYour role:\n- Answer calls and help callers with scheduling\n- Provide information about our services\n- Route calls to the appropriate department\n\nRules:\n- Never provide medical advice\n- Always confirm appointment details before booking\n- If unsure, offer to have someone call back"
}

Effective Prompts

GoodBad
”You are a medical receptionist who helps with scheduling.""Be a helpful AI."
"If asked about pricing, refer to our fee schedule.""Answer all questions."
"Confirm the caller’s date of birth for verification.""Verify identity.”

Prompt Components

  1. Identity — Who is the agent?
  2. Context — What organization, what setting?
  3. Capabilities — What can the agent do?
  4. Constraints — What should the agent avoid?
  5. Style — How should responses sound?

Behavior Modes

Conversation Mode

Control overall conversation style:
{
  "behavior": {
    "mode": "conversational",
    "allow_small_talk": true,
    "interruption_handling": "graceful",
    "silence_handling": {
      "threshold_seconds": 3,
      "response": "Are you still there? I'm happy to help if you have any questions."
    }
  }
}

Task Mode

For transaction-focused interactions:
{
  "behavior": {
    "mode": "task_focused",
    "allow_small_talk": false,
    "stay_on_topic": true,
    "max_clarifications": 3
  }
}

Response Templates

Greeting Templates

{
  "templates": {
    "greeting": {
      "business_hours": "Thank you for calling {{business_name}}, this is {{agent_name}}. How can I help you today?",
      "after_hours": "Thank you for calling {{business_name}} after hours. I can help with scheduling or take a message.",
      "returning_caller": "Welcome back, {{caller_name}}! How can I help you today?"
    }
  }
}

Situation Templates

{
  "templates": {
    "hold": "Let me look that up for you. One moment please.",
    "transfer": "I'm going to connect you with someone who can help with that.",
    "not_found": "I don't have that information readily available. Can I have someone call you back?",
    "confirmation": "Just to confirm, you'd like to {{action}} on {{date}} at {{time}}. Is that correct?",
    "goodbye": "Thank you for calling. Have a great day!"
  }
}

Dynamic Templates

Use variables in templates:
VariableDescription
{{agent_name}}Agent’s name
{{caller_name}}Caller’s name (if known)
{{business_name}}Business name
{{date}}Relevant date
{{time}}Relevant time
{{custom.field}}Custom context data

Intent Handling

Configure responses for specific intents:
{
  "intents": {
    "schedule_appointment": {
      "response": "I'd be happy to help you schedule an appointment. What day works best for you?",
      "follow_up": "collect_appointment_details"
    },
    "cancel_appointment": {
      "response": "I can help you cancel your appointment. Can you confirm your date of birth so I can look up your record?",
      "follow_up": "verify_and_cancel"
    },
    "pricing_inquiry": {
      "response": "For specific pricing, I'd recommend speaking with our billing department. Would you like me to transfer you?",
      "action": "offer_transfer"
    },
    "emergency": {
      "response": "If this is a medical emergency, please hang up and call 911. Otherwise, let me connect you with our clinical team right away.",
      "priority": "immediate",
      "action": "escalate"
    }
  }
}

Fallback Responses

Handle unexpected inputs gracefully:
{
  "fallbacks": {
    "low_confidence": {
      "threshold": 0.6,
      "response": "I want to make sure I understand correctly. Could you rephrase that?"
    },
    "no_match": {
      "response": "I'm not sure I can help with that. Would you like me to connect you with someone who can?"
    },
    "repeated_failure": {
      "after_attempts": 3,
      "response": "I'm having trouble understanding. Let me connect you with a team member who can better assist.",
      "action": "transfer_to_human"
    }
  }
}

Turn Management

Control conversation flow:
{
  "turn_management": {
    "max_agent_turns": 20,
    "max_silence_seconds": 10,
    "interruption_behavior": "pause_and_listen",
    "acknowledgment_phrases": ["I see", "Got it", "Understood", "Okay"],
    "thinking_phrases": ["Let me check on that", "One moment"]
  }
}

Interruption Handling

ModeBehavior
pause_and_listenStop speaking, listen
complete_thoughtFinish current sentence
acknowledge_and_continue”I’ll finish this thought”

Confirmation Patterns

Ensure accuracy for critical information:
{
  "confirmations": {
    "phone_number": {
      "enabled": true,
      "pattern": "Just to confirm, your phone number is {{value}}, is that correct?"
    },
    "appointment": {
      "enabled": true,
      "pattern": "I have you down for {{date}} at {{time}} with {{provider}}. Does that all sound right?"
    },
    "email": {
      "enabled": true,
      "spell_out": true,
      "pattern": "Let me read that back: {{value}}. Is that correct?"
    }
  }
}

Error Recovery

Handle mistakes gracefully:
{
  "error_recovery": {
    "misheard": {
      "detection": ["no", "that's not right", "I said"],
      "response": "I apologize, let me try again. What was that?"
    },
    "correction": {
      "acknowledgment": "Thank you for the correction. Let me update that.",
      "confirm_correction": true
    }
  }
}

Topic Steering

Keep conversations on track:
{
  "topic_steering": {
    "enabled": true,
    "allowed_topics": ["scheduling", "services", "location", "hours"],
    "redirect_response": "I'd be happy to help with scheduling and general questions. For {{topic}}, I'd recommend speaking with {{department}}.",
    "gentle_redirect_after": 2
  }
}

Context Awareness

Adapt responses based on context:
{
  "context_awareness": {
    "time_of_day": {
      "morning": "Good morning!",
      "afternoon": "Good afternoon!",
      "evening": "Good evening!"
    },
    "call_history": {
      "returning_caller": "Welcome back! Last time you called about {{last_topic}}. Is this related?",
      "frequent_caller": "Great to hear from you again!"
    },
    "caller_sentiment": {
      "frustrated": {
        "detection": ["upset", "angry", "frustrated"],
        "response_modifier": "I understand this is frustrating. Let me help resolve this."
      }
    }
  }
}

Testing Behaviors

Scenario Testing

Test specific scenarios in the simulator:
  1. Schedule appointment (happy path)
  2. Cancel appointment (verification needed)
  3. Unknown question (fallback)
  4. Frustrated caller (empathy)
  5. Off-topic question (steering)

Behavioral Metrics

MetricTarget
First-response relevance> 90%
Fallback rate< 10%
Confirmation accuracy> 95%
Transfer rate< 20%

Best Practices

Vague prompts lead to inconsistent behavior. Be explicit about expectations.
Don’t just test the happy path. Try unexpected inputs.
Templates should sound human, not robotic.
Review real conversations and refine behaviors.
Don’t overload with too many rules. Prioritize what matters.

Next Steps