---
url: >-
  https://docs.corbitaltech.dev/products/ai-assistant-for-whatsmarks-saas/create-ai-assistant.md
description: >-
  Step-by-step guide to create and train your AI Assistant with knowledge base
  files.
---

# How to Create AI Assistant

This guide walks you through the process of creating and training your AI Assistant using uploaded knowledge base files in WhatsMark SaaS.

## Introduction

After configuring AI integration, you can create intelligent AI assistants that use your uploaded documents to provide contextual responses to user queries. The AI Assistant can analyze PDF, DOC, DOCX, TXT, and MD files to build a comprehensive knowledge base.

## Step 1: Access AI Assistant Section

### Navigate to AI Assistant Management

* Log in to your WhatsMark SaaS admin dashboard
* Go to **AI Assistant** in the left sidebar menu
* The list shows all your existing assistants along with **today's usage stats**: total replies, input tokens, and output tokens consumed by each assistant today
* Click **"+ Create New Assistant"** button to start creating your assistant

![AI Assistant Dashboard](Images/2.png)

## Step 2: Configure Assistant Basic Settings

### Create New Personal Assistant Form

Fill out the assistant creation form with the following details:

### Assistant Configuration Parameters

| Field                   | Description                            | Example                                                           | Required |
| ----------------------- | -------------------------------------- | ----------------------------------------------------------------- | -------- |
| **Assistant Name**      | Unique identifier for your assistant   | SmartFlow AI                                                      | ✅ Yes   |
| **Description**         | Brief explanation of assistant purpose | An intelligent virtual assistant designed to streamline workflows | ✅ Yes   |
| **System Instructions** | Behavior and personality guidelines    | You are SmartFlow AI, a proactive and helpful assistant...        | ✅ Yes   |
| **Select Provider**     | AI provider for this assistant         | OpenAI, Gemini                                                    | ✅ Yes   |
| **AI Model**            | OpenAI model selection                 | GPT-4o Mini, GPT-4o, GPT-4.1                                      | ✅ Yes   |

### AI Model Options

**OpenAI Models**

| Model           | Performance | Cost   | Best For                             |
| --------------- | ----------- | ------ | ------------------------------------ |
| **GPT-4o Mini** | Fast        | Low    | Basic queries, quick responses       |
| **GPT-4o**      | Balanced    | Medium | General purpose, most use cases      |
| **GPT-5.4**     | Advanced    | High   | Complex reasoning, detailed analysis |

**Gemini Models** *(v1.1.0+)*

| Model                | Performance | Cost   | Best For                                |
| -------------------- | ----------- | ------ | --------------------------------------- |
| **Gemini 2.5 Flash** | Fast        | Low    | Quick responses, cost-effective tasks   |
| **Gemini 2.5 Pro**   | Advanced    | Medium | Complex reasoning, longer context tasks |

### System Instructions Template

Use this template for professional assistant behavior:

```text
You are [Assistant Name], a proactive and helpful assistant. Always provide clear,
concise, and context-aware responses. Anticipate user needs, suggest relevant
actions, and ensure user interactions are productive and pleasant.
```

## Step 3: Build the Knowledge Base&#x20;

Once your assistant is created, open its **Knowledge** tab to feed it the content it should answer from. The Knowledge tab supports four source types, so you are no longer limited to uploading files — you can also pull in entire websites, individual web pages, and manually written text.

![Knowledge tab overview](Images/knowledge-tab.png)

### Knowledge Source Types

| Source Type   | What It Adds                               | Best For                                              |
| ------------- | ------------------------------------------ | ----------------------------------------------------- |
| **Websites**  | All pages listed in a site's `sitemap.xml` | Ingesting an entire help center or documentation site |
| **URLs**      | A single web page                          | A specific article, policy, or landing page           |
| **Documents** | Uploaded files (PDF, DOC, DOCX, TXT, MD)   | Manuals, guides, internal reports                     |
| **Snippets**  | Short blocks of manually typed text        | FAQs, quick facts, canned answers                     |

Each source you add appears in a list showing its **type**, **title/URL**, and **sync status**. You can open any source to review it, re-sync it, or delete it.

### Source Status

As each source is processed, its status moves through these stages:

| Status         | Meaning                                                        |
| -------------- | -------------------------------------------------------------- |
| **Pending**    | Queued, waiting to be processed                                |
| **Fetching**   | Content is being downloaded (URL/website sources)              |
| **Processing** | Content is being indexed for AI search                         |
| **Completed**  | Source is fully synced and ready to answer from                |
| **Failed**     | Something went wrong — open the source for details and re-sync |

***

### Add a Website (Sitemap)

Use this to ingest many pages at once from a site's `sitemap.xml`.

