# Knowledge Sources

## Adding New Sources

Once you've enabled the feature, go to the Knowledge page. To add a new source to your base:

1. Open your desired collection in the repository. This can be the default collection or a custom collection you've created.
2. Look for the  `New Source`  button at the top right.
3. It will open a modal where you can upload a new source.

{% hint style="info" %}
Just like the cells in the Dialog Manager, you can use tags to label the documents and questions and analyze them with [Tag Funnels](https://docs.conversational-ai.syntphony.com/user-guide/analytics-and-insights/dashboards/funnel-charts).&#x20;
{% endhint %}

#### Supported File Types

* PDF (up to 10MB and 100 pages)
* TXT (up to 500KB)
* Additional supported formats coming soon

<div><figure><img src="https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FoLv4p7Qjc02Mtp087S53%2Fcollection%20add%20source.png?alt=media&#x26;token=19daec43-7a5d-4b52-9271-d89198e7ca3e" alt=""><figcaption><p>Click on the collection you want to add a new source to</p></figcaption></figure> <figure><img src="https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FIfOiSjNcdkP5juTOpx2k%2Fcollection%20new%20source.png?alt=media&#x26;token=d7575c1a-b326-4d64-8ad6-6f89b005a51c" alt=""><figcaption><p>Click the New source button to open the modal</p></figcaption></figure></div>

{% hint style="success" %}

#### Good Practices

Keep your document clear and well structured so the AI can extract accurate information. Use simple formatting and avoid complex layouts that may block text extraction. [See best practices](#formatting-best-practices)
{% endhint %}

### Advanced Settings

This modal presents two parameters:

* **Windows length:** Defines the size of a segment or chunk into which data is divided and retrieved for generating content. A larger window captures more context. &#x20;
* **Overlap:** Sets how much consecutive windows (segments) share content to maintain coherence. Higher overlap improves content continuity and reduces the loss of contextual or transitional information.

After you added the sources, you will see them listed in the repository. On each bar, you can check all questions linked to it, view its content, edit, delete, and disable or enable it.

{% hint style="info" %}
You can add up to 200 total knowledge sources and a maximum of 20 sources per collection.
{% endhint %}

### Edit and View&#x20;

Click the pencil icon to update file, edit name or tags. If you change the file, **we recommend updating the questions linked to the document**. To view the contents of each document, click on its name and the file will open in a new browser tab.

### Enable and Disable&#x20;

You can disable and enable any document by just sliding the switch on the document bar. If disabled the switch shows the "off" ![](https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FPr2IxWdi035SYBSxnSPP%2Fimage.png?alt=media\&token=816da025-972c-4ef7-ac95-2080e551b781) status and the bar changes color. You can still update or delete the document; however, its content won't be included in the active knowledge base, including the Questions attached to it.

To re-enable the content, simply slide the switch back to the "on" <img src="https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FuebUtFyQtNA7l6vCYpPp%2Fimage.png?alt=media&#x26;token=59fbb650-4162-4f4b-aad7-ffa7004ea1aa" alt="" data-size="line"> status.&#x20;

{% hint style="warning" %}
**Important:** When you disable a document, all questions attached to it are also disabled. When you delete a document, all questions attached to it are also deleted.
{% endhint %}

## Questions

Although Knowledge is able to find answers without the need of creating Questions, you can use this resource to improve the system's capability to provide accurate and contextually relevant answers. The extraction of knowledge into questions enhances the agent's ability to match user inquiries with the right information.

<div><figure><img src="https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FDHLpeuPDsQOqxbfsM4vT%2Fcollection_question.png?alt=media&#x26;token=18187970-b7ac-45fa-bea7-0efe38c62913" alt=""><figcaption><p>Questions tab where you can create a new question</p></figcaption></figure> <figure><img src="https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FhXmGeZJ0u6x9Se61FFiH%2Fcollection_question2.png?alt=media&#x26;token=123a05d6-d8b2-4907-b519-e03f51865791" alt=""><figcaption><p>Questions modal to customize the answer</p></figcaption></figure></div>

You can also edit or customize the answers for each channel and to make sure it's up-to-date or consistent with the agent's voice tone, for example. Another use of Questions is to create questions-answers for specific cases **without having to make a new generation request for the LLM model**.

{% hint style="success" %}
You can transfer knowledge sources between collections while keeping associated questions intact. When editing them, you can update files without losing connections to existing questions.&#x20;
{% endhint %}

### Utterance examples&#x20;

Just like in a Intent cell, insert here other ways in which users would request the same subject. For instance, when users want to know about visiting hours in a Hospital, they may ask it in different ways:

> *“Are hospitalized patients entitled to a full-time companion?”*
>
> *“Do inpatients have the right to a full-time companion?”*
>
> *“Can I accompany a hospitalized patient?”* &#x20;

**Add different examples to your Questions to improve inference**

Once you've added the utterances examples, proceed to the next step, where you can fine-tune the content. This process is similar to what you'd do in a regular answer cell, allowing you to incorporate buttons and/or technical text if needed.

After you click `Save` the question-answer pair will be stored in the Questions repository.

{% hint style="info" %}
Remember to always train the agent after creating or deleting a question. It's a different training from the NLP.
{% endhint %}

### Assist Answer

Another great tool to help you save time and improve the quality of your answers. If enabled, the [Assist Answer](https://docs.conversational-ai.syntphony.com/user-guide/generative-ai/assist-answer) feature will show the same options available in the answer cell.

## Request Timeout

It's the amount of time (in seconds) the virtual agent should wait for a response from the generative service. You can set this timeout value between 1 to 10 seconds, with the recommended default being 3 seconds. In case the request exceeds this time limit or times out waiting for OpenAI, the system delivers a Not Expected flow. This parameter can be configured in the Parameters section.

## Formatting Best Practices

Preparing your sources for machine readability is crucial for optimal performance of the Knowledge feature. These guidelines will help you create high-quality, contextually rich documents that enhance retrieval and generation capabilities.

### Key Formatting Recommendations

#### 1. Define a clear structure and levels of content

* Use heading and subheading tags (H1, H2, H3, H4) to organize your content logically.&#x20;

#### 2. Leverage Paragraph Length and Context

Knowledge performs best with comprehensive, context-rich content. Consider these strategies:

* **Combine Short Paragraphs**: Merge brief, disconnected paragraphs about the same subject into more substantive, four-sentence paragraphs.
* **Separate distinct concepts** into different sections instead of embedding multiple ideas in one paragraph.
* **Provide Comprehensive Context**: Longer, well-structured paragraphs enable better inference and understanding.

**Example Transformation:**&#x20;

<table><thead><tr><th width="229.99993896484375">Before</th><th>After</th></tr></thead><tbody><tr><td><ul><li>John is a nice man.</li><li>John lives in New York.</li><li>John likes zucchini.</li></ul></td><td><em>John is a nice man who lives in New York. His lifestyle reflects a diverse culinary interest, particularly evident in his fondness for zucchini. Despite his simple lifestyle, John maintains a warm and approachable personality.</em></td></tr></tbody></table>

#### 2. Restructure List Content

Avoid bulleted lists by converting them into narrative paragraphs:

<table><thead><tr><th width="230">Before</th><th>After</th></tr></thead><tbody><tr><td><ul><li>Passport </li><li>Visa </li><li>Boarding Pass </li><li>Flight Tickets </li><li>Travel Insurance</li></ul></td><td><em>For international travel, travelers must prepare several critical documents. A valid passport serves as the primary identification, complemented by the necessary visa for entry. Additionally, boarding passes and flight tickets are essential for smooth transit, with travel insurance providing an extra layer of protection and peace of mind.</em></td></tr></tbody></table>

#### 3. Handle Large Lists

For extensive lists, consider these approaches:

* Split into multiple, contextual paragraphs
* Create narrative descriptions
* Group items by categories or themes

#### 4. Avoid Complex Formatting

* **Skip Tables and Forms**: Reformat content into flowing paragraphs
* **Remove Irrelevant Elements**: Eliminate headers, footers, addresses, and unnecessary summaries
* **Prioritize Readability**: Focus on clear, concise language

#### 5. FAQ Preparation

When uploading FAQ documents:

* Remove question texts
* Upload only answers
* Ensure answers are comprehensive and self-explanatory

#### Additional Best Practices

* Use clear, concise language
* Maintain consistent formatting
* Provide context and background information
* Anticipate potential user queries
* If possible, use natural, conversational language.

{% hint style="info" %}
Try to think like a user would ask questions and structure your content to directly address potential inquiries. Make adjustments based on curation assessments.
{% endhint %}
