Large files
Last updated
Last updated
Large Files - a section of the knowledge base that allows the bot to utilize information from a large dataset when forming responses. Currently, there is a file size limit of 10 MB. For a Word document, this is more than 5000 pages in size 12 font.
Unlike the "Direct Questions" section of the knowledge base, which is intended for the most accurate determination of a bot's response to a posed question, the "Large Files" section, conversely, allows the bot to convey the maximum amount of information relevant to the client's request, and the bot itself forms an answer based on this information. Responses will be more unique and different from each other. This mode of working with the knowledge base is suitable for cases when:
There is a large amount of information, and forming "direct questions" from it is either very labor-intensive or impossible;
It is necessary for the bot to use the entire available set of information and form unique, diverse responses. In other words, the communication should be freer and more similar to interacting with a live person;
There is allowance for "freedom" in the bot's responses, and precise formulation of responses is not critical.
The current section of the knowledge base is based on the principles of vector search. More detailed information is available online; here, we will highlight only the key aspects that can be configured and are crucial for correct operation.
Simply put, the procedure for working with the base can be described as follows:
We upload a document, the system breaks it into semantic chunks, stores them in a special format;
A function description is provided to the model, stating that it has access to an additional information source where it can send requests and receive responses;
As needed, the model calls the knowledge base function and sends its query;
The query is converted by the system into a "special" format, the same one in which the semantic chunks of the uploaded document are stored.
The system searches for relevant chunks based on the received query. The search is conducted using a special algorithm, selecting the responses that are semantically closest to the given query.
According to the settings ("search threshold" and "maximum number of relevant chunks"), the found chunks are passed to the model, which forms a response for the client based on them.
Proper Document Segmentation
For the bot to work as efficiently as possible and use the loaded data correctly, we must properly segment the document into semantic units.
A semantic unit (chunk) is the smallest "piece" (or several pieces) of text that will be selected by the bot in response to a client's query, processed, and used to form a relevant response. It is essential to find a balance between an excessively large chunk and a very small one that loses essence and meaning. It's important that the chunk fully conveys the intended idea within the task assigned to the bot. In other words, it is crucial that during the chunk formation, the meaning is not lost, and the context is not broken. Optimal segmentation is considered to be by paragraphs. The system currently allows the following options for chunk segmentation:
Before uploading the document, it is important to check it and segment it correctly into paragraphs. Two consecutive line breaks are used as separators. Therefore, before uploading, the document must be analyzed and correctly prepared for segmentation, considering both semantics (context) and gaps between paragraphs. It's also important to note that the size of a single chunk cannot exceed 2048 characters.
After uploading, the document is automatically segmented into chunks according to the selected mode. The correctness of the segmentation can be checked using the "Show chunks" button:
The full content of the document loaded from the document is available under the "Content" tab.
For support and integrators, more granular settings are available:
Return chunks. Enabling this mode indicates that only the found chunks (text pieces) will be used to form the bot's response. If the switch is turned off, the entire document (whose chunks were found according to the client's request) will be passed to the model for response formation. By default, the switch is on.
Number of chunks. Chunk search occurs according to a specified activation threshold (search precision). Therefore, multiple chunks (or a large number) can be found based on the received query; this parameter determines the maximum number of chunks used to form the response. The most precise options (which are closest to the query) are taken from the entire list satisfying the search result;
Activation threshold. Determines the search threshold. Recommended values:
Strict selection is 0.7;
Medium selection is 0.5;
Flexible selection is 0.3.
The default value is 0.5.
It's important to note that, in the instructions, just like when working with simple questions, you can refer to the function for working with large files. For example: "Get all the information about the product using the function "search_in_knowledge_base"."