# Advanced Knowledge Base: AI Settings

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

Tiledesk's AI settings provide powerful tools for fine-tuning the behavior and performance of your AI agent. These settings include the maximum number of tokens, temperature, chunks, system context, and prompt. This tutorial will explain each of these settings and how they impact your Knowledge Base.

#### Access AI Settings <a href="#access-ai-settings" id="access-ai-settings"></a>

* Once logged in, select the **Knowledge Base** section (brain icon) from the left-hand menu.
* Choose to either **create a new Knowledge Base** or use the **default one**.
* Click the **gear icon** to access and configure the **AI settings**.

<figure><img src="/files/6hpZSmHUBGuxRz59W5qr" alt=""><figcaption></figcaption></figure>

### AI Settings Explained <a href="#ai-settings-explained" id="ai-settings-explained"></a>

#### **1. AI Models**

You can choose the following AI models from the drop-down menu: GPT-4.1, GPT-4.1 mini, GPT-4.1 nano, GPT-4o, GPT-4o Mini and etc. As you can see from the picture below, each model consumes a different amount of tokens.

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

#### **Differences Among OpenAI Models**

* **GPT-4.1**\
  **Definition:** The latest generation in the GPT-4 family, offering the highest level of language understanding and text generation. Best suited for complex scenarios where accuracy and context are critical.\
  **Token consumption:** Higher cost per token, but delivers top performance.
* **GPT-4.1 Mini**\
  **Definition:** A lighter, faster variant of GPT-4.1. It provides solid language capabilities at a much lower cost, making it perfect for frequent interactions or less complex tasks.\
  **Token consumption:** Significantly lower, focused on efficiency and affordability.
* **GPT-4.1 Nano**\
  **Definition:** The most lightweight model in the GPT-4.1 series. Designed for simple tasks, quick replies, or when running costs must be kept minimal.\
  **Token consumption:** The lowest among all models, offering maximum efficiency with limited capabilities.
* **GPT-4o** \
  **Definition**: A specialized version of GPT-4, optimized for certain tasks or industries, offering targeted performance improvements. \
  Token Consumption: Typically higher than GPT-4 Turbo but lower than standard GPT-4, due to specific optimizations.
* **GPT-4o Mini** \
  Definition: A smaller, more efficient variant of GPT-4o, designed for applications requiring less computational power while still benefiting from targeted optimizations. Token \
  Consumption: Lower cost per token compared to GPT-4o, aimed at providing a balance between performance and resource usage.

| Model           | Definition                                                                      | Token Consumption                                                                   |
| --------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| GPT-4.1         | Latest generation of the GPT-4 family, with the highest accuracy and reasoning. | Higher cost, best performance                                                       |
| GPT-4.1 Mini    | Lightweight and efficient GPT-4.1 variant, solid language skills at lower cost. | Much lower cost than GPT-4.1, great for frequent interactions                       |
| GPT-4.1 Nano    | Ultra-light model for simple tasks and minimal costs.                           | Lowest cost, designed for maximum efficiency                                        |
| **GPT-4o**      | Specialized version of GPT-4 for targeted tasks                                 | Very high cost (second only to GPT-4 legacy), best for rich multimodal applications |
| **GPT-4o Mini** | Smaller, efficient variant of GPT-4o                                            | Much lower cost than GPT-4o, good balance between performance and efficiency        |

#### **2. Maximum Number of Tokens**

* **Definition**: Tokens are the pieces of words that the AI uses to process and generate responses. The maximum number of tokens setting controls the length of the responses.
* **Impact**: A higher token limit allows for longer, more detailed responses. A lower limit restricts the length, making responses shorter and potentially more concise.
* **How to Configure**:
  1. Locate the **Maximum Number of Tokens** setting in the AI Settings.
  2. Enter the desired number of tokens, up to a maximum of 9999 (e.g., 100, 200, 500).

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

#### **3. Temperature**

* **Definition**: Temperature controls the randomness of the AI's responses. A **lower** temperature makes the responses **more deterministic and focused**, while a higher temperature makes them more creative and varied.
* **Impact**: Adjusting the temperature helps balance between consistency and creativity in responses.
* **How to Configure**:
  1. Locate the **Temperature** setting.
  2. Set the temperature value (e.g., 0.2 for more focused responses, 0.8 for more creative responses).

#### **4. Chunks**

* **Definition**: Chunks are portions of content that the AI uses to create responses. Breaking content into chunks helps the AI process information more efficiently.
* **Impact**: Proper chunking ensures the AI can handle large documents or datasets without performance issues.
* **How to Configure**:
  1. Locate the **Chunks** setting.
  2. Define the size of the chunks, from 1 to 10.

