Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

...

Configuration settings (technical)

General parameters

Parameter

Description

languageModel: string

Specifies the language model used

Default: AZURE_GPT_35_TURBO_0613

searchType: string

Defines the type of search to be performed (VECTOR or COMBINED)

Default: COMBINED

maxTokens: number

Maximum number of tokens used by sources and previous conversation in the LLM call

scopeIds: [string]

Optional scope identifiers to limit the search

scopeToChatOnUpload: boolean

Indicates if the scope should be limited to the current chat upon upload

Default: false → Scope restriction off

chunkedSources: boolean

Indicates if chunks of the same document are appended as individual sources (true) to the LLM content or merged to one source (false)
We recommend setting this parameter to true for GPT-4 and false for GPT-3.5.

Default: false

historyIncluded: boolean

Flag that allows to include previous chat conversation in GPT-calls only if the new user input is a follow-up question (false)

Default: true → History always included

keyWordExtractionTemperature: number

Temperature setting for keyword extraction

Default: 0

evaluationConfig: object

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:

Code Block
"evaluationConfig": {
    "displayName": "Hallucination-Level",
    "metricConfigs": [
      {
        "name": "hallucination",
        "enabled": true,
        "scoreToEmoji": {
          "LOW": "🟢",
          "HIGH": "🔴",
          "MEDIUM": "🟡"
        },
        "languageModel": "AZURE_GPT_4_0613"
      }
    ]
  }

chunkRelevancySort: object

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.

Code Block
  "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

Note

Only adjust prompts if you are fully familiar with the code logic. Small changes can break the module or reduce the output quality.

...