Agent
Chatbot

Chatbots

So far, we've discussed how to build powerful AI agents with custom knowledge and capabilities. But what if you want to share your agent so anyone can use it, even without a MindPal account? That's where chatbots come in.

What are Chatbots?

Chatbots are the publishable version of your AI agents. They provide a user-friendly chat interface that allows anyone to interact with your agent's capabilities. Think of it as turning your agent into a public-facing service that can be:

  • Embedded on your website
  • Shared via a public link
  • Accessed through a chat bubble
  • Hosted on your custom domain

How Chatbots Work

When you publish an agent as a chatbot:

  1. Interface Layer: Your agent gets wrapped in a customizable chat interface
  2. Public Access: Users can interact without needing a MindPal account
  3. Secure Processing: All interactions are still powered by your configured agent
  4. Data Collection: Optional user information can be gathered
  5. Usage Tracking: All conversations can be monitored and analyzed
  6. Webhook Integration: Automatically send user info and conversation logs to external systems

One agent can be published as multiple chatbots, each with its own unique interface and settings.

Configuring Chatbots

Navigate to the chatbot builder to configure these sections:

1. Choose the Brain

Select the AI agent that will power this chatbot.

Agent (required): This is the "brain" behind your chatbot - it determines what the chatbot knows and can do.

2. Set Up the Identity

Configure how your chatbot appears to users:

  • Name (required): Give your chatbot a clear, identifiable name
  • Categories: Organize your chatbot with tags for easy discovery
  • Avatar: Add a profile picture (supports image URLs or file uploads)
  • Description: Explain what your chatbot can help with

3. Design the Chat Experience

Control the initial user experience:

  • Welcome Message (required): Set the first message users see when chatting
  • Conversation Starters: Add clickable message suggestions to help users get started

4. Customize the Chat Interface

Personalize the visual appearance:

  • Brand Color: Choose a custom accent color for the interface
  • MindPal Branding: Toggle the "Powered by MindPal" badge visibility (requires upgrade)
  • Affiliate Code: Connect your affiliate code to earn 20% recurring commission when users subscribe via the badge link
  • UX Copywriting: Customize button texts and placeholders:
    • Chat input placeholder
    • User info form send button text

5. Capture User Info

Collect information from users before they start chatting.

Collection Mode - Choose one of three options:

  • Don't collect: Users can chat immediately without providing info
  • Optional: Users can skip providing info and go straight to chatting
  • Required before chat: Users must complete the form before accessing the chat

When collecting user info:

  • Form Title (required): Set a custom title for your info collection form
  • Custom Fields: Add multiple form fields with different types:
    • Text: Single-line text input
    • Long Text: Multi-line text area
    • Email: Email address input with validation
    • URL: Website URL input with validation
    • Number: Numeric input with validation

6. Control Access

Manage who can access your chatbot and how:

  • Custom URL/Slug (required): Your chatbot will be available at chatbot.getmindpal.com/your-slug

  • Custom Domain (optional): Use your own domain for the chatbot (e.g., chatbot.yourdomain.com)

  • Embedding Restrictions (optional): Limit which domains can embed your chatbot as an iframe

    • Add specific domains (one per line) that are allowed to embed your chatbot
    • Example: example.com, subdomain.example.com
  • Enable Custom User ID (optional): Allow users to see their conversation history by passing their user ID from your system. Choose one of three modes:

    • None (Anonymous) - Default setting. All conversations are anonymous with no user identification required. Perfect for public chatbots.

    • Optional - Custom user ID can be passed to enable conversation history per user. If no user ID is provided, chat works normally (anonymous). Best for mixed audiences (some authenticated, some not).

    • Required - Custom user ID must be passed or the chat won't work. Always provides conversation history. Only use this if the chatbot is behind a login wall or in a members-only area.

    When enabled, you can pass a user ID from your website to MindPal, allowing users to access their conversation history whenever they return. See the Custom User ID Guide for detailed implementation instructions.

7. Advanced

Configure advanced features to enhance your chatbot's capabilities.

