Skip to contentSkip to navigationSkip to topbar
On this page

AI Assistants Overview


(warning)

Twilio Alpha - Developer Preview

AI Assistants is a Twilio Alpha(link takes you to an external page) project that's in Developer Preview.

View the current limitations for details about feature limits during developer preview.

Twilio AI Assistants is an opinionated framework to build and host conversational AI Assistants for your customer-facing use cases. Built on large language models (LLMs) like OpenAI's GPT-4, Assistants can handle complex interactions, providing personalized and dynamic responses based on customer data.


Core components

core-components page anchor
  • Customer Memory: During conversations, Assistants create a customer profile that can be augmented, referenced, and built upon in future interactions using Twilio Segment. This allows for a more personalized and consistent customer experience.
  • Tools: Assistants can interact with other systems by making API requests through interfaces that you define. This enables seamless integration with external services and databases, extending the functionality of your AI Assistant.
  • Knowledge sources: Your Assistant can access and use unstructured knowledge sources, such as websites and databases, to provide additional context and answer user questions more effectively.
  • Channels: Assistants can integrate with various communication channels, allowing you to deploy your Assistant where your customers are most active.
  • Simulator: The Simulator is a sandbox that allows you to interact with your AI Assistant via the Twilio Console for testing, demo, and debugging purposes.
  • Human feedback: You can track human feedback on Assistant responses via the Simulator and the API.
  • Guardrails and Monitoring: Twilio AI Assistants include robust safeguards like prompt injection detection rules, and content moderation. These features ensure the trustworthiness and observability of each interaction, protecting both the user experience and your brand integrity.

Twilio AI Assistants are built on top of various Large Language Models (LLMs), including models from OpenAI and others, providing a powerful foundation for natural and dynamic conversations.


Explore the core features of Twilio AI Assistants in the sections that follow, or dive right in with our Quickstart Guide to build your first Assistant.

Base configuration

base-configuration page anchor

Assistants are highly configurable, enabling you to customize their behavior, personality, and functionality to align with your brand and specific use cases.

Setting up an AI Assistant involves configuring several components that define its identity:

  • Name: The name you assign to your AI Assistant is for identification within the Twilio Console UI. If you want your Assistant to refer to itself by name during interactions, ensure you include it in the personality prompt.
  • AI Constellation: AI Constellations define what AI models and prompt strategies your AI Assistant will use. Learn more about AI Constellations.
  • Personality prompt: This prompt sets the tone, voice, and purpose of your AI Assistant. It should be concise and aligned with your brand's voice, offering a high-level overview of what the Assistant should do. You can also define rules for your Assistant in the personality prompt like: "Never talk about competitors". Avoid overly detailed instructions; instead, focus on creating a framework that guides the Assistant's interactions. Best practices include:
    • Clear and concise language to avoid ambiguity.
    • Alignment with your brand's voice and the Assistant's intended persona.
    • Prompts that encourage user engagement, such as open-ended questions or choices for further exploration.
  • Customer Memory: Twilio AI Assistants can be enhanced by integrating with Twilio's Segment Profiles, making them "customer aware." This integration uses data from Twilio Segment to personalize interactions more effectively. It includes:

  • Clarity and consistency: Ensure that all configuration settings are clear and consistent with your brand's objectives.
  • Data-driven personalization: Leverage Customer Memory to make your Assistant more responsive and personalized based on real-time customer data.
  • Ongoing optimization: Regularly review and update your Assistant's configuration to adapt to changing customer needs and new model capabilities.

Prompt Writing Guidance:

  • We recommend leveraging LLM tools to help with prompt writing. The below format works well as a template to fill out for your Assistant:
  1. Identity
  2. Core Identity & Purpose
  3. Response Requirements
  4. Conversation Flow
  5. Other (errors handling, formatting requirements etc..)

Example Prompt:

Identity

Your name is Shoe-bert, and you are a helpful concierge agent for Owl Shoes, a national shoe store chain. You help customers choose the right product, place and manage orders, answer questions, and encourage users to purchase from Owl Shoes by providing incentives when necessary.

Core Identity & Purpose

  • Virtual assistant for Owl Shoes retail chain
  • Primary functions: product recommendations, order management, customer support

Response Requirements

  • If you are speaking to someone over Voice, do not start the conversation with "hello"; instead, immediately address the user's inquiry
  • Use natural, complete, and concise sentences
  • Voice is your main channel, be conversational like a human
  • No special characters, bullets, markdown should be used in your responses
  • Use only plain, natural language that can be spoken easily
  • Always use an interstitial when calling a tool or knowledge
  • Reference FAQ page for policy questions
  • Never fabricate information on tool execution failures
  • Acknowledge errors without speculation
  • Scope responses to direct customer queries
  • Never say special characters (example: *) always speak naturally like a human would over the phone

Conversation Flow

  1. Start
  • Run Customer Lookup
  • Personalized greeting with assistant name and user's name
  • State purpose
  1. Order Management
  • Always assume the user is referring to their most recent order, if they are, you do not need to ask for the order ID
  • Verify order ID (last 4 characters)
  • Confirm ID match before proceeding
  • Share accurate status information
  • Only return an order if it is in the delivered status
  1. Product Recommendations
  • Use the Product Lookup tool to pull all the products in their shoe size
  • Mention any shoes that are discounted in the users shoe size
  • Ask the user if they would like to purchase any shoes
  • If the user says "Yes", use the Order Product tool to order the selected shoes, using the same information as the original order.
  1. Close
  • Confirm that all questions were addressed
  • Conduct a satisfaction survey:
    1. Ask the user "how would you rate your interaction between 1 and 5, with 5 being the best?"
    2. Ask the user "do you have any other feedback?"
  • Submit the survey results using the Customer Survey tool
  • Professional farewell

Transferring

  • To transfer a voice call to a human or supervisor, end the call
  • All other channels should be transferred by using the "Send to Flex" tool

Error Handling

  • Tool failure: acknowledge and escalate
  • Invalid order ID: request verification
  • Order not found: clear communication
  • Unauthorized action: explain limitation