Intentions

Configure custom intent detection to enhance your chatbot's ability to recognize and respond to specific user needs.

Overview

Intentions are predefined patterns of user queries that trigger specific responses or actions. They allow your chatbot to:

  • Recognize when users need human assistance
  • Detect specific information requests like pricing or product details
  • Identify support or troubleshooting needs
  • Trigger custom workflows based on user input

When an intention is detected, the system can return a predefined response or trigger a special action, such as routing to a human agent or retrieving specific information.

Configuration

You can configure intentions through the Project Dashboard under "Intentions" in the project menu. This gives you full control over creating custom intentions that meet your specific needs.

JSON Schema

Intentions are configured using a JSON structure with the following format:

Intentions Configuration
{
    "intentions": [
        {
            "name": "human_assistance",
            "samples": [
                "I need to speak with a human",
                "Can I talk to a real person",
                "Connect me with support",
                "I want to speak to a representative"
            ],
            "response_code": "HUMAN_ASSIST_REQUESTED"
        },
        {
            "name": "pricing_inquiry",
            "samples": [
                "What are your prices",
                "How much does it cost",
                "Can you tell me about pricing",
                "Do you have payment plans",
                "What are the subscription fees",
                "I want to know about payment options"
            ],
            "response_code": "SALES_DEPARTMENT_REDIRECT"
        }
    ]
}

Schema Properties

Property Type Description
intentions array Array of intention objects
name string Unique identifier for the intention
samples array Example phrases that should trigger this intention
response_code string Custom identifier for your response or action to trigger

Custom Response Codes

Response codes are fully customizable. You can create any response code that makes sense for your application. Here are some examples of how you might use custom response codes:

Example Response Code Possible Use
HUMAN_ASSIST_REQUESTED For handling requests to speak with a human agent
SALES_DEPARTMENT_REDIRECT For redirecting pricing and payment questions to the sales team
SUPPORT_REQUESTED For directing users to support resources
ORDER_STATUS_CHECK For handling order status inquiries

The response codes you define are used within your application to determine how to handle specific user intentions. You have complete freedom to create any response codes that align with your business needs.

Best Practices

  • Include Variations: For each intention, include multiple phrasings to improve detection accuracy
  • Be Specific: Focus on clear, specific intentions rather than broad, general categories
  • Test Thoroughly: Test your configured intentions with real user queries to ensure accurate detection
  • Limit Overlap: Avoid significant overlap between different intention samples to prevent confusion
  • Update Regularly: Review and update your intentions as you learn more about your users' behaviors and needs
  • Use Meaningful Response Codes: Create descriptive response codes that clearly indicate the purpose of each intention

API Integration

When an intention is detected through the Chat API, the response will include is_intention: true and return the specified response code. Your application is responsible for handling this response code and providing the appropriate user-facing message:

API Response with Detected Intention
{
  "status": "success",
  "message": {
    "question": "Can I speak to a human agent?",
    "answer": "HUMAN_ASSIST_REQUESTED",
    "source": []
  },
  "execution_time": 0.3,
  "call_cost": 0,
  "total_tokens": 1,
  "is_intention": true
}

Your integration should check for is_intention: true and handle the response code in the answer field accordingly. This allows you to customize how each intention is presented to your users.

Example Use Cases

Customer Support

  • Human escalation requests
  • Billing inquiries detection
  • Refund request identification

Sales & Pricing

  • Pricing inquiries routing
  • Payment plan questions
  • Subscription fee information

Need Help?

Having trouble configuring intentions? Our support team is here to help: