- Newest
- Most votes
- Most comments
Yes, it's possible to connect an Amazon Bedrock knowledge base to the QnABot on AWS solution. When deploying the QnABot CloudFormation template, you'll need to provide two key parameters:
-
BedrockKnowledgeBaseId: This is where you enter the ID of your existing Amazon Bedrock knowledge base. This enables the knowledge base to function as a fallback mechanism when a match isn't found in OpenSearch.
-
BedrockKnowledgeBaseModel: You must specify a valid model or inference profile ID. The default is
global.anthropic.claude-haiku-4-5-20251001-v1:0. QnABot supports all Bedrock foundation models or inference profiles with TEXT input/output modality. Make sure your chosen model is enabled in the Amazon Bedrock console and available in your account and region.
By integrating with a Bedrock knowledge base, QnABot can generate concise answers to users' questions from your configured data sources, eliminating the need for users to search through larger text passages. You can create your own knowledge base from files stored in an S3 bucket.
One advantage of using Amazon Bedrock knowledge bases with QnABot is that you don't need to configure EmbeddingsApi and LLMApi separately, as the embeddings and generative response capabilities are already provided by the knowledge base.
When setting up your knowledge base for use with QnABot, you'll need to configure your data source. For example, if using Amazon S3 as the data source, note that the bucket name needs to be prepended with "qna" or "QNA".
Sources
Step 1: Launch the stack - QnABot on AWS
Delight your customers with great conversational experiences via QnABot, a generative AI chatbot | AWS Machine Learning Blog
answered 10 months ago
Yes, it's possible to connect an Amazon Bedrock knowledge base to the QnABot client. When deploying the QnABot CloudFormation template, you'll need to provide two key parameters:
BedrockKnowledgeBaseId: This is where you enter the ID of your existing Amazon Bedrock knowledge base. This enables the knowledge base to function as a fallback mechanism when a match isn't found in OpenSearch.
BedrockKnowledgeBaseModel: You must specify a valid model or inference profile ID. The default is global.anthropic.claude-haiku-4-5-20251001-v1:0. QnABot supports all Bedrock foundation models or inference profiles with TEXT input/output modality. Make sure your chosen model is enabled in the Amazon Bedrock console and available in your account and region.
By integrating with a Bedrock knowledge base, QnABot can generate concise answers to users' questions from your configured data sources, eliminating the need for users to search through larger text passages. You can create your own knowledge base from files stored in an S3 bucket.
If after deployment, the bot responds to Content Designer questions but returns "You stumped me!" for Knowledge Base-related queries, the following steps may help:
- Enable Debug Logging
Go to Content Designer URL → Click on hamburger icon → Settings Set ENABLE_DEBUG_RESPONSES and ENABLE_DEBUG_LOGGING to TRUE This helps identify the actual error when testing queries
- A common issue is missing bedrock:InvokeModel permission on the Lambda role. Adding the appropriate IAM policy for foundation models and inference profiles should resolve this.
Example: If the debug logs show: No identity-based policy allows the bedrock:InvokeModel action, add the following policy to the Lambda role (FulfillmentLambdaRole):
{ "Sid": "BedrockInvokeModel", "Effect": "Allow", "Action": [ "bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream" ], "Resource": [ "arn:aws:bedrock:region_name::foundation-model/anthropic.claude-", "arn:aws:bedrock:region_name:account_id:inference-profile/", "arn:aws:bedrock:::inference-profile/global.*" ] }
Note: Replace region_name and account_id with actual values.
Once the permissions are in place, the bot should successfully retrieve answers from the Knowledge Base.
answered 10 months ago
