# Amazon Kendra

Managed Connection - Amazon Kendra

Amazon Kendra (<https://aws.amazon.com/kendra/>) is a highly accurate and easy to use enterprise search service that is powered by machine learning. Kendra delivers powerful natural language search capabilities. It is also a fully managed Amazon Service.

Please follow the link below to learn more and get started with Amazon Kendra <https://www.youtube.com/watch?v=ow5DFGICHoI>

### Configuration on Amazon Kendra console

(1) Create Index

An index provides search results for documents and frequently asked questions (FAQ) that it has indexed. An index can contain documents that are indexed from a data source, documents that are added directly to the index, and FAQs.

(2) Create Data Source

A data source is a location, such as an Amazon Simple Storage Service (Amazon S3) bucket, where you store the documents for indexing. Data sources can be automatically synchronized with an Amazon Kendra index so that new, updated, or deleted documents in the source repositories are included in searches. Supported data sources are:

* Amazon S3 buckets
* Amazon RDS for MySQL and Amazon RDS for PostgreSQL databases
* Microsoft OneDrive for Business
* Microsoft SharePoint Online
* Salesforce sites
* ServiceNow instances

Supported document formats are plain text, Microsoft Word, Microsoft PowerPoint, HTML, and PDF

### iX Hello

iX Hello platform allows for the rapid integration of Amazon Kendra to various voice channels such as, Alexa, Lex, Google Assistant and more.

To Configure Amazon Kendra, browse to: **Integration** > **Connect System** and press **Connection Gallery**&#x20;

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FgsnZBUTPCRGGavzmFODO%2FconnectionGallery.png?alt=media&#x26;token=1d40cfc2-12a0-4959-8659-689f566d816b" alt=""><figcaption></figcaption></figure>

Scroll down to Amazon Kendra and press **Connect**.

<div align="left"><figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FHu1EFeCDzZBXCEnKxWyG%2FamazonKendra.png?alt=media&#x26;token=92c3edcf-b496-49dc-a34d-c26e956f8196" alt="" width="168"><figcaption></figcaption></figure></div>

The Amazon Kendra Instance Configuration Screen opens. Enter the **Name** for the service, **Consumer Key (Secret Access Key)**, **AWS Region**, and **Consumer Secret (Secret Access Key).** You can get your required AWS Credentials from the AWS IAM console. Visit [Video: How to get Amazon (AWS) Key and Secret](https://aws.amazon.com/premiumsupport/knowledge-center/create-access-key/) Make sure the AWS account has the required permissions to access Amazon Kendra. When finished, press **Validate and Save Settings.**

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FZNKKFk1ekzTd6kmPMvzK%2FKendraConfigurations.png?alt=media&#x26;token=879dbebe-2ab7-418c-aa5e-9408c822ca9a" alt=""><figcaption></figcaption></figure>

Once you have saved settings you need to create a new Custom App. Browse to: **Apps** > **Custom Apps** and press **New Custom App**.&#x20;

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2Fu7iiLzabm4RdJmfBe6Tn%2FNewcustomApp3.png?alt=media&#x26;token=ddd53647-ac4d-4857-bfd9-c0234147e8b1" alt=""><figcaption></figcaption></figure>

Add the details and press **Save**

<div align="left"><figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FH3wZS0Xv6VmpYxLiU4dZ%2FNewCustomAppKendra.png?alt=media&#x26;token=fb41e433-7f6a-4d36-a06e-a59e1a45e65a" alt="" width="375"><figcaption></figcaption></figure></div>

The new App will appear under the Apps > Custom Apps page. Click on the App Name to open it.

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FscZfognxZkddj2UUIswQ%2FnewKendraApp.png?alt=media&#x26;token=7ae3d164-c5b7-4138-a199-320e9a08a20b" alt=""><figcaption></figcaption></figure>

Create a data source by navigating to the Data Sources tab and press **Create New Data Source**. Now you can create methods for the Kendra.

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FHq06azW8VF9PjBUlmohB%2FKendraNewDataSourcs.png?alt=media&#x26;token=b80f2cb0-7d78-4f4c-9986-47ba9fdf67ef" alt=""><figcaption></figcaption></figure>

As of the publication date of this document, iX Hello supports following Amazon Kendra methods,

1. ListIndices
2. Query

### Method: ListIndices

Parameters: Not required

It returns a list of indexes that are already created in Amazon Kendra.

Below is a sample response format – You should get response like this.

```
[
   {
      "CreatedAt": number,
      "Edition": "string",
      "Id": "string",
      "Name": "string",
      "Status": "string",
      "UpdatedAt":number
   }
]
```

### Method: Query

Parameters:

| Parameter  | Sample Value                         | Info                                                    |
| ---------- | ------------------------------------ | ------------------------------------------------------- |
| IndexId    | 5D5C08F0-98B1-443F-8E9E-A1F67D551514 | You can select from dropdown list of available indexes. |
| Query Text | *Any search text*                    | This is the query that you want to search.              |

Response: Below is a response syntax and you should get response like this. In sample shown below, “string”, number etc. should be replaced by the actual value returned by Kendra.

```
{
   "FacetResults": [
   {
      "DocumentAttributeKey": "string",
      "DocumentAttributeValueCountPairs": [
      {
         "Count": number,
         "DocumentAttributeValue": {
              "DateValue": number,
              "LongValue": number,
              "StringListValue": [ "string" ],
              "StringValue": "string"
         }
      }
      ]
   }
   ],
   "QueryId": "string",
   "ResultItems": [
   {
      "AdditionalAttributes": [
      {
      "Key": "string",
      "Value": {
         "TextWithHighlightsValue": {
         "Highlights": [
         {
            "BeginOffset": number,
            "EndOffset": number,
            "TopAnswer": boolean
         }
         ],
         "Text": "string"
      }
   },
   "ValueType": "string"
   }
   ],
   "DocumentAttributes": [
   {
      "Key": "string",
      "Value": {
         "DateValue": number,
         "LongValue": number,
         "StringListValue": [ "string" ],
         "StringValue": "string"
      }
   }
   ],
   "DocumentExcerpt": {
      "Highlights": [
      {
         "BeginOffset": number,
         "EndOffset": number,
         "TopAnswer": boolean
      }
      ],
      "Text": "string"
   },
   "DocumentId": "string",
   "DocumentTitle": {
      "Highlights": [
      {
         "BeginOffset": number,
         "EndOffset": number,
         "TopAnswer": boolean
      }
      ],
      "Text": "string"
   },
      "DocumentURI": "string",
      "Id": "string",
      "Type": "string"
   }
   ],
   "TotalNumberOfResults": number
}
```
