Define your agent’s behavior with Global Rules in the Agent Settings. Rules cover language style, task execution, handling of difficult scenarios, and compliance with business requirements. Properly configured rules ensure consistent and effective customer interactions.

What are rules?

Rules specify how your agent responds to users, performs tasks, and handles sensitive scenarios. Use rules to:

  • Set the agent’s tone, language, and behavior.
  • Ensure compliance with organizational policies.
  • Address edge cases and high-risk interactions.

Example:

For a museum agent that always refers to “exhibits” instead of “artworks”:

“Always refer to ‘artworks’ as exhibits. Do not use the term ‘artworks’ in any context.”

Types of rules

1. Behavior and interaction guidelines

Specify how the agent interacts with users:

  • Tone: Choose formal, casual, empathetic, or calm tones.

    • Example: “Always remain polite and professional, even with frustrated users.”
  • Language style: Simplify language or avoid jargon as needed.

    • Example: “Use clear, simple language suitable for non-technical users.”
  • Consistency: Align responses with branding and messaging.

    • Example: “Always address visitors as ‘guests’ rather than ‘customers.‘“

2. Task execution

Be clear, direct, and concise when defining tasks.
  • Explicit instructions: Clearly define actions.

    • Example: “If asked about upcoming events, provide the event details and offer to send them via email.”
  • Response scope: Limit responses to specific tasks or topics.

    • Example: “Only answer questions related to museum exhibits. Avoid general queries outside this domain.”

3. Content restrictions

Set boundaries for what the agent can or cannot say:

  • Sensitive topics: Avoid prohibited subjects. For details, see the Safety Dashboard.

    • Example: “Do not discuss politics, religion, or personal opinions.”
  • Accuracy: Avoid fabricated or uncertain answers.

    • Example: “If unsure, direct the user to a staff member or a verified source.”

Best practices

  1. Be specific: Avoid ambiguity.

    • Example: Instead of “Be helpful,” use “Answer visitor questions about exhibits within two sentences and provide follow-up options.”
  2. Provide examples: Demonstrate expected interactions and responses.

    • Example:
      • Visitor: “What time does the museum close?”
      • agent: “The museum closes at 6 PM. Would you like a list of activities available before closing?”
  3. Plan for edge cases: Handle emergency or high-risk scenarios.

    • Example: “For emergencies, advise users to contact the nearest staff member immediately.”
  4. Don’t have overlapping topic areas: Keep things separate to avoid confusing your agent. Having multiple, slightly different but overlapping rules makes it harder to follow a consistent logic.

    • Example: Instead of adding multiple rules like: “Never send a follow-up message automatically. Always ask first.” as well as “If a follow-up message is available, always offer it.” and “Never send a follow-up message without user consent.”,

      You could just add one rule:

      • “Only send follow-ups if the user agrees.”
  5. Don’t use negative rules when a positive one will work: If you tell an LLM “do not transfer a caller with no verifying ID”, you are introducing the concept of a no-ID transfer to your agent. Once this happens, there is a very small risk of the agent approving a no-ID transfer.

    • Example: It is much better to use a positive rule, like “Always verify ID before transferring”.
  6. Test and iterate: Regularly review and refine rules.

Example rules

  • Handoff to a staff member

    • Example: “If visitors ask for a staff member or seem confused, notify the front desk and provide directions.”
  • Handling sensitive queries

    • Example: “For questions about controversial exhibits, respond: ‘I’m sorry, I can’t provide additional context. Please contact our curator for more information.’”
  • Consistency in responses

    • Example: “Always greet visitors with ‘Welcome to the museum!’ before answering their question.”

Pronunciations

PolyAI uses Text-to-Speech (TTS) to convert text into spoken language. Occasionally, uncommon words, domain-specific terms, proper nouns may be mispronounced. In these scenarios, the TTS Pronunciations tab is available to embed pronunciation guidelines for key phrases in the global rules.

Key points

  • Enhanced pronunciation accuracy: Correctly pronounce domain-specific terms and unique phrases using IPA.
  • Streamlined workflow: Manage rules directly in the agent studio.
  • Flexibility: Adjust pauses and pronunciation for various needs.

Key benefits

  • Improved voice quality: Ensure accurate and natural speech.
  • Domain-specific customization: Adapt to the industry-specific terminology of your industry, whether that is the medical, legal, or hospitality sector, or another area entirely.
  • Efficient workflow: Save time by eliminating external configuration.
  • Enhanced user experience: Reduce misunderstandings with clear and accurate responses.

How it works

Pronunciations use the International Phonetic Alphabet (IPA) to define pronunciation rules. By creating TTS rule objects with regular expressions and IPA replacements, you can customize how the agent speaks specific terms.

Getting started

Configure TTS Pronunciations

  1. Navigate to the Pronunciations section.
  2. Create, edit, or delete rules.
  3. Define pronunciation rules:
    • Expression: Enter a regular expression to target words.
    • Replacement: Add IPA symbols for correct pronunciation.
    • Case sensitivity: Enable if needed.

Example rule

  • Regex: /\bLouvre\b/
  • Replacement: /ˈluːvrə/
  • Case sensitive: FALSE

This ensures “Louvre” is pronounced as /ˈluːvrə/, maintaining accuracy and professionalism.