1. Open the **Knowledge** tab → **Websites** sub-tab
2. Click **Add**
3. Paste the full **Sitemap URL** (for example, `https://example.com/sitemap.xml`)
4. Optionally set a **page limit** (default and maximum: 20 pages)
5. Click **Save**

![Add website / sitemap form](Images/knowledge-add-website.png)

Each page found in the sitemap is fetched and indexed as its own source. Larger sites take longer to finish — monitor the status column as pages move to **Completed**.

::: tip
Only the `sitemap.xml` is read — the assistant does not crawl by following links. Make sure the site exposes a valid sitemap.
:::

***

### Add a Single URL

Use this for one specific page.

1. Open the **Knowledge** tab → **URLs** sub-tab
2. Click **Add**
3. Paste the **page URL**
4. Click **Save**

![Add URL form](Images/knowledge-add-url.png)

The page is fetched, converted to clean text, and indexed for the assistant to answer from.

***

### Upload Documents

The interface provides a drag-and-drop area for uploading knowledge documents:

![Document upload interface](Images/knowledge-add-docs.png)

* **Drag and Drop**: Drag files directly into the upload area
* **Click to Upload**: Click the upload area to browse and select files
* **File Format Support**: PDF, DOC, DOCX, TXT, MD up to 10MB each
* **Multiple Files**: Upload multiple documents at once

#### Supported File Formats

| Format             | Extension   | Max Size | Use Case                 |
| ------------------ | ----------- | -------- | ------------------------ |
| **PDF Documents**  | .pdf        | 10MB     | Manuals, guides, reports |
| **Word Documents** | .doc, .docx | 10MB     | Policies, procedures     |
| **Text Files**     | .txt        | 10MB     | FAQs, simple content     |
| **Markdown Files** | .md         | 10MB     | Technical documentation  |

#### Document Upload Process

1. **Prepare Your Documents**

   * Ensure files contain relevant business information
   * Remove any sensitive or confidential data
   * Organize content logically with clear headings

2. **Upload Files**

   * Click **Upload Knowledge Documents**
   * Select multiple files (up to 10MB each)
   * Wait for upload completion

3. **Document Processing**
   * System automatically extracts text content
   * Documents are indexed for vector search
   * Processing status shows as "Sync Status"

***

### Add Snippets and Articles

When you don't have a file or a URL, type the content directly.

* **Snippets** — a short block of text. Give it a **title** and a **body**. Ideal for FAQs and quick facts.

![Add snippet / article form](Images/knowledge-add-snippet.png)

1. Open the **Knowledge** tab → **Snippets**
2. Click **Add**
3. Fill in the title and body
4. Click **Save**

The text is indexed immediately and becomes available to the assistant once its status shows **Completed**.

***

### Content Types for Knowledge Base

| Content Type              | Purpose                      | Examples                            |
| ------------------------- | ---------------------------- | ----------------------------------- |
| **FAQs**                  | Common questions and answers | Product questions, troubleshooting  |
| **Product Information**   | Detailed descriptions        | Features, specifications, pricing   |
| **Process Documentation** | Step-by-step guides          | Installation, setup procedures      |
| **Company Policies**      | Terms and procedures         | Support policies, return procedures |
| **Contact Information**   | Support channels             | Phone numbers, email addresses      |

::: warning Synchronization Notice
After adding a source, the system processes it through a queue job for AI analysis and indexing. The synchronization time depends on:

* **Content Length**: Sources with more text take longer to process
* **Source Type**: Websites with many pages take longer than a single snippet
* **Queue Load**: Processing time may vary based on system queue

**Expected Processing Time**: 2-10 minutes per document or page

Please wait for the status to show **Completed** (or "Fully Synced" for documents) before testing your AI Assistant. You can monitor progress in the Knowledge tab.
:::

## Step 4: Monitor Assistant Status

### AI Assistant Dashboard - Processing State

![AI Assistant Processing](Images/5.png)

The dashboard shows your assistant with initial processing status:

### Status Indicators

| Status                      | Description                    | Action Required     |
| --------------------------- | ------------------------------ | ------------------- |
| **Sync Status: Processing** | Documents being indexed        | Wait for completion |
| **Sync Status: 100%**       | All documents processed        | Ready for use       |
| **AI Assistant: Ready**     | Assistant created successfully | Can start chatting  |
| **Knowledge Base: Synced**  | Vector store ready             | Fully operational   |

### Assistant Integration Dashboard

Once processing is complete, the dashboard shows:

![AI Assistant Ready](Images/6.png)

