# Data source

This tab allows you to <mark style="color:purple;">define your assistant's learning data sources</mark>.

Data sources can be of two types:

* **Internet ("Web DataSource")**: Allows you to add a web link as a data source.
* **File/Document ("File DataSource")**: Allows you to add a file or document as a data source.

## **Web DataSource**

### Add a Web DataSource

To add a web data source, click the "**Add Web Data Source**" button.

In the next window, enter the name of this data source and the desired URL, then click "**Save**":

<figure><img src="https://160715368-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRFCbypPSQCx2ezWjFUPY%2Fuploads%2FGKZ6ig90rSWQFRNbi2OS%2Fimage.png?alt=media&#x26;token=40cb436c-cad0-4c8e-98b1-d9a639357afc" alt="" width="341"><figcaption></figcaption></figure>

Once this step is completed, CogNeed starts extracting and indexing data from your web source and displays the following element:

<figure><img src="https://160715368-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRFCbypPSQCx2ezWjFUPY%2Fuploads%2Fn42WtnoqfUjnbf9m9XnF%2Fimage.png?alt=media&#x26;token=4fdd6503-175e-4080-8bee-2726cdf4d981" alt="" width="563"><figcaption></figcaption></figure>

Once extraction and indexing are complete, CogNeed indicates that the data source is synchronized and displays the synchronization date. From then on, your assistant uses this data source as a reference for writing their responses.

{% hint style="warning" %}
Your data source is indexed based on the version of the extracted website as of the displayed synchronization date. If your website is updated, you can click the "Sync" button to restart extraction and indexing.
{% endhint %}

### Modify a **Web DataSource**

To edit your data source, click the pencil icon in the top right corner of your data source. The following options will appear:

* Edit the data source name
* Add/delete/edit URLs contained in this data source
* Define URL pattern whitelists and backlists

<figure><img src="https://160715368-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRFCbypPSQCx2ezWjFUPY%2Fuploads%2FCd44RDHvEln7RYMldPmJ%2Fimage.png?alt=media&#x26;token=55672898-f49e-4c38-baec-6c1c5e9aaa0a" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
The option to define URL pattern whitelists and backlists allows you to:

* **Whitelist**: Define, within a website, the only section to keep in the data source. <https://www.cogneed.ai/en/latest-news>
* **Blacklist**: Define, within a website, sections to remove from the data source. <https://www.cogneed.ai/en/latest-news>
  {% endhint %}

## **File DataSource**

### Add a **File DataSource**

To add a document/file type data source, click the "**Upload a Document**" button

<figure><img src="https://160715368-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRFCbypPSQCx2ezWjFUPY%2Fuploads%2Feklb9Q2WDEnB8xIihYcv%2Fimage.png?alt=media&#x26;token=6f583219-f7aa-4851-984c-950195ce43b4" alt="" width="458"><figcaption></figcaption></figure>

Click to navigate in your file explorer or drag and drop a file into the blue area. Verify that the addition is what you intended and click "**Save**."

<figure><img src="https://160715368-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRFCbypPSQCx2ezWjFUPY%2Fuploads%2Fov5tzKFs6yf5arRoNjf8%2Fimage.png?alt=media&#x26;token=8f082fff-62dd-40bd-a4e1-36b944c36fc6" alt="" width="458"><figcaption></figcaption></figure>

Add as many documents as you like and click the "Synchronise" button to start extraction and indexing.\\

The display will show "In Progress" until these steps are complete. Once extraction and indexing are complete, CogNeed will indicate that the data source is synchronised and display the synchronisation date. From then on, your assistant will use this data source as a reference when writing their answers.

{% hint style="warning" %}
Your data source is indexed based on the version of the extracted document/file as of the displayed synchronisation date. If your document/file is updated, upload it again and click the "**Synchronise**" button to restart extraction and indexing.
{% endhint %}

### Modify a **File DataSource**

Once you have added documents to your document/file data source, an exploration table of the added items appears.

A search bar allows you to sort the added elements, and in the table, line by line, you will find buttons to delete <img src="https://160715368-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRFCbypPSQCx2ezWjFUPY%2Fuploads%2F82RdEKL2lEHYyMQZk6K9%2Fimage.png?alt=media&#x26;token=e1b1381f-dcc6-4127-b2e3-1176a889e164" alt="" data-size="line"> or view these elements in your browser <img src="https://160715368-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRFCbypPSQCx2ezWjFUPY%2Fuploads%2F9cPdvjxRUxaTKAKbjEVe%2Fimage.png?alt=media&#x26;token=9fb68d98-a4c1-4ab4-890c-b0270070adc1" alt="" data-size="line">.
