# Knowledge

Knowledge AI (KAI) is a solution that extracts and generates context-sensitive answers from sources uploaded to the platform.

It improves the understanding of user queries by leveraging multiple content sources. This enables the AI Agent to deliver more contextualized and accurate responses.

The solution transforms how information is stored, retrieved, and used by applying **Retrieval-Augmented Generation (RAG)**, bridging AI capabilities with structured content.

{% hint style="info" %}
**Important:** When enabling Knowledge, the terms of a third-party service apply. Enabling this feature implies agreement to share the information contained in the sources with the Generative AI model provider connected to the platform.
{% endhint %}

### Key components

The architecture is built on **two key components** that work together to provide intelligent information retrieval:

#### Collections

Intuitive, topic-based repositories for Sources.

This grouping system optimizes training performance, improves response accuracy through intelligent filtering, and enables Knowledge base scaling without compromising quality or speed.

Each [**Collection** ](/user-guide/ai-agents/knowledge/collections.md)can be individually customized with advanced search settings to ensure maximum relevance.

Together, these capabilities create a robust Knowledge management system that supports the AI Agent in delivering more accurate, contextual, and valuable responses to users.

#### Sources

Upload different types of [**Sources**](/user-guide/ai-agents/knowledge/sources.md), including PDF and TXT files.

These Sources become information repositories that the AI Agent can use to answer user queries.

{% hint style="info" %}
**Sources** refers specifically to the documents and content uploaded in the **Knowledge** section.
{% endhint %}

### **How it works**

#### For NLU Flows Governance

* Finds answers to user questions in Sources or in Questions added to the Knowledge section;&#x20;
* Has a QnA functionality by registering pairs of questions and answers. Those are brief and accurate;
* Operates as a secondary cognitive engine, independent from the main Knowledge base. In NLU flows, Knowledge works as a Fallback and can be triggered before routing to an unexpected flow;
* Is multilanguage;
* Can read images containing text, but not graphic-only images.

<details>

<summary>How image reading works (OCR)</summary>

OCR stands for **Optical Character Recognition.** It is an AI model designed to identify text characters in images.\
**It can read images containing text but does not interpret graphic images.**

Applying OCR prevents the loss of relevant information contained in images within PDF files. This ensures that all textual content is used, even when presented as an image.

#### When is OCR used in Knowledge AI?

OCR is used during the training in the following scenarios:

* **TXT:** OCR is not applied because these files contain only plain text;
* **PDF:** All pages of the PDF are converted into images. The image resolution is then enhanced, and the content is processed by the OCR model to extract text.

</details>

When a user interacts with a Virtual Agent, the system follows a **hierarchical decision model** to ensure the most precise and structured response possible.

The hierarchy works as follows:

1. Search for an Intent that starts a flow;
2. If no match is found, search for an Intent with a direct answer (FAQ flow);
3. If there is still no match, search a source in Knowledge AI (this feature must be enabled; otherwise, the system moves to the next step);
4. If none of the above applies, route the interaction to a Not Expected flow.

<figure><img src="/files/2luHwkazke5IiN9uHh15" alt=""><figcaption><p>Layered Knowledge base in Syntphony CAI</p></figcaption></figure>

#### For Agentics Governance

* One or more Collections can be linked to AI Agents;
* AI Agents use the content from these Collections to generate responses for users;
* Collections should be linked according to the use case managed by the AI Agent;
* There is no limit to the number of Collections that can be linked to a AI Agent. However, excessive linking is not recommended, as it may increase the risk of response conflicts and hallucinations;
* Collections must be trained before they can be linked to AI Agents;
* Within the AI Agent flow, there is a Knowledge branch. This branch groups all Collections associated with the AI Agent. It also allows sequential cells to be added when additional handling is required, such as applying a specific response template.

### Enabling the feature

To activate this feature:

1. Go to [**Advanced Resources**](/user-guide/configurations/advanced-resources.md)**;**
2. Find the corresponding feature card;
3. Toggle the switch to enable it.

{% hint style="info" %}
**Important:** Enabling this feature may result in additional costs for each new request.
{% endhint %}

The following sections explain how to:

* Create and manage **Collections;**
* Configure **Sources.**

These steps help you maximize the effectiveness of this feature within your Knowledge architecture.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.conversational-ai.syntphony.com/user-guide/ai-agents/knowledge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
