Skip to content

MirrorFly/White-Label-AI-Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This README provides a comprehensive guide to building and integrating a custom AI Chat Agent using the MirrorFly AI-RAG platform.


MirrorFly AI Chat Agent Integration

Build and integrate fully customizable AI Chat agents for the web using the MirrorFly AI-RAG dashboard and SDK. This solution supports real-time audio streaming, external knowledge base training (RAG), and a no-code workflow builder.

🚀 Overview

The implementation is divided into two primary phases:

  1. Agent Creation: Configuring the agent's personality, training it with datasets, and designing conversational flows in the MirrorFly dashboard.

  2. Agent Integration: Embedding the agent into your web application using the MirrorFly AI SDK.


🛠 Part I: Agent Creation

1. Initial Setup

  • Access: Obtain developer credentials from the MirrorFly team and log into the MirrorFly AI Dashboard. MirrorFly Dashboard

  • Create Agent: Click 'Create Agents' and select 'Chat Agent'.

MirrorFly Dashboard

  • Configuration: Provide an agent name, description, and define the initial System Prompt to set core behavior.

MirrorFly Dashboard

2. Personality & Model Settings

  • Personality: Set the welcome message, fallback responses, and adjust the formality and tone.

  • Model Selection: Choose from multiple available AI models to power your agent.

MirrorFly Dashboard

3. Training with RAG (Retrieval-Augmented Generation)

  • Datasets: Upload knowledge bases in PDF or CSV format (Max 5MB/10 files) to provide the agent with specific domain knowledge.

  • Website Sync: Alternatively, sync information directly from a URL to keep the agent updated with your website content.

MirrorFly Dashboard

4. Workflow Builder

Use the visual drag-and-drop canvas to define:

  • Conversational paths and decision logic.

  • API calls and form collection.

  • Email triggers and message nodes.


💻 Part II: Agent Integration

Prerequisites

  • Valid Agent ID from the dashboard.

  • Website must run on HTTPS for microphone access.

  • Supported Browsers: Latest versions of Chrome, Edge, and Safari.

1. Install the SDK

2. Initialize the Agent

Define a container element and initialize the SDK:

// HTML Container
<div className="content" id="chatbot-root"></div>

// Initialization
    const script = document.createElement("script");
    script.src =
      "./build/chatbot_sdk.js?key=GY4GKNDGMM4GMNZXHBRTEOJRG43DQNZWGE3TANQ=&apiUrl=https://ragqa-chat.contus.us/rag-api";
    script.async = true;

    script.onload = () => {
      if (window.MirrorFlyAi) {
        // Initialize SDK once into a single shared container
        window.MirrorFlyAi.init({
          container: "#chatbot-root",
          ...getSdkOptions(),
        });
      }
    };
    document.body.appendChild(script);

4. Dynamic Agent Switching

If your platform uses multiple agents (e.g., Sales vs. Support), use the following to switch contexts:

function switchAgent(newAgentId) {
  MirrorFlyAi.destroy();
  document.querySelector("#widget").innerHTML = "";
  MirrorFlyAi.init({
    container: "#widget",
    agentId: newAgentId,
    triggerStartCall: true
  });
}

🛡 Security & Permissions

The browser will prompt the user for microphone permission upon initialization. Ensure you handle potential errors via the onError callback, such as permission denials or network issues.

🤹 Key Product Offerings

☁️ Deployment Models - Self-hosted and Cloud

MirrorFly offers full freedom with the hosting options:

Self-hosted: Deploy your client on your own data centers, private cloud or third-party servers.
Check out our multi-tenant cloud hosting

Cloud: Host your client on MirrorFly’s multi-tenant cloud servers.
Check out our multi-tenant cloud hosting

📚 Learn More

🧑‍💻 Hire Experts

Need a tech team to build your AI Chat agents and chatbots? Hire a full team of experts. Let our team handle every step of the development process. Get a high-quality, fully-built Ai agents ready to launch, carefully built by industry experts

⏱️ Round-the-clock Support

If you’d like to take help when working with our solution, feel free to contact our experts who will be available to help you anytime of the day or night.

💼 Become a Part of our amazing team

We're always on the lookout for talented developers, support specialists, and product managers. Visit our careers page to explore current opportunities.

🗞️ Get the Latest Updates

Releases

No releases published

Packages

 
 
 

Contributors