How to Create a Default Flow for Your AI Chatbot
After setting up a welcome message, the next essential component of your AI chatbot is the Default Flow. The Default Flow ensures that whenever a user asks a question outside the context of a specific flow, your bot can respond intelligently and consistently. In this tutorial, we’ll guide you through creating a Default Flow, customizing its prompts, and integrating various technologies like Agents, Assistants, Dialogflow, traditional chatbot logic, or a hybrid mix to enhance your bot’s responsiveness.Step 1: Understand the Default Flow vs. Default Agent and Assistant
Before diving into creating a Default Flow, it’s crucial to understand the differences between Default Flow, Default Agent, and Default Assistant:Default Flow
Function: Acts as a fallback when no specific flow handles the user’s request.
Features:
Best For:
Features:
- Direct Control: Customize responses to maintain your brand voice.
- Media & Buttons: Ideal for incorporating multimedia elements and interactive buttons.
- Flexibility: Can integrate with Agents, Assistants, Dialogflow, traditional logic, or a hybrid mix.
Best For:
- Handling unrecognized inputs with tailored, interactive responses.
- Providing a consistent and engaging fallback experience.
Default Agent
Function: The chatbot’s primary responder using your custom instructions.
Features:
Best For:
Features:
- Speed & Autonomy: Delivers quick responses based solely on predefined instructions.
- No Uploaded Data: Relies only on the instructions you provide without additional documents or files.
Best For:
- Handling general, straightforward questions with predefined answers.
- Scenarios where speed and simplicity are prioritized over detailed responses.
Default Assistant
Function: An enhanced responder that accesses additional information from uploaded files like menus, FAQs, or product details.
Features:
Best For:
Features:
- Knowledge Base Reliance: Utilizes uploaded data for comprehensive responses.
- Detailed Responses: Can handle more complex queries by referencing specific documents.
Best For:
- Providing specific and data-driven answers to user inquiries.
- Businesses that need the chatbot to reference detailed information.
When to Use Each
- Default Flow: Use If: You need interactive elements (media/buttons) and complete control over fallback responses.
- Default Agent: Use If: You need quick, autonomous responses for general questions without detailed information.
- Default Assistant: Use If: Your chatbot requires access to detailed information from uploaded files for accurate answers.
Review Your Current SetupCheck the Default Agent
- Navigate to Integrations: Go to your chatbot builder’s Integrations section.
- Select OpenAI.
- Verify Default Agent: Ensure the Default Agent is enabled by default.
-
Customize Instructions (optional):
- Preview Your Chatbot: Under your existing welcome message, open the chatbot’s preview.
- Ask Sample Questions:
- “Who are you?”
- “Do you serve pizza?”
- Agent Responses: Should follow the custom instructions you set.
Create a New Default FlowAdd a New Flow
- Navigate to Flows: Click on the Flows section in your dashboard.
- Create Flow: Click Add.
- Name the flow Default Flow.
- Click Continue.
- You’ll see an empty flow ready for configuration.
Add an AI-Generated Reply NodeAdd OpenAI Step
- Insert Step: Click the first block.
- Choose Add Content / Actions.
- Select OpenAI and then the OpenAI element.
-
Define Prompt:
- Configuration: Allows the bot to consider the user’s most recent message.
- Typically, no adjustments needed for a simple Default Flow.
- Add Field: Click Add New Custom Field.
- Name it
default_reply. - Click Continue.
- Result: The OpenAI step will generate a response based on the user’s latest message and your instructions, saving it into
default_reply.
Add a Send Message StepDrag the Continue Arrow
- From the OpenAI step, drag the Continue arrow to a new Send Message step.
- Configure Message: Replace any static text with your custom field:
{{default_reply}}. - This ensures the AI-generated answer is displayed to the user.
- OpenAI Step: Rename to
Generate Reply. - Send Message Step: Rename to
Send Text Reply.
Publish and Activate Your Default FlowPublish Your Flow
- Click Publish to save your changes.
- Navigate to Settings: Go to Settings > General.
- Select Default Flow: Find the Default Flow dropdown menu.
- Select Default Flow (the flow you just created).
- Return to Integrations: Go back to Integrations > OpenAI.
- Turn Off Default Agent: Uncheck or disable the Default Agent.
- Click Save.
- Outcome: Your custom Default Flow is now active and will handle all queries that don’t fall under a specific flow.
Test Your Default FlowPreview Your Chatbot
- Return to the Welcome Message and click Preview to start a conversation.
- Example Query: “Do you serve pizza?”
- Expected Response: “I’m sorry, but we only serve seafood at Ryan’s restaurant.”
- Example Query: “Can I reserve a table on Sunday?”
- Expected Response: “We are closed on Sundays, so we won’t be able to accommodate reservations on that day.”
- Result: Your Default Flow responds based on custom instructions, maintaining consistency and brand voice.
Fine-Tune Your Responses Using an AgentFor even greater control and personalized, on-brand replies, integrate Agents, Assistants, Dialogflow, traditional chatbot logic, or a hybrid mix into your Default Flow.Create an Agent
- Navigate to Manage Agents: Go to the Manage Agents tab.
- Add a New Agent: Click Add.
- Name it (e.g.,
Ryan’s Restaurant Agent).
-
Enhance Instructions:
-
Example Scenarios:
- User: “Do you have pepperoni pizza?”
- Agent: “No pizza ever! We only serve fresh seafood here, my friend.”
- Return to Default Flow: Open your Default Flow.
- Select the OpenAI Step: Choose the Generate Reply step.
- Integrate Agent: Instead of custom instructions, select the Ryan’s Restaurant Agent from your agents’ menu.
- Publish Changes: Click Publish to save the updated flow.
- Preview Chatbot: Go back to the Assistant tab and click Preview.
- Ask Off-Brand Questions:
- “I want to order three large pizzas.”
- “Can I get 12 hamburgers?”
- Expected Responses:
- “No pizza ever! We only serve seafood here, my friend.”
- “No hamburgers ever! We’re all about seafood here.”
- Result: Your chatbot responds in a consistent, on-brand manner using the integrated Agent.
Integrate Additional Technologies for a Robust Default FlowEnhance your Default Flow by incorporating various technologies to handle a wide range of user interactions:Example Integration:
Agents and Assistants
- Agents: Use for quick, autonomous responses based on custom instructions.
- Assistants: Utilize for detailed, data-driven answers using uploaded files.
Machine Learning with Dialogflow
- Advanced Understanding: Leverage Dialogflow for sophisticated natural language processing and intent recognition. (Legacy)
Traditional Chatbot Logic
- Rule-Based Responses: Implement predictable, keyword-driven responses for straightforward tasks.
Hybrid Mix
- Best of Both Worlds: Combine Agents, Assistants, Dialogflow, and traditional logic to create a versatile and comprehensive Default Flow.
- Common Questions: Handled by Agents for speed.
- Detailed Inquiries: Managed by Assistants with access to uploaded data.
- Complex Conversations: Routed through Dialogflow for nuanced understanding.
- Specific Tasks: Managed via traditional logic, such as booking reservations.
Quick Recap
Default Flow
Function: Fallback for unrecognized inputs with customizable, media-rich responses.
Best For: Interactive and branded fallback scenarios.
Best For: Interactive and branded fallback scenarios.
Default Agent
Function: Fast, autonomous responder based on custom instructions.
Best For: General, predefined queries requiring quick answers.
Best For: General, predefined queries requiring quick answers.
Default Assistant
Function: Detailed responder using uploaded data for comprehensive answers.
Best For: Specific, data-driven inquiries needing detailed information.
Best For: Specific, data-driven inquiries needing detailed information.
