-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bedrock L2 Construct #688
base: main
Are you sure you want to change the base?
Bedrock L2 Construct #688
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the document is well-structured and provides a comprehensive overview of the Bedrock L2 construct. However, enhancing clarity in certain sections and ensuring completeness will greatly benefit users.
|
||
The Bedrock L2 construct simplifies the creation of multiple Bedrock features by providing a wrapper over the Bedrock L1 construct. It exposes functions that enable users to create features with minimal code. Key features include Bedrock Agent, Knowledge Base, Guardrails, Inference Profiles, and Prompt. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ensure that all sections of the new construct are complete and provide sufficient details for users to understand and implement the construct.
For more details please refer here [Amazon Bedrock README](https://github.com/awslabs/generative-ai-cdk-constructs/blob/main/src/cdk-lib/bedrock/README.md). | ||
|
||
|
||
## Knowledge Base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verify that the documentation (README) is clear and includes examples for each feature of the Bedrock L2 construct. It should also explain how to integrate with other AWS services.Verify that the documentation (README) is clear and includes examples for each feature of the Bedrock L2 construct. It should also explain how to integrate with other AWS services.
const auroraDb = aurora.AmazonAuroraVectorStore.fromExistingAuroraVectorStore(stack, 'ExistingAuroraVectorStore', { | ||
clusterIdentifier: 'aurora-serverless-vector-cluster', | ||
databaseName: 'bedrock_vector_db', | ||
schemaName: 'bedrock_integration', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirm that all chunking strategies are thoroughly explained and example code is provided for each (Fixed Size, Hierarchical, Semantic, etc.
|
||
const kb = new KnowledgeBase(stack, 'MyKnowledgeBase', { | ||
name: 'MyKnowledgeBase', | ||
embeddingsModel: BedrockFoundationModel.COHERE_EMBED_MULTILINGUAL_V3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review the guardrails to ensure that they cover all necessary areas for content filtering, denied topics, word filtering, and sensitive information filters.
|
||
- **Fixed Size Chunking**: This method divides the data into fixed-size chunks, with each chunk | ||
containing a predetermined number of tokens. This strategy is useful when the data is uniform | ||
in size and structure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest adhering to AWS best practices, especially in areas involving security (e.g., handling AWS Secrets Manager, IAM roles).
|
||
const variant2 = PromptVariant.text({ | ||
variantName: "variant2", | ||
model: claudeModel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a section on how users can provide feedback or report issues with the Bedrock L2 construct.
|
||
## Prompt management | ||
|
||
Amazon Bedrock provides the ability to create and save prompts using Prompt management so that you can save |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify the versioning strategy for the constructs. It’s important for users to know how to manage updates and changes.
blockedOutputsMessaging: 'blockedOutputsMessaging', | ||
name: 'namemycfnguardrails', | ||
wordPolicyConfig: { | ||
wordsConfig: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include a section on testing the Bedrock L2 construct to ensure users understand how to validate their implementations.
|
||
#### Specific version | ||
|
||
You can use the `AgentAlias` resource if you want to create an Alias for an existing Agent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be beneficial to include error handling examples in the documentation to guide users on how to manage potential issues.
### Create an Agent | ||
|
||
The following example creates an Agent with a simple instruction and default prompts that consults a Knowledge Base. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that all example code snippets are well-commented and easy to follow. Consider adding more context or explanations for complex sections.
I've reviewed the documentation and it looks great! Happy to contribute further if needed. Thank you! |
|
||
### What are the drawbacks of this solution? | ||
|
||
The Knowledge Base vector stores (OpenSearch and Aurora clusters) utilize custom resource lambda functions, as there are no underlying L1 constructs available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see there's CFN resource for OpenSearch collection with vector search. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opensearchserverless-collection.html
Is it different that what need here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we have CFN resource for vector collection but not for vector index creation. The custom resource used here create a vector index. But like we discussed we can skip the vector index part from the construct and enable it to use an existing collection and index.
const importedGuardrail = bedrock.Guardrail.fromCfnGuardrail(cfnGuardrail); | ||
``` | ||
|
||
Python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove the Python code here in readme and RFC.
|
||
### Why should we _not_ do this? | ||
|
||
The construct is published via the [generative-ai-cdk-constructs](https://github.com/awslabs/generative-ai-cdk-constructs/blob/main/src/cdk-lib/bedrock/README.md) repository. However, due to the increasing demands and expanding use cases, maintaining it within this repository has become challenging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maintaining it within this repository has become challenging.
Why maintaining it within this repo is more challenging than merging into aws-cdk
?
``` | ||
|
||
|
||
#### Knowledge Base - Data Sources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these APIs just create AWS::Bedrock::DataSource
CFN resources?
This is a request for Amazon Bedrock L2 construct that simplifies the creation of multiple Bedrock features by providing a wrapper over the Bedrock L1 construct. It exposes functions that enable users to create features with minimal code. Key features include Bedrock Agent, Knowledge Base, Guardrails, Inference Profiles, and Prompt. See #686 for
additional details.
APIs are signed off by @{BAR_RAISER}.
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache-2.0 license