User Info Webhook

Automatically send collected user data to an external webhook URL when users submit the info form.

Payload Example:

{
  "chatbotId": "<YOUR_CHATBOT_ID>",
  "chatbotConversationId": "<CURRENT_CONVERSATION_ID>",
  "chatbotConversationViewUrl": "<VIEW_URL>",
  "userInfo": {
    "firstName": "John",
    "email": "john@example.com",
    "company": "Acme Inc"
  },
  "customSessionContext": {
    "customer-id": "12345",
    "subscription-plan": "premium"
  }
}

Use this with automation platforms like Make.com, Zapier.com, or any webhook-compatible service.

Conversation Complete Webhook

Automatically send conversation logs to an external webhook URL when a conversation ends.

Payload Example:

{
  "conversationId": "<CONVERSATION_ID>",
  "chatbotId": "<YOUR_CHATBOT_ID>",
  "chatbotName": "<CHATBOT_NAME>",
  "chatbotSlug": "<CHATBOT_SLUG>",
  "conversationData": {
    "messages": [
      {
        "id": "<MESSAGE_ID>",
        "role": "user",
        "content": "User message text here",
        "createdAt": "2024-01-01T00:00:00.000Z"
      },
      {
        "id": "<MESSAGE_ID>",
        "role": "assistant",
        "content": "Assistant response here",
        "createdAt": "2024-01-01T00:00:01.000Z"
      }
    ],
    "startedAt": "2024-01-01T00:00:00.000Z",
    "completedAt": "2024-01-01T00:05:00.000Z",
    "messageCount": 10
  },
  "userInfo": {...},
  "customSessionContext": {...},
  "timestamp": "2024-01-01T00:05:00.000Z"
}

Email Notifications

Receive email alerts when new conversations are created with your chatbot.

Rate Limiting

Enforce maximum conversation limits within specified time intervals (requires upgrade):

  • Set maximum conversations allowed
  • Choose time interval: per minute, per hour, or per day

Custom Session Context

Pass contextual information about users directly from your website to the chatbot, enabling personalized conversations without requiring users to repeat information.

How to Set Up:

  1. Toggle "Enable custom session context" to ON
  2. Define context keys by adding custom fields:
    • Label: Human-readable name (e.g., "Customer ID", "Account Type")
    • Generated Key: Automatically created from the label in kebab-case format (e.g., "customer-id", "account-type")

How It Works:

When enabled, you can pass information from your website to the chatbot using the generated keys. The AI will naturally use this information in conversations without explicitly mentioning where it came from.

Example:

If you define these context keys:

  • Label: "Customer Name" → Key: customer-name
  • Label: "Subscription Plan" → Key: subscription-plan

The chatbot will know the customer's name and plan, allowing for personalized responses like "Let me help you with your Premium plan features" without the user having to introduce themselves.

See the Custom Session Context Guide for detailed implementation instructions on how to pass this data from your website.

Deploying & Sharing

After configuring, you can publish and share your chatbot with:

Shareable Link: Copy your public chatbot URL for easy sharing

Embed Code: Get iframe code to embed your chatbot in any website

Chat Bubble Widget: Add an interactive chat bubble to your site with customizable behavior:

  • Show initial message bubble when minimized
  • Start minimized or expanded by default
  • Available in HTML and Next.js formats

View Conversation Logs

Monitor your chatbot's performance through the logs section:

  • View complete chat histories
  • Access collected user information
  • See custom session context data for each conversation

Frequently Asked Questions

Is there a way to save progress in a chatbot conversation and come back?

Yes, progress saving is built into the chatbot system. When a user starts a chatbot conversation, a unique identifier called "chatbot conversation ID" is generated and appears in the URL as ccid. The URL would look something like this: https://[YOUR_CHATBOT_URL]?ccid=[CONVERSATION_ID]. Users can save or bookmark this specific URL to return to it later and continue their conversation from where they left off. You can also utilize webhooks to save the conversation ID somewhere for your users, allowing them to access their conversation history through your own system.