
An Amazon Lex V2 bot uses AMAZON.QnAIntent to answer questions from documents indexed by an Amazon Bedrock knowledge base that stores its vectors in Amazon S3 Vectors.
AMAZON.QnAIntent answers questions with a foundation model, using passages retrieved from an Amazon Bedrock knowledge base. The knowledge base reads documents from an Amazon S3 bucket, embeds them with Amazon Titan Text Embeddings V2 and stores the vectors in an Amazon S3 Vectors index.git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lex-bedrock-kb/typescript/cdknpm installnpx cdk bootstrapnpx cdk deploysample-docs to the docs/ prefix of the bucket from the stack outputs, start a knowledge base ingestion job with aws bedrock-agent start-ingestion-job and wait until its status is COMPLETE.aws bedrock-agent-runtime retrieve, then ask the bot a question that the documents answer with aws lexv2-runtime recognize-text, using the bot alias TSTALIASID and the locale en_US.npx cdk destroy.