| Component           | Purpose                    | Status Indicator            |
| ------------------- | -------------------------- | --------------------------- |
| **Total Documents** | Number of uploaded files   | Shows count                 |
| **Sync Progress**   | Document processing status | Percentage complete         |
| **Overall Status**  | System readiness           | "Fully Synced" when ready   |
| **Assistant ID**    | Unique identifier          | For API integration         |
| **Vector Store**    | Document search system     | Search functionality status |

## Step 5: Test Your AI Assistant

### AI Integration Details

Click on the assistant card to view comprehensive status information:

![Integration Details](Images/7.png)

### Chat Interface Testing

The chat interface provides several testing capabilities:

| Feature                    | Description                | Benefits                    |
| -------------------------- | -------------------------- | --------------------------- |
| **Real-time Messaging**    | Instant responses          | Test conversation flow      |
| **Knowledge Base Sidebar** | Uploaded documents display | Verify document access      |
| **Document Status**        | Sync indicators            | Confirm processing complete |
| **Chat History**           | Complete logs              | Review conversation quality |

![Integration Details](Images/10.png)

### Testing Scenarios

| Test Type             | Example Query                     | Expected Response                |
| --------------------- | --------------------------------- | -------------------------------- |
| **FAQ Questions**     | "What are your business hours?"   | Accurate info from uploaded docs |
| **Product Inquiries** | "Tell me about your premium plan" | Detailed product information     |
| **Process Questions** | "How do I reset my password?"     | Step-by-step instructions        |
| **General Support**   | "I need help with billing"        | Relevant guidance or handoff     |

## Step 6: Integrate with Bot Flows

### Message Bot Integration

![Integration Details](Images/8.png)

To use your AI Assistant in automated conversations:

### Bot Flow Builder Integration

| Component                 | Function            | Configuration             |
| ------------------------- | ------------------- | ------------------------- |
| **Text Message**          | Simple responses    | Basic text replies        |
| **Button Message**        | Interactive options | Quick response buttons    |
| **List Message**          | Menu selections     | Structured choices        |
| **AI Personal Assistant** | Smart responses     | Connect to your assistant |

### Flow Configuration Parameters

| Setting                 | Options                  | Description           |
| ----------------------- | ------------------------ | --------------------- |
| **Contact Type**        | Lead, Customer, Prospect | Target audience       |
| **Trigger Type**        | "on exact match"         | Activation method     |
| **Keywords**            | Custom keywords          | Trigger words/phrases |
| **Assistant Selection** | Your created assistants  | Choose AI to use      |

![Message Bot Integration](Images/9.png)

### Example Bot Flow Setup

1. **Start Trigger**

   * Contact Type: Lead
   * Trigger: "help", "support", "question"

2. **AI Assistant Node**
   * Select: SmartFlow AI
   * Configure response parameters
   * Set fallback options

### Reply Duration&#x20;

When you attach an AI Personal Assistant in either a **Bot Flow** or a **Message Bot**, you can now set a **Reply Duration** — the length of time the AI keeps replying to a particular chat. Once this window passes, the AI automatically stops responding to that conversation and **hands the chat off to a human agent**. You can also choose **Always On**, which lets the AI keep replying indefinitely with no automatic handoff.

![Reply Duration field on the AI Personal Assistant](Images/9.png)

#### How to Configure

1. Add the **AI Personal Assistant** node (Bot Flow) or select the **Personal Assistant** option (Message Bot)
2. Locate the **Reply Duration** field
3. Choose how long the AI should keep replying:
   * Enable **Always On** to let the AI reply indefinitely, **or**
   * Enter a **number** and choose a **unit** (minutes or hours) for a fixed window
4. Save the flow or bot

#### How It Works

| Option        | Description                                                                                |
| ------------- | ------------------------------------------------------------------------------------------ |
| **Always On** | The AI keeps replying to the chat indefinitely. The conversation is never auto-handed off. |
| **Number**    | The amount of time the AI should keep answering this chat (when Always On is off)          |
| **Unit**      | The time unit for that number — **minutes** or **hours**                                   |

* The timer starts when the AI first begins replying to a contact.
* While the duration is active, the AI answers messages from that contact as normal.
* When the duration elapses, the AI **stops replying to that specific chat** and the conversation is handed over to a human agent so support can continue seamlessly.
* With **Always On** enabled, there is no timer — the AI continues to handle the chat until you intervene manually.

::: warning Per-Chat Behaviour
Reply Duration applies **per conversation**. When a fixed window expires, only that contact's chat is handed off — other active chats continue to be served by the AI based on their own timers (or stay active if set to Always On).
:::

## Step 7: AI Reply Controls & Working Hours&#x20;

Beyond Reply Duration, two settings let you control **when** and **how often** the AI responds.

