You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/templates/rag-aws-kendra
Bagatur 2424fff3f1
notebook fmt (#12498)
8 months ago
..
rag_aws_kendra notebook fmt (#12498) 8 months ago
tests Added a rag template for Kendra (#12470) 8 months ago
LICENSE Added a rag template for Kendra (#12470) 8 months ago
README.md Added a rag template for Kendra (#12470) 8 months ago
main.py notebook fmt (#12498) 8 months ago
poetry.lock Added a rag template for Kendra (#12470) 8 months ago
pyproject.toml Added a rag template for Kendra (#12470) 8 months ago

README.md

RAG AWS Kendra

Amazon Kendra is an intelligent search service powered by machine learning (ML). Here we will use Anthropic Claude for text generation and Amazon Kendra for retrieving documents. Together, with these two services, this application uses a Retrieval chain to answer questions from your documents.

(See this page for additional context on building RAG applications with Amazon Kendra.)

Code here uses the boto3 library to connect with the Bedrock service. See this page for setting up and configuring boto3 to work with an AWS account.

Kendra Index

You will need a Kendra Index setup before using this template. For setting up a sample index, you can use this Cloudformation template to create the index. This template includes sample data containing AWS online documentation for Amazon Kendra, Amazon Lex, and Amazon SageMaker. Alternately, if you have an Amazon Kendra index and have indexed your own dataset, you can use that. Launching the stack requires about 30 minutes followed by about 15 minutes to synchronize it and ingest the data in the index. Therefore, wait for about 45 minutes after launching the stack. Note the Index ID and AWS Region on the stacks Outputs tab.

Environment variables

The code assumes that you are working with the default AWS profile and us-east-1 region. If not, specify these environment variables to reflect the correct region and AWS profile.

  • AWS_DEFAULT_REGION
  • AWS_PROFILE

This code also requires specifying the KENDRA_INDEX_ID env variable which should have the Index ID of the Kendra index. Note that the Index ID is a 36 character alphanumeric value that can be found in the index detail page.