#### **5. System Context**

* **Definition**: System context provides the AI with background information or guidelines that influence its behavior and responses. It sets the overall tone and direction for the AI.
* **Impact**: A well-defined system context helps the AI understand its role and the type of responses it should generate.
* **How to Configure**:
  1. Locate the **System Context** setting.
  2. Enter the context information, such as "You are a helpful customer support assistant."

#### **6. Advanced context**

[Learn more here](https://guide.tiledesk.com/ai-chatbots-and-automation/actions-explained/ask-knowledge-base#advanced-context)

#### 7. Get contents sources

Use this option to get accurate sources of documents used to generate the reply. Keep in mind that this consumes more tokens then regular KB retrieving.

#### 8. HyDE (Hypothetical Document Embeddings)

**Definition:** HyDE is an advanced retrieval technique. Instead of searching your Knowledge Base directly with the user's question, Tiledesk first asks the AI to generate a *hypothetical* answer to that question, and then uses the embedding of that hypothetical answer to look up the most relevant chunks in your Knowledge Base. The intuition is that a written answer is semantically closer to the documents stored in your KB than a short, often ambiguous user query.

**Impact**: Enabling HyDE typically improves the relevance of the retrieved content, especially for short, vague, or keyword-poor questions, which results in more accurate and on-topic answers. The trade-off is **higher token consumption**, because every user message triggers an additional LLM call to generate the hypothetical answer before the actual retrieval and response steps.

#### 9. Use Cache

**Definition**: When **Use Cache** is enabled, Tiledesk stores the AI's response for each unique question. The next time a user asks the same (or a very similar) question, the cached answer is returned immediately, without running the full retrieval and generation pipeline again.

**Impact**: Cached responses are returned much faster and **do not consume additional tokens**, which reduces both latency and operating costs. This is especially valuable on high-traffic chatbots where the same questions are asked repeatedly. On the other hand, if you have just updated the Knowledge Base content, cached answers may not reflect those changes until the cache entry is refreshed. While the cache is enabled, the response is delivered as a single block, so the streaming preview is not available.

#### **AI Agent Fine-tuning & Prompt**

Now that you've set your AI preferences, you can go even further and start drafting your prompt within the Flow. Please note that every AI Agent you create can have **different** AI settings if you so prefer.

* **Definition**: The prompt is the initial instruction provided to the AI, guiding it on how to generate responses based on user input.
* **Impact**: The prompt shapes the AI's initial understanding and response generation.
* **How to Configure**:
  1. Go to the Design Studio, and locate the **Prompt** field within any AI action (e.g. [Ask Knowledge Base](/ai-chatbots-and-automation/actions-explained/ask-knowledge-base.md),  [AI Assistant](/chatgpt-hacks/create-an-ai-assistant-in-openai.md)).
  2. Enter a clear and concise prompt, based on what you'd like to achieve with a specific AI agent, as below.

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

#### Configuring AI Settings - Recap <a href="#configuring-ai-settings-recap" id="configuring-ai-settings-recap"></a>

1. **Access AI Settings**: Go to the gears icon for the **AI Settings** under the **Knowledge Bases** tab.
2. **Adjust Maximum Number of Tokens**: Set the desired token limit based on the complexity and length of responses you need.
3. **Set Temperature**: Choose a temperature value that balances creativity and consistency.
4. **Define Chunks**: Determine the appropriate chunk size to optimize performance.
5. **Input System Context**: Provide relevant background information or guidelines to shape the AI's behavior.

Bear in mind, whilst these are overall AI settings, you can still configure each AI agent's settings within the Design Studio according to your specific needs

#### Best Practices <a href="#best-practices" id="best-practices"></a>

* **Experiment with Settings**: Adjust the settings incrementally and test the responses to find the optimal configuration for your use case.
* **Monitor Performance**: Regularly review the AI's performance and make adjustments as needed to maintain the quality of responses.
* **Keep Context Relevant**: Ensure that the system context and prompt are relevant to the specific Knowledge Base and user interactions.

#### Conclusion <a href="#conclusion" id="conclusion"></a>

Configuring the AI settings for your Knowledge Base on Tiledesk allows you to fine-tune the AI agent's behavior and response quality. By understanding and adjusting the maximum number of tokens, temperature, chunks, system context, and prompt, you can enhance the effectiveness and efficiency of your AI Agent.

Have any feedback for us? Send it to <info@tiledesk.com>&#x20;


---

# 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://guide.tiledesk.com/ai-chatbots-and-automation/knowledge-base/advanced-knowledge-base-ai-settings.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.
