# 4. Training Your AI Bot

#### Why Train Your Bot?

The AI bot uses a Knowledge Base to answer questions. Without training, it will use generic responses. With training, it can answer questions specific to your project, product, or service.

#### There are 2 ways to do it

#### 1. Upload Documentation Files

Upload Word documents, PDFs, or text files: /learn-from-doc

Supported file types: max 1mb per training

* Word documents (.docx)
* PDF files (.pdf)
* Text files (.txt)
* Markdown files (.md)

{% hint style="info" %}
The text in the document should be in the TITLE, CONTEXT, TAGS (optional) and CONTINUED PROMPT (optional) form for the bot to process the information correctly&#x20;
{% endhint %}

#### 2. Add knowledge manually

Add FAQs, guides, or instructions manually: /learn-form

contains:

* Title
* Context
* Tags (optional)
* Continue Response (optional)

{% hint style="info" %}
Only fill the "continue response" section if there is something the team want to collect to solve the issue off discord i.e something to be fixed by backend team.

Entries with "continue response" added will ping the admin role added through /add ping-role \<role> after the user has responded to the AI initial response
{% endhint %}

{% file src="/files/5HGvzzDyBQHoqHUYNjGa" %}

> an example of how your document should be structured

#### Best Practices for Training

{% hint style="info" %}

DO:

* Add comprehensive documentation
* Use descriptive tags (e.g., "account,login,password")
* Include FAQs for common questions
* Add troubleshooting guides
* Update documentation regularly

DON'T:

* Add duplicate documents
* Use vague tags
* Add outdated information
* Forget to update when your product changes
  {% endhint %}

#### Step 2: Verify Your Knowledge Base

Search your knowledge base to verify documents were added: /view-base

Modify a selected entry from the knowledge base: /modify-base

Delete your knowledge base: /delete-base


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ansari-labs.gitbook.io/ansari-labs/products/ai-powered-ticket-tool/setup-guide/4.-training-your-ai-bot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
