> 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/v4.7-en/data-and-ai-project/studio-ai/assistants-ai.md).

# AI Assistants

Create, test, and deploy your AI assistants within your project.

{% hint style="warning" %}
The creation of new AI Assistants is blocked: they will soon be decommissioned in favor of the **Agents**. Use the Tools **Cleyrop Corpus** and **Cleyrop Dataset** in your Agents to achieve 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).

Assistants can be configured from **predefined templates** and adapted to your needs: data analysis, information retrieval.

***

## Create an AI Assistant

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

1. Go to 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 can choose a **knowledge base** :
   * [*Datasets* ](#assistant-dinterrogation-de-datasets): natural language querying of structured data.
   * [*Document corpora*](#assistant-dinterrogation-de-corpus) : information retrieval 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 of the project.

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

## Configure the model and prompt

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

* **Model** : list of available LLM models (Llama 3.1, Mistrall Small 3.2...)
* **Temperature** : controls the creativity of 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

* **Per-user history** : each user finds their previous conversations with an assistant.

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

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

  Feedback helps improve response quality and adjust models.

## Available templates

### Dataset querying assistant

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

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

#### **How it works**

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

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

#### **Results visualization**

* Chart type suggested automatically (bar, line, pie).
* Customization possible (type, columns, axes).
* Export in PNG/JPEG format and full-screen display.

#### **Transformation into 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 template **Knowledge Manager** allows querying document corpora via a RAG approach (Retrieval-Augmented Generation).

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 the type **Knowledge Management**, you must first have [**create a Corpus**](/docs/v4.7-en/data-and-ai-project/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 only on the extracted content.
* Display of cited sources (text chunks) in the response.
* Open PDF documents in a new tab

#### **Metadata filters**

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

***

## Best practices

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