# AI node - GPT Knowledge Base

> **Who can use this Card?**
>
> * Gallabox Users having permission to either build and deploy bots or manage bots.
> * Available on Pro Plan.

### Overview

The **GPT Knowledge Base** feature lets you customize and use the GPT model for tasks in Gallabox. You can set input variables, choose variables to save history, and adjust settings to fine-tune conversations. This helps in customizing interactions and storing useful information for later.

<figure><img src="/files/LZRqsViqWtNEN6ztzUZ9" alt=""><figcaption></figcaption></figure>

The Node contains the below sections:

1. **Input Variable:** Users can choose or create variables to serve as input for interacting with the GPT model.
2. **Select or Create Variable to Store History:** This allows users to manage the history of interactions by selecting or creating variables. Variable names should adhere to specific guidelines.
3. **Knowledge Base:** Users can select the knowledge base to instruct the GPT model on specific information or context.
4. **Prompt:** Users describe their goal or the context in which they want the GPT-model to provide information. The prompt serves as input to the model.
5. **Max Tokens:** Max Tokens determine the maximum number of [tokens](https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them) that the GPT-model can use in its response.
6. **Temperature:** The temperature setting controls the randomness of the AI responses. A higher value, like 0.8, makes the responses more unpredictable and creative. A lower value, such as 0.2, makes the responses more focused and closely related to the prompt.
7. **Function:** Users define a function by entering a name and description. This function encapsulates the purpose or task the GPT-model is intended to perform.

* **Store the Parameters in the Variable (Optional):** Optionally, users can create or select variables to store the parameters used in the GPT Knowledge Base configuration.
* **Parameter 1:** Users define a specific parameter by providing a name, description (optional), and type (e.g., String).

### Example

To start with the GPT Knowledge Base Node, you have to create a Knowledge Base in your Gallabox Account.

{% hint style="success" %}
The knowledge Base can be either a File Type (Pdf, csv, excel) or Catalog that you connected with your WhatsApp Number on Gallabox.
{% endhint %}

#### Add Knowledge Base

1. Use the Shortcut "Ctrl" + "K" to open the Search in Gallabox. Type **Knowledge Base** and click on it.

<figure><img src="/files/QZDsMuikugUMlcEDiLOU" alt=""><figcaption></figcaption></figure>

2. Click on "**+Create Knowledge Base**" and Name the Knowledge Base.

<figure><img src="/files/QUpHKtHhRaj352EMsYfi" alt=""><figcaption></figcaption></figure>

3. You have to choose the Type whether you would like to upload a file or use already connected catalogue with your WhatsApp Number.&#x20;

* If you choose the Type as **File**, you can upload the pdf or csv or an excel file as the Knowledge Base.&#x20;

<figure><img src="/files/D9z7cp5k8UWfmsehlYif" alt=""><figcaption></figcaption></figure>

* If you choose the Type as **Catalog**, you have to choose the WhatsApp Channel (*if more than one is connected with Gallabox*) and the catalog connected with the Channel. If you have more than one catalog connected with a WhatsApp Channel, you can add those by clicking on "**+Add**".&#x20;

<figure><img src="/files/P0UDWa4Qw27nSZ44ctij" alt=""><figcaption></figcaption></figure>

4. Click on create and your Knowledge Base will be created.&#x20;

<figure><img src="/files/uF8IPgUvBjodhAm5LCIL" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
You can only add 3 Knowledge Base.
{% endhint %}

After adding the Knowledge Base you can use **GPT Knowledge Base** Node in your Bot flow.&#x20;

**Input Variable:** Select or create a variable named "userQuery."

**Select or Create Variable to Store History:** Create a variable named "interactionHistory."

**Knowledge Base:** Select the company's Help Docs as the knowledge base.

**Prompt:** Describe your goal: "Assist users in understanding the troubleshooting steps for network connectivity issues."

**Max Tokens:** Set to 300.

**Temperature:** Set to 0.5 for a balanced response.

**Function:**

* Name: "Network\_Troubleshooting"
* Description: "Generate helpful responses for network connectivity issues provided in the pdf file."

**Store the Parameters in the Variable (Optional):** Create or select a variable named "functionParameters."

**Parameter 1:**

* Name: "Device\_Type"
* Description: "Specify the type of device experiencing issues (optional)."
* Type: "String"


---

# 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://docs.gallabox.com/bots/bot-utilities/ai-node-gpt-knowledge-base.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.
