Docs
Complete Guide to AI Chatbot Setup

Complete Guide to AI Chatbot Setup

Learn how to configure your AI chatbot with custom styling, knowledge base documents, web scraping, and embed it on your website

The AI Chatbot is one of the most powerful features of ai4shops.com. It can answer customer questions 24/7 using your own knowledge base, product information, and website content. This guide covers everything from basic setup to advanced configuration.

Prerequisites: Make sure you have created a project before starting this guide.


What Can the AI Chatbot Do?

Your AI chatbot can:

  • Answer FAQs - Respond to common customer questions automatically
  • Provide Product Information - Help customers find what they're looking for
  • Capture Leads - Collect contact information from interested visitors
  • Offer 24/7 Support - Never miss a customer inquiry, even outside business hours
  • Use Your Knowledge Base - Train on your documents, PDFs, and website content

AI Model Configuration

The AI Model settings control how your chatbot thinks and responds.

Step 1: Navigate to Chatbot Settings

From your project dashboard, click "Chatbot" in the sidebar, then select "AI Model" or "Settings".

Screenshot: AI Model settings page

File: /_static/guides/ai-chatbot/ai-model-settings-en.png

Step 2: Select Your Model

Choose the AI model that powers your chatbot:

ModelBest ForCost
GPT-4.1Complex queries, nuanced responsesHigher
GPT-4.1 MiniBalanced performance and costMedium

Tip: Start with GPT-4.1 Mini for most use cases. Upgrade to GPT-4.1 if you need more sophisticated responses.

Step 3: Configure Max Tokens

Max Tokens limits how long responses can be:

  • Lower values (500-1000): Shorter, more concise answers
  • Higher values (2000-4000): Longer, more detailed responses

Recommended: Start with 1500 tokens and adjust based on your needs.

Step 4: Write Your System Prompt

The System Prompt tells the AI how to behave. This is crucial for getting good responses!

Example system prompt:

You are a helpful customer service assistant for [Your Company Name].
You help customers with questions about our products and services.

Key information:
- Our business hours are 9 AM - 5 PM EST
- Shipping takes 3-5 business days
- Returns are accepted within 30 days

Always be friendly, professional, and helpful. If you don't know something,
suggest the customer contact support@yourcompany.com.

Important: A well-written system prompt dramatically improves chatbot quality. Be specific about your business, products, and how you want the AI to respond.

Step 5: Save Your Settings

Click "Save" to apply your AI model configuration.


Appearance & Styling

Customize your chatbot widget to match your website's design.

Step 1: Open Appearance Settings

Navigate to Chatbot → Appearance or "Styling" in your project dashboard.

Screenshot: Appearance settings with color pickers

File: /_static/guides/ai-chatbot/appearance-settings-en.png

Step 2: Configure Colors

SettingDescription
Background ColorMain widget background
Border ColorWidget border/outline
User Message ColorBackground of user's messages
Assistant Message ColorBackground of AI responses
Text ColorPrimary text color
Accent ColorButtons and highlights

Add your company logo for brand recognition:

  1. Click "Upload Logo"
  2. Select an image (PNG, JPG, or SVG)
  3. Maximum file size: 500KB

Tip: Use a square logo with transparent background for best results.

Step 4: Enable Glass-Morphism (Optional)

For a modern, translucent look, enable the Glass-Morphism Effect. This adds a subtle blur and transparency to the widget.

Step 5: Preview Your Changes

Use the live preview panel to see how your chatbot will look before saving.

Screenshot: Live preview panel

File: /_static/guides/ai-chatbot/chatbot-preview-en.png


RAG Documents (Knowledge Base)

RAG (Retrieval-Augmented Generation) allows your chatbot to answer questions using your own documents. Upload PDFs, Word documents, spreadsheets, and more!

Video Placeholder: RAG Document Upload Walkthrough

Duration: 1-2 minutes | How to upload and manage knowledge base documents

Supported File Formats

FormatExtensionBest For
PDF.pdfProduct catalogs, manuals, policies
Word.docxFAQs, documentation
Excel.xlsxProduct lists, pricing tables
Markdown.mdTechnical documentation
Text.txtSimple content, notes

Uploading Documents

Step 1: Navigate to Documents

Go to Chatbot → Documents or "Knowledge Base" in your dashboard.

Screenshot: Documents upload interface

File: /_static/guides/ai-chatbot/documents-upload-en.png

Step 2: Upload Your Files

  1. Click "Upload Documents" or drag and drop files
  2. Select one or multiple files
  3. Wait for upload and processing

Step 3: Wait for Processing

Documents are automatically:

  • Extracted - Text is pulled from the file
  • Chunked - Split into smaller searchable segments
  • Indexed - Made searchable for the AI

Processing time depends on file size (typically 10-60 seconds).

Screenshot: Documents table with processing status

File: /_static/guides/ai-chatbot/documents-table-en.png

Step 4: Manage Documents

From the documents table you can:

  • View - See document details and extracted content
  • Delete - Remove documents from the knowledge base
  • Re-process - Re-extract content if needed

Once documents are processed, your chatbot can immediately use them to answer questions!


Web Scraping

Don't want to upload files manually? Use web scraping to automatically pull content from your website!

Video Placeholder: Web Scraping Setup

Duration: 2-3 minutes | Single URL scraping, sitemap processing, and auto-scraping

Single URL Scraping

Scrape content from individual pages:

Step 1: Navigate to Web Scraping

Go to Chatbot → Web Scraping or "Scrape Website".

Screenshot: Single URL scraping interface

File: /_static/guides/ai-chatbot/single-url-scraping-en.png

Step 2: Enter the URL

Paste the full URL of the page you want to scrape:

