> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AWSKendraRetriever integration

> Integrate with the AWSKendraRetriever retriever using LangChain JavaScript.

## Overview

[Amazon Kendra](https://aws.amazon.com/kendra/) is an intelligent search service provided by Amazon Web Services (AWS).
It utilizes advanced natural language processing (NLP) and machine learning algorithms to enable powerful search capabilities across various data sources within an organization.
Kendra is designed to help users find the information they need quickly and accurately, improving productivity and decision-making.

With Kendra, users can search across a wide range of content types, including documents, FAQs, knowledge bases, manuals, and websites.
It supports multiple languages and can understand complex queries, synonyms, and contextual meanings to provide highly relevant search results.

This will help you getting started with `AWSKendraRetriever` [retrieval](/oss/javascript/langchain/retrieval). For detailed documentation of all `AWSKendraRetriever` features and configurations head to the [API reference](https://reference.langchain.com/javascript/langchain-aws/AmazonKendraRetriever).

### Integration details

| Retriever                                                                                            | Source                |                              Package                             |
| :--------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------: |
| [AWSKendraRetriever](https://reference.langchain.com/javascript/langchain-aws/AmazonKendraRetriever) | Various AWS resources | [`@langchain/aws`](https://www.npmjs.com/package/@langchain/aws) |

## Setup

You'll need an AWS account and an Amazon Kendra instance to get started. See this [tutorial](https://docs.aws.amazon.com/kendra/latest/dg/getting-started.html) from AWS for more information.

If you want to get automated tracing from individual queries, you can also set your [LangSmith](/langsmith/observability) API key by uncommenting below:

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
// process.env.LANGSMITH_API_KEY = "<YOUR API KEY HERE>";
// process.env.LANGSMITH_TRACING = "true";
```

### Installation

This retriever lives in the `@langchain/aws` package:

<CodeGroup>
  ```bash npm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  npm install @langchain/aws @langchain/core
  ```

  ```bash yarn theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  yarn add @langchain/aws @langchain/core
  ```

  ```bash pnpm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  pnpm add @langchain/aws @langchain/core
  ```
</CodeGroup>

## Instantiation

Now we can instantiate our retriever:

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import { AmazonKendraRetriever } from "@langchain/aws";

const retriever = new AmazonKendraRetriever({
  topK: 10,
  indexId: "YOUR_INDEX_ID",
  region: "us-east-2", // Your region
  clientOptions: {
    credentials: {
      accessKeyId: "YOUR_ACCESS_KEY_ID",
      secretAccessKey: "YOUR_SECRET_ACCESS_KEY",
    },
  },
});
```

## Usage

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
const query = "..."

await retriever.invoke(query);
```

***

## API reference

For detailed documentation of all `AmazonKendraRetriever` features and configurations head to the [API reference](https://reference.langchain.com/javascript/langchain-aws/AmazonKendraRetriever).

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/javascript/integrations/retrievers/kendra-retriever.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
