Mottle Enables Building Knowledge-Driven Chatbots from FAQ Documents
Mottle offers a platform for creating knowledge-driven chatbots by uploading structured FAQ documents. After setting up your bot with a Google, Microsoft, or GitHub account, you train the bot using text files with specific formatting requirements. The platform provides tools for testing, debugging, and publishing your bot, with options for direct website embedding or API integration in multiple programming languages.
To create a new bot in Mottle, users must log in through their Google, Microsoft, or GitHub account. This initial action creates a blank bot named "MottleBot."
The setup process for the bot includes several key customizations:
The bot's personality is defined as "You are a helpful bot helping customers build their first chatbot."
The sticky context should explain that "Mottle is a website that allows people to create their own chatbots by simply uploading their own documents."
A failure message can be set to "I'm not sure about that. Maybe try contacting support?"
For training the bot, users upload a text file containing frequently asked questions (FAQs). The document format requires using the special token ==//== on a new line to separate content into distinct "chunks" or "snippets." This structure helps the software extract the most relevant information when responding to queries.
After uploading the training data, users can immediately begin testing their bot's functionality through the Test Your Bot page. The system allows submission of various sample queries to evaluate the bot's performance, such as "How can I make a bot," "What are the limits of a bot?" and "Can you make my bot for me?" The bot's responses are displayed alongside the underlying training snippets used to generate each answer, allowing for quick iterative improvements.
To publish the bot, users navigate to the Publish / API page where they have two primary integration options. They can embed the bot directly onto a website, or use the provided API documentation to integrate with other applications. The platform supports both text-based conversations and email interactions through the API, though email functionality requires explicitly enabling the "Email mode" parameter.
The platform offers a flexible pricing model starting at $19.95 per month with a 60-day money-back guarantee. For advanced users, Mottle supports custom integration with OpenAI through a dedicated API key, though all documents are ultimately processed through OpenAI's embedding and completion services. All user data, including training snippets and query logs, is securely stored on Google Cloud and Pinecone servers, with OpenAI guaranteeing no training data reuse and retention of query data for only 30 days.
The training data for Mottle chatbots consists of text files formatted specifically for the platform. These files should contain Frequently Asked Questions (FAQs) grouped into distinct sections using a special token format. Each piece of content intended for training must be separated by the ==//== token placed on a new line.
For example, consider the following simplified snippet format:
==//== How can I make a bot? ==//== Mottle is designed to help users create their own chatbots by uploading their own documents. ==//== What are the limits of a bot? ==//== While Mottle can create powerful chatbots, they are limited by the information provided in the training data. ==//== Can you make my bot for me? ==//== Unfortunately, Mottle requires users to upload their own documents to create a bot.
Users can include multiple types of content within their training files, including but not limited to policy documents, terms and conditions, privacy policies, and case studies. However, for basic operation, only the FAQ page content is strictly necessary.
The preparation process for these training files should account for the character limit imposed by Mottle - approximately 1,800 characters per snippet. This constraint means each distinct piece of content included in the training file must be concise yet comprehensive enough to provide valuable context for the bot's responses.
After uploading the training data, users access the Test Your Bot page to begin evaluation. The interface displays a text box for entering queries alongside a section displaying the bot's responses. Users can input a wide range of sample questions to test the bot's understanding and accuracy, such as "How can I make a bot," "What are the limits of a bot?" and "Can you make my bot for me?"
The testing process also allows users to evaluate the bot's handling of edge cases and nuanced queries. Sample testing questions might include:
"What is the maximum size of a bot?"
"How does the bot handle multiple simultaneous users?"
"Can the bot integrate with external systems?"
As users test the bot, they receive real-time feedback on its performance. The Debug Answers screen shows each query entered along with the specific snippets of training data the bot used to generate its response. This transparency allows users to quickly identify areas for improvement.
For example, if the bot provides an incomplete answer, users can review which snippets were used and adjust the training data accordingly. If the response contains errors or inaccuracies, users can modify the relevant snippets and re-upload the file to refine the bot's knowledge base.
To publish the bot, users proceed to the Publish / API page. Here they have two primary integration options: embedding the bot directly on a website or integrating with other applications via the provided API. The platform supports both text-based conversations and email interactions through the API, though email functionality requires explicitly enabling the "Email mode" parameter.
The API documentation offers comprehensive support for developers, providing code examples in three programming languages. For JavaScript, the process involves setting up a request using the "request" library:
const request = require("request")
const BOT_ID = "YOUR_BOT_ID"
const BOT_SECRET = "YOUR_BOT_SECRET"
const question = "What is your name?"
const url = <code>https://api.mottle.com/connect?bot=${BOT_ID}</code>
const headers = { "Content-Type": "application/json" }
const data = { secret: BOT_SECRET, question: question }
request.post({ url, headers, json: data }, (err, response, body) => {
if (err) {
<pre><code>console.error(err)
</code></pre>
} else {
<pre><code>if (body.error) {
console.log(body.error)
} else {
console.log(body.answer)
}
</code></pre>
}
})
Similarly, Python developers can interact with the API using the requests library:
BOT_ID = "YOUR_BOT_ID"
BOT_SECRET = "YOUR_BOT_SECRET"
question = "What is your name?"
url = f"https://api.mottle.com/connect?bot={BOT_ID}"
headers = {"Content-Type": "application/json"}
data = {"secret": BOT_SECRET, "question": question}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
response_json = response.json()
if "error" in response_json:
<pre><code>print(response_json["error"])
</code></pre>
else:
<pre><code>print(response_json["answer"])
</code></pre>
else:
print("Request failed.")
For those working with command-line tools, Curl provides a straightforward option:
curl -X POST "https://api.mottle.com/connect?bot={YOUR_BOT_ID}" \
-H 'Content-Type: application/json' \
-d '{"secret": "{YOUR_BOT_SECRET}", "question": "What is your name?"}'
The API documentation also highlights two distinct modes of interaction. The default mode processes text-based queries, while enabling "Email mode" requires appending "&mode=email" to the "Connect" API URL. This flexible approach allows businesses to choose the most suitable deployment method for their specific use case.
For more advanced integration scenarios, Mottle offers a comprehensive API that can be accessed from multiple programming environments. The API documentation provides detailed instructions and examples for working with the platform's chatbot services.
API requests follow a straightforward format, requiring four key pieces of information: the bot ID, bot secret, question to ask, and optional mode parameter. The bot ID uniquely identifies each chatbot instance, while the bot secret provides authentication to ensure secure communication.
Developers can integrate with Mottle using several popular programming languages and tools. The platform supports JavaScript via the "request" library, Python with the "requests" module, and command-line interfaces through Curl. Below are examples demonstrating how to use each approach to interact with a Mottle bot.
In JavaScript, developers can make API calls as follows:
const request = require("request")
const BOT_ID = "YOUR_BOT_ID"
const BOT_SECRET = "YOUR_BOT_SECRET"
const question = "What is your name?"
const url = <code>https://api.mottle.com/connect?bot=${BOT_ID}</code>
const headers = { "Content-Type": "application/json" }
const data = { secret: BOT_SECRET, question: question }
request.post({ url, headers, json: data }, (err, response, body) => {
if (err) {
<pre><code>console.error(err)
</code></pre>
} else {
<pre><code>if (body.error) {
console.log(body.error)
} else {
console.log(body.answer)
}
</code></pre>
}
})
Python developers can achieve similar functionality with:
BOT_ID = "YOUR_BOT_ID"
BOT_SECRET = "YOUR_BOT_SECRET"
question = "What is your name?"
url = f"https://api.mottle.com/connect?bot={BOT_ID}"
headers = {"Content-Type": "application/json"}
data = {"secret": BOT_SECRET, "question": question}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
response_json = response.json()
if "error" in response_json:
<pre><code>print(response_json["error"])
</code></pre>
else:
<pre><code>print(response_json["answer"])
</code></pre>
else:
print("Request failed.")
Command-line users can interact with Mottle using Curl:
curl -X POST "https://api.mottle.com/connect?bot={YOUR_BOT_ID}" \
-H 'Content-Type: application/json' \
-d '{"secret": "{YOUR_BOT_SECRET}", "question": "What is your name?"}'
The API provides flexibility in processing modes. The standard mode handles text-based interactions, while enabling email functionality requires appending &mode=email to the API URL. This allows businesses to choose the most appropriate deployment configuration for their specific use cases.