https://yourwebsite.com/about-us

Step 3: Click Scrape

Click "Scrape" or "Extract Content". The system will:

  • Fetch the page
  • Extract text content
  • Remove navigation, ads, and irrelevant elements
  • Add to your knowledge base

Step 4: Review Extracted Content

Preview the extracted content to ensure it looks correct before adding it to your knowledge base.

Sitemap Batch Processing

Scrape multiple pages at once using your sitemap:

Step 1: Enter Sitemap URL

Paste your sitemap URL:

https://yourwebsite.com/sitemap.xml

Screenshot: Sitemap analyzer

File: /_static/guides/ai-chatbot/sitemap-analyzer-en.png

Step 2: Analyze Sitemap

Click "Analyze" to see all URLs in your sitemap. You'll see:

  • Total number of pages
  • URL list preview
  • Estimated processing time

Step 3: Set Limits (Optional)

To avoid processing too many pages:

  • Set a maximum number of pages
  • Filter by URL pattern (e.g., only /products/ pages)

Step 4: Start Batch Processing

Click "Start Processing" to begin scraping all selected URLs. Progress is shown in real-time.

Note: Large sitemaps may take several minutes to process. You can safely navigate away - processing continues in the background.

Auto-Scraping Schedule

Keep your knowledge base updated automatically:

Step 1: Configure Schedule

Navigate to Web Scraping → Schedule or "Auto-Scrape".

Screenshot: Schedule settings

File: /_static/guides/ai-chatbot/auto-scrape-schedule-en.png

Step 2: Set Frequency

Choose how often to re-scrape your sitemap:

FrequencyBest For
DailyFrequently updated content (news, blog)
WeeklyRegular updates (products, prices)
MonthlyStable content (about pages, policies)

Step 3: Enter Sitemap URL

Provide your sitemap URL for automatic scraping.

Step 4: Enable Auto-Scraping

Toggle "Enable Auto-Scraping" to activate the schedule.


Security: Allowed Origins (CORS)

Protect your chatbot from unauthorized use by configuring allowed origins.

Screenshot: Allowed origins configuration

File: /_static/guides/ai-chatbot/allowed-origins-en.png

What Are Allowed Origins?

Allowed origins specify which websites can embed your chatbot. This prevents others from using your chatbot on their sites.

Adding Your Domain

  1. Go to Project Settings → Security or "Allowed Origins"
  2. Add your website domains:
https://yourwebsite.com
https://www.yourwebsite.com

Important: Include both www and non-www versions if you use both. Also add staging/development domains if needed.


Widget Embedding

Now for the exciting part - adding the chatbot to your website!

Video Placeholder: Widget Embedding Demo

Duration: 1-2 minutes | How to embed the chatbot on your website

The easiest way to add the chatbot:

Step 1: Get Your Embed Code

Navigate to Chatbot → Embed or "Integration".

Screenshot: Embed code page with both options

File: /_static/guides/ai-chatbot/embed-code-en.png

Step 2: Copy the Script Tag

Your embed code looks like this:

<script
  src="https://ai4shops.com/embed/chatbot.js"
  data-project-id="your-project-id"
  data-position="bottom-right"
></script>

Step 3: Add to Your Website

Paste the script tag just before the closing </body> tag in your HTML:

<!DOCTYPE html>
<html>
<head>
  <title>Your Website</title>
</head>
<body>
  <!-- Your website content -->
 
  <!-- ai4shops.com Chatbot -->
  <script
    src="https://ai4shops.com/embed/chatbot.js"
    data-project-id="your-project-id"
    data-position="bottom-right"
  ></script>
</body>
</html>

Platform-Specific Instructions

WordPress: Use a plugin like "Insert Headers and Footers" or add to your theme's footer.php

Shopify: Go to Online Store → Themes → Edit Code → theme.liquid, paste before </body>

Wix/Squarespace: Use the "Custom Code" or "Code Injection" feature in settings

Method 2: IFrame (Alternative)

For more control over placement, use an iframe:

<iframe
  src="https://ai4shops.com/embed/chatbot/your-project-id"
  width="400"
  height="600"
  frameborder="0"
></iframe>

When to use iframe:

  • You want to embed the chatbot in a specific location (not floating)
  • You need full control over dimensions
  • You're building a custom interface

Testing Your Chatbot

Before going live, test your chatbot thoroughly!

In-Dashboard Testing

Step 1: Open Live Preview

In your chatbot settings, look for "Preview" or "Test" button.

Screenshot: Live preview panel in dashboard

File: /_static/guides/ai-chatbot/live-preview-en.png

Step 2: Send Test Messages

Try various questions:

  • Questions from your knowledge base
  • General inquiries
  • Edge cases and unusual questions

Step 3: Review Responses

Check that responses are:

  • Accurate and helpful
  • Using your knowledge base correctly
  • Following your system prompt guidelines

On-Site Testing

After embedding:

  1. Visit your website
  2. Click the chatbot widget
  3. Test conversations
  4. Check mobile responsiveness

Your AI chatbot is now ready to help your customers 24/7!


Troubleshooting

Chatbot Not Appearing

  1. Check that the script is correctly placed before </body>
  2. Verify your domain is in Allowed Origins
  3. Check browser console for errors

Poor Quality Responses

  1. Improve your system prompt with more specific instructions
  2. Add more documents to your knowledge base
  3. Consider upgrading to GPT-4.1 model

Documents Not Processing

  1. Check file format is supported
  2. Ensure file isn't password-protected
  3. Try re-uploading the document

What's Next?

Create beautiful popups and combine with your chatbot

View

Form Builder

Build forms for lead capture integrated with chat

View