### Out of Knowledge Base Reply Limit

This setting caps how many times the AI will reply to questions that fall **outside** its uploaded knowledge base before it automatically stops responding.

![Out of knowledge base reply limit setting](Images/setting.png)

#### What Counts as "Out of Knowledge Base"

* Any question the AI cannot answer from the uploaded documents
* **General conversational messages** such as "Hi", "Hello", "How are you?", "Thanks", etc.

::: warning Greetings Count Toward the Limit
Generic greetings and small-talk — like "hi", "hello", or "thanks" — are counted as out-of-knowledge-base replies. Account for these when setting your limit so the AI does not stop too early in a conversation.
:::

#### How to Configure

1. Go to **Settings → AI Assistant Settings**
2. Find the **Out of Knowledge Base Reply Limit** field
3. Enter the maximum number of out-of-knowledge-base replies allowed (e.g., `5`)
4. Click **Save Changes**

Once the limit is hit for a contact, the AI stops replying for that conversation, preventing it from consuming tokens on irrelevant or off-topic exchanges indefinitely.

::: tip Setting a Good Limit
A value of **5–10** is a reasonable starting point for most use cases.
:::

### Working Hours AI Control

Inside **Working Days Settings**, two independent switches control when the AI is active:

| Switch                              | Description                                                                          |
| ----------------------------------- | ------------------------------------------------------------------------------------ |
| **Enable AI during working hours**  | When ON, the AI responds to messages received during your configured working hours.  |
| **Enable AI outside working hours** | When ON, the AI responds to messages received outside your configured working hours. |

You can enable one, both, or neither switch depending on your support model.

![Working hours AI enable switches](Images/working-days.png)

#### Common Configurations

| Use Case                                                  | During Working Hours | Outside Working Hours |
| --------------------------------------------------------- | -------------------- | --------------------- |
| AI handles all hours                                      | ON                   | ON                    |
| AI only during business hours (human support after hours) | ON                   | OFF                   |
| AI only after hours (human team handles daytime)          | OFF                  | ON                    |
| AI fully paused                                           | OFF                  | OFF                   |

::: warning Bot Flow Must Match Working Hours
If you trigger the AI through a **Bot Flow**, the bot flow's own working-hours schedule must align with the AI's working-hours setting. For example, if the AI is enabled **only during working hours** but the bot flow runs **outside** working hours, the AI node will **not trigger**. Always keep the two consistent.
:::

## Best Practices

### Content Preparation

| Practice                | Description               | Benefit                 |
| ----------------------- | ------------------------- | ----------------------- |
| **Clear Structure**     | Use headings and sections | Better AI understanding |
| **Current Information** | Regular content updates   | Accurate responses      |
| **Simple Language**     | Avoid jargon              | Improved comprehension  |
| **Specific Examples**   | Include real scenarios    | Better context          |

### Response Quality

| Factor           | Best Practice             | Impact             |
| ---------------- | ------------------------- | ------------------ |
| **Consistency**  | Maintain same tone        | Professional image |
| **Accuracy**     | Verify information        | User trust         |
| **Completeness** | Provide sufficient detail | User satisfaction  |
| **Relevance**    | Address actual question   | Efficiency         |

## Troubleshooting

### Common Issues

| Issue                        | Symptoms           | Solution                    |
| ---------------------------- | ------------------ | --------------------------- |
| **Documents Not Processing** | Sync status stuck  | Check file formats and size |
| **Poor Response Quality**    | Irrelevant answers | Update system instructions  |
| **Assistant Not Responding** | No AI responses    | Verify OpenAI API key       |
| **Knowledge Base Empty**     | No document access | Re-upload and wait for sync |

### Error Messages

| Error                        | Meaning                    | Resolution                 |
| ---------------------------- | -------------------------- | -------------------------- |
| **"Knowledge Base Pending"** | Documents still processing | Wait for completion        |
| **"API Key Invalid"**        | OpenAI key issue           | Check API key in settings  |
| **Model Not Available**      | Selected model unavailable | Choose different model     |
| **Upload Failed**            | File upload error          | Check file size and format |

## Next Steps

Once your AI Assistant is created and tested:

1. **Deploy in Chat Flows** - Integrate with your bot builder
2. **Monitor Performance** - Track user interactions and satisfaction
3. **Continuous Improvement** - Regular updates and optimizations
4. **Scale Usage** - Expand to additional use cases

## Need Help?

For assistance with AI Assistant creation:

* **Email Support:** <contact@corbitaltech.dev>
* **Support Tickets:** [support.corbitaltech.dev](https://support.corbitaltech.dev/)
* **OpenAI Configuration:** Check our [OpenAI Setup Guide](configure.md)
