# Amazon Q Data Accessor Integration

### Overview

Karini AI integrates seamlessly with Amazon Q Business, enabling users to leverage the Amazon Q Index to build Agentic RAG applications. With this integration, you can build an agentic application using a variety of knowledgebases such as Amazon Q Index Retriever, Amazon Bedrock Knowledgebases and Karini’s Native Knowledgebase. The setup involves creating agent prompts, integrating them with Amazon Q Accessor Retriever tool, and publishing the final recipe for use in your chat application.

### Prerequisites

* An active AWS account.
* Amazon Q Business application created.
* IAM Identity Center (IDC) configured.
* Access to Karini AI platform.

To initiate the integration, ensure that your Amazon Q Business application is provisioned and configured.

### In the AWS Management Console

Create and configure an Amazon Q Business application by following the official [Amazon Q Business documentation](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/setting-up.html).

After configuring Amazon Q Business, integrate it within Karini AI to enable intelligent agents with secure, context-aware data access.

*Note: Use your External Id from your Karini Organization page as Tenant Id while creating Karini AI Data Accessor in Amazon Q Business*

### In Karini AI

1. **Configure Agent Prompt** :Define the agent’s objective, query input, and execution parameters.
   * Navigate to **Prompt > Add New**.
   * Set the following:
     * **Name** (unique identifier)
     * **Task**: Agent
     * **Max State Updates**: 10 ( 3 default)
     * **Prompt**: Instruction defining the agent’s purpose
     * **Agent Input**: Sample query
     * Click **Save.**
   * After saving the prompt, the **Tool** tab will appear.&#x20;

<figure><img src="/files/IqKTZmBsrHpJtRWrNl3V" alt=""><figcaption></figcaption></figure>

2. **Add Amazon Q Accessor Retriever Tool**: Add the Amazon Q Accessor Retriever tool within the agent prompt.
   * In the **Tool Configuration** tab, set:
     * **Name**: Provide a unique identifier for the tool configuration.
     * **Description**: Add a brief summary that outlines the tool’s purpose and how it supports the agent's behavior.
     * **Tool Type**: Select **Amazon Q Accessor Retriever**.
     * **Application ID**: Enter the Amazon Q Business Application ID associated with your deployment.
     * **Retriever ID**: Enter the unique Amazon Q Business retriever ID.
     * **Application Region**: Specify the AWS region where the Amazon Q Business application is hosted.
     * **IDC Application ARN**: Provide the ARN for the IAM Identity Center (IDC) client integrated with Amazon Q Business.
     * **IDC Region**: Enter the AWS region where the IAM Identity Center is configured.
     * **Max Results**: Set the maximum number of results to be retrieved per query.
     * **Save** the configuration.
3. **Test and Publish:** Validate the agent’s performance across models and publish the optimal configuration.
   * Navigate to **Test and Compare**.
   * Evaluate responses across models.
   * Select the best-performing answer.
   * **Save** and **Publish** the prompt. &#x20;

{% hint style="info" %}
Note: Currently you will be unable to establish a connection to the Amazon Q Business application via prompt playground.
{% endhint %}

2. **Create Recipe**: Design the conversational workflow by linking agent logic with interaction nodes.
   * Go to **Recipes > Add New**.
   * Set **Runtime: Agent 2.0.**
   * Enter **Name** and **Description**.
   * Add and connect the following nodes:
     * **Chat Node** (enable Citations and Follow-up Questions)
     * **Start Node**
     * **Agent Node** (select published prompt)
     * **End Node**

* Click **Save**, then **Publish.**

&#x20;Refer to the [Karini AI Recipe Documentation](https://karini-ai.gitbook.io/karini-ai-documentation/recipes) for detailed flow guidance.

<figure><img src="/files/CyBYspeWFG4W8eDMwgsK" alt=""><figcaption></figcaption></figure>

5. **Export and Integrate with Copilot( Chat Assistant)**
   * Export the recipe for Copilot integration. Refer to the[ Export Recipe](https://app.gitbook.com/o/tlujIankJrglU1kO6KjI/s/7ZrVuiAUMyuYVvrK5KaB/~/changes/178/recipes/qna-recipe/export-recipe) documentation for interface design details.
   * Navigate to **Copilot.**
   * Click **Authorize Amazon Q Index button.**
     * The action redirects your **AWS OIDC Provider via AWS Console**.&#x20;

<figure><img src="/files/smvbIo9EC7KsT0gtbGE9" alt=""><figcaption></figcaption></figure>

Upon successful authentication, c**opilot** is fully configured to retrieve data from **Amazon Q Business** . Users can submit queries related to Amazon Q Business data, and Copilot will efficiently process the requests and return relevant results. Additionally, the system displays detailed source information, ensuring transparency and context for each response.&#x20;

Refer to detailed set up walkthrough in the following video.

{% embed url="<https://youtu.be/l7a111f0U2g>" %}

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://karini-ai.gitbook.io/karini-ai-documentation/amazon-q-data-accessor-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
