> For the complete documentation index, see [llms.txt](https://cleyrop.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cleyrop.gitbook.io/docs/documentation-fr-en/data-and-ai-project/studio-ai/assistants-ai.md).

# AI Assistants

{% hint style="warning" %}
The creation of new AI Assistants is blocked: they will soon be decommissioned in favor of **Agents**. Use the Tools **Cleyrop Corpus** and **Cleyrop Dataset** in your Agents to find the same uses (querying document corpora and datasets).
{% endhint %}

You can design **AI assistants** based on LLM models to automate tasks, explore data, or interact with your knowledge bases (structured datasets or document corpora).

The assistants can be configured from **predefined templates** and adapted to your needs: data analysis, information search.

***

## Create an AI Assistant

{% hint style="warning" %}
The **resources** (Corpus, Dataset) to be queried must be **created or added to the project** before starting the assistant creation
{% endhint %}

1. Access AI Assistants from the left menu.
2. Click on `+ Create`.
3. Select a **template** from those offered by Cleyrop.
4. Depending on the template, you will be able to choose a **knowledge base** :
   * [*Datasets* ](#assistant-dinterrogation-de-datasets): natural-language querying of structured data.
   * [*Document corpora*](#assistant-dinterrogation-de-corpus) : information search in text documents.
5. **Customize the assistant** : name, description, welcome message, suggested questions.
6. Finalize the configuration:
   * ***Create and test*** : draft mode accessible to the project.
   * ***Publish*** : accessible to all users in the project.

{% hint style="success" %}
The assistants can also be **shared with profiles outside the project** via the “Applications” tab.
{% endhint %}

## Configure the model and the prompt

Each assistant is based on a configurable LLM model.\
The settings can be reset at any time using the Reset button.

* **Model** : list of available LLM models (Llama 3.1, Mistral Small 3.2...)
* **Temperature** : controls the creativity of the responses.
  * Low (≈ 0) → precise and deterministic responses.
  * High → more varied and creative responses.
* **Top p** : adjusts the probability of generated words.
  * Value close to 1 → increased diversity.
  * Low value → focused responses.

#### The prompt

The prompt defines the assistant's behavior.

{% hint style="warning" %}
Never remove **the parameters between { }** (system parameters) or you will make the assistant unusable
{% endhint %}

Replace the values between \[ ] (customizable variables) without modifying the { } (system parameters).

If variables between {} are accidentally deleted, the platform performs an automatic check to prevent any corruption.

## Main features

* **User history** : each user can find their previous conversations with an assistant.

  Temporary files and context are not kept beyond a session.
* **Conversation context** : successive exchanges are taken into account for more relevant responses.

  The New conversation button resets the context.
* **User feedback** : ability to rate responses (👍 / 👎) and leave a comment.

  Feedback helps improve the quality of responses and adjust the models.

## Available templates

### Dataset querying assistant

The Data Analysis assistant lets you query your datasets in natural language.

It automatically generates SQL queries, displays the results in a table, and offers an intuitive graphical visualization.

#### **How it works**

1. Analysis of the user's question.
2. Selection of relevant datasets and columns.
3. Generation and execution of the SQL query.
4. Display of the results as a table and graph (if applicable).

{% hint style="warning" %}
Datasets with **special characters** in column names may break SQL compatibility.
{% endhint %}

#### **Results visualization**

* Automatically suggested chart type (bar, line, pie).
* Customization possible (type, columns, axes).
* Export as PNG/JPEG and full-screen display.

#### **Transformation into a Dataflow**

Generated queries can be transformed into a Dataflow:

* Click Transform into Dataflow, name the Dataflow and the output dataset.
* The transformation is added to the project with the original SQL query.
* The creator becomes the owner of the Dataflow.<br>

***

### Corpus querying assistant

The **Knowledge Manager** allows document corpora to be queried using a RAG (Retrieval-Augmented Generation) approach.

The assistant identifies relevant documents, extracts the most informative passages, and generates a contextualized response.

{% hint style="success" %}
To be able to create an assistant of type **Knowledge Management**, you must first have [**create a Corpus**](/docs/documentation-fr-en/data-and-ai-project/studio-ai/corpus-de-documents.md)
{% endhint %}

#### **How it works**

* Understanding the question.
* Applying metadata filters to narrow the scope.
* Semantic search in the filtered documents.
* Generation of an answer based solely on the extracted content.
* Display of cited sources (text chunks) in the answer.
* Opening PDF documents in a new tab

#### **Metadata filters**

* Based on metadata extracted automatically or enriched manually.
* Automatic merging of identical metadata across corpora.
* Combined logic:
  * OR between values of the same filter.
  * AND between multiple filters.
* Can be modified at any time by the assistant creator.

***

## Best practices

* Create assistants with a **limited scope** for better performance.
* **Specialize your prompts** based on the use case.
* Control the temperature and top p to balance precision and creativity.
* Always test an assistant in draft mode before publishing.
