Skip to main content
Skip table of contents

AI Knowledge Base Reader: Functionality and Operation

The AI Knowledge Base Reader searches for data within a data set with predefined accuracy.

Properties

Operation

Defines the operation executed by the adapter.

Possible values:

  • AI-Semantic-Search searches for data within a data set with predefined accuracy.

Parameters

Adapter

Main adapter class (do not change!)

Possible values:

de.softproject.integration.nativeadapter.NativeAdapter: Main class (Default)

Repository

The virtual repository of the adapter project.

Possible values:

12c0441f-fa3618e7-9b53-4926-baf9 (Default)

protocol

Used protocol (HTTP oder HTTPS)

Possible values:

  • http: Use HTTP (no encryption) (Default)

  • https: Use HTTPS (SSL-encrypted)

host

Name of AI gateway host

Possible values: Any valid character string without protocol specification (e.g. localhost)

port

Number of AI gateway port

Possible values:

Any integer (e.g. 9999)

accessToken

Is required to establish a Keycloak connection.

Possible values: unique access token

The access token needs to be generated in Keycloak.

datasets

List of data records used for the response, comma-separated.

Possible values:

Any character string for existing data records in the system, comma-separated.

Example:

x4.documentation.ver7-3-1,x4.documentation.ver7-2-3

chunkLimit

(optional)

Specifies the maximum number of matching data chunks to be included in the output. If chunkLimit is set to e.g. 5, the output can contain up to 5 matching chunks.

Possible values:

  • Integer

  • 4 (Default)

scoreThreshold

(optional)

A numerical value between 0 and 1 (with the exception of 0 and 1) that specifies the maximum score threshold for the selection of matching chunks. Lower values correspond to higher accuracy.

Possible values:

  • Decimal number between 0 and 1

  • 0.5 (Default)

Status values

1 (successful)

The operation was executed successfully.

0

The operation was executed successfully, but without result.

-1 (failed)

The operation failed due to a technical error.

Input

The adapter expects an XML document with the following structure as input:

CODE
<?xml version="1.0" encoding="UTF-8"?>
<x4ai_adapter>​
	<query>Tell me something about Don Quixote</query>
</x4ai_adapter>

The following elements are included in the input:

Element

Description

x4ai_adapter

Enclosing element for the AI-Semantic-Search operation.

query

Searched sentence for which metadata is displayed in the output.

Output

The adapter generates a XML document as output:

CODE
<output>
  <documents>
    <document>
      <content>matching document chunk</content>
      <metadata>
        <id>uuid</id>
        <source>document name</source>
        <page>page</page>
        <source_url>url</source_url>
        <version>document version</version>
        <similarity_score>number between (0; 1)</similarity_score>
      </metadata>
    </document>
    <document>
      <content></content>
      <metadata>
        <id></id>
        <source></source>
        <page></page>
        <source_url></source_url>
        <version></version>
        <similarity_score></similarity_score>
       </metadata>
     </document>
   </documents>
</output>

The following elements are included in the output:

Element

Description

Output

Enclosing element for the AI-Semantic-Search operation.

documents

Enclosing element for the element document.

documents

Contains information on the document accessed, the content and the metadata.

content

Document contents

metadata

Meta data of document with the elements:

  • id: Document ID

  • source: unique name (sourceKey) of the document

  • page: Document page

  • source_url: Document URL

  • version: Document version

  • similarity_score: Similarity score of answer to the question asked. The lower the value, the better the match with the question.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.