Document Search V2
Functionality
This module is designed to answer a user query based on documents ingested into the knowledge center. The module will first create a search string from the user question, embed it, and then perform a semantic search or a full-text search in the VectorDB or the PostgreSQL DB. Finally, the module generates an answer for the user input based on retrieved internal knowledge, either referencing this knowledge with appropriate documents or stating that no information was found in the internal system.
Input
A user question related to information within the document database.
Example input:
"What is the guideline saying about travels to Europe?"
Output
An answer based on internal knowledge, either referencing the appropriate documents or stating that no information was found in the internal system.
Configuration settings (technical)
General parameters
Parameter | Description |
---|---|
| Specifies the language model used Default: |
| Defines the type of search to be performed ( Default: |
| Maximum number of tokens used by sources and previous conversation in the LLM call |
| Optional scope identifiers to limit the search |
| Indicates if the scope should be limited to the current chat upon upload Default: |
| Indicates if chunks of the same document are appended as individual sources ( Default: |
| Flag that allows to include previous chat conversation in GPT-calls only if the new user input is a follow-up question ( Default: |
| Temperature setting for keyword extraction Default: |
| Enable the evaluation of the generated assistant’s response for hallucination detection by defining the evaluationConfig object. Note: This feature requires at least GPT-4 and incurs additional token costs. To activate hallucination detection, configure the object as follows: "evaluationConfig": {
"displayName": "Hallucination-Level",
"metricConfigs": [
{
"name": "hallucination",
"enabled": true,
"scoreToEmoji": {
"LOW": "🟢",
"HIGH": "🔴",
"MEDIUM": "🟡"
},
"languageModel": "AZURE_GPT_4_0613"
}
]
} |
| Enable the sorting of retrieved chunks based on their relevance to the user input by defining the chunkRelevancySort object. Note: Activating this feature will incur additional token costs. "chunkRelevancySortConfig": {
"enabled": true,
"relevancy_levels_to_consider": [
"high", "medium", "low"
],
"language_model" : "AZURE_GPT_35_TURBO_0613",
"fallback_language_model" :"AZURE_GPT_35_TURBO"
} |
Prompts
Only adjust prompts if you are fully familiar with the code logic. Small changes can break the module or reduce the output quality.
Parameter | Description |
---|---|
| System and trigger prompt used to interpret user input and form search queries |
| System and trigger prompt used for chat upload scenarios |
| System and trigger prompt used to extract the search string from the user question |
Author | @Fabian Schläpfer |
---|
© 2024 Unique AG. All rights reserved. Privacy Policy – Terms of Service