[Intum Help](https://intum.com/help.md) / [Helpdesk](https://intum.com/help/helpdesk.md)

# [Configuring AI for User Support](https://intum.com/help/helpdesk/configuring-ai-for-user-support.md)

## What Is AI in Helpdesk

The AI module in Helpdesk allows automatically answering customer questions before they reach the support team. The system uses a vector database (RAG) to find relevant information and generates responses using an AI model.

## How to Enable AI on a Desk

1. Go to edit the [desk](desk) (`/helpdesk/desks/:id/edit`)
2. Switch to the **AI** tab
3. Check **AI enabled**
4. Select a **Vector database** — if you don't have one, the system will automatically create a new one after saving
5. Optionally select an **AI Connector** — the model used for generating responses (if not selected, the system will use the connector from the vector database)
6. Optionally enter a **System prompt** — instructions for AI on how to answer questions
7. Set the **AI Timeout** — maximum wait time for a response (default 15 seconds). After exceeding this time, the inquiry will be sent normally
8. Save

> **Note:** If no embedding connector is configured in the system, a warning will appear. An embedding connector is required for the vector database to work — configure it in the [Noe AI](../noe-ai/ustawienia) module.

## Automatic Vector Database Creation

When you enable AI on a desk but don't select a vector database, the system automatically:
- Creates a new vector database named "Helpdesk: [desk name]"
- Assigns the first available embedding connector to it
- Links it to the desk
- **Adds desk tickets as the default data source** — so you can immediately index historical inquiries

## NoeAI Sources — Managing Data in the Vector Database

NoeAI Sources is a mechanism for managing data that goes into the AI vector database. It lets you control what information AI uses to generate responses.

### Accessing Source Management

To access source management:
- On the desk details page, click the **NoeAI Sources** button (visible when AI is enabled)
- Or go directly to `/helpdesk/desks/:id/noeai_settings`

### Source Types

You can connect the following source types to the AI vector database:

- **Knowledge bases** — entries from KB knowledge bases (public, non-draft)
- **Email mailboxes** — emails from mailboxes (last 500)
- **Chat widgets** — messages from chats
- **Helpdesk desks** — tickets from desks (last 500)

Add sources in the desk edit view (**AI** tab) — selecting the appropriate knowledge bases, mailboxes, widgets, and desks.

### Managing Individual Sources

After clicking **Manage** next to a source, you go to the management page where you can:

- **Index all** — launches an indexing job for all elements from the source to the vector database
- **Delete all** — removes indexed entries of this source from the vector database
- See statistics: how many indexed / how many to index
- Browse the list of all source elements with links to original entries

### Source Settings

Each source has two settings:

- **Automatic indexing of new data** — when enabled, new elements added to the source will be automatically indexed
- **Index from date** — allows limiting indexing to elements created from a given date. Useful when you don't want to index old, outdated data

### Excluding and Overriding Entries

For each source element you can:

- **Exclude** — marks the element as excluded. It will be skipped during re-indexing. Exclusion is reversible — you can restore default settings
- **Edit content** — allows overriding the content that goes into the vector database. Original data in the source is unchanged, but AI will receive your corrected version. Useful when you want to fix or supplement something
- **Restore default** — removes exclusion or override, element returns to normal mode

Exclusions and overrides are persistent — they survive clearing and re-indexing the vector database.

## Configuring AI in Categories

Each [category](kategorie) can have its own **AI Instruction** — an additional prompt that is appended to the desk's system prompt when the customer selects that category.

This allows AI to respond differently depending on the inquiry topic:
- "Invoices" category → instructions about billing procedures
- "Technical Errors" category → instructions about problem diagnostics
- "General" category → no additional instructions

To add an AI instruction to a category:
1. Edit the category (`/helpdesk/categories/:id/edit`)
2. Fill in the **AI Instruction** field
3. Save

## System Prompt

The system prompt contains instructions describing how AI should behave. Hierarchy:

1. **Desk prompt** — main instructions
2. **Category instruction** — appended to the desk prompt (optional)
3. **Default prompt** — if you don't set any, the system will use a generic prompt

Prompt example:
```
You are a technical support assistant for XYZ company.
Answer in the customer's language, concisely and factually.
If you don't know the answer, inform the customer.
Don't make up information — use only the provided context.
```

## Context Passed to AI

With each query, AI receives:
- **Inquiry content** (title + description)
- **Category** selected by the customer
- **Priority** of the inquiry
- **Context from the vector database** — best matching fragments from the RAG database

## Dashboard and Statistics

On the desk details page in the AI tab, statistics are visible:
- **Questions** — total number of AI queries
- **Helpful** — responses rated positively by customers
- **Not helpful** — responses rated negatively
- **No answer** — queries AI couldn't find an answer for
- **Timeouts** — queries that exceeded the time limit

Detailed AI logs are available at `/helpdesk/ai_logs`.