0.1.154 • Published 4 days ago

@cdklabs/generative-ai-cdk-constructs v0.1.154

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 days ago

AWS Generative AI CDK Constructs

Stability: Experimental

All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


View on Construct Hub

PyPI version npm version

Table of contents

Introduction

The AWS Generative AI Constructs Library is an open-source extension of the AWS Cloud Development Kit (AWS CDK) that provides multi-service, well-architected patterns for quickly defining solutions in code to create predictable and repeatable infrastructure, called constructs. The goal of AWS Generative AI CDK Constructs is to help developers build generative AI solutions using pattern-based definitions for their architecture.

The patterns defined in AWS Generative AI CDK Constructs are high level, multi-service abstractions of AWS CDK constructs that have default configurations based on well-architected best practices. The library is organized into logical modules using object-oriented techniques to create each architectural pattern model.

CDK Versions

AWS Generative AI CDK Constructs and the AWS CDK are independent teams and have different release schedules. Each release of AWS Generative AI CDK Constructs is built against a specific version of the AWS CDK. The CHANGELOG.md file lists the CDK version associated with each AWS Generative AI Constructs release. For instance, AWS Generative AI CDK Constructs v0.0.0 was built against AWS CDK v2.96.2. This means that to use AWS Generative AI CDK Constructs v0.0.0, your application must include AWS CDK v2.96.2 or later. You can continue to use the latest AWS CDK versions and upgrade the your AWS Generative AI CDK Constructs version when new releases become available.

Contributing

Contributions of all kinds are welcome! Check out our contributor guide

Design guidelines and Development guide

If you want to add a new construct to the library, check out our design guidelines, then follow the development guide

Getting Started

For TypeScript:

  • Create or use an existing CDK application in TypeScript.
    • cdk init app --language typescript
  • Run npm install @cdklabs/generative-ai-cdk-constructs
  • The package should be added to your package.json.
  • Import the library:
    • import * as genai from '@cdklabs/generative-ai-cdk-constructs';

For Python:

  • Create or use an existing CDK application in Python
    • cdk init app --language python
  • Install the package:
    • pip install cdklabs.generative-ai-cdk-constructs
  • Import the library:
    • import cdklabs.generative_ai_cdk_constructs

Refer to the documentation for additional guidance on a particular construct: Catalog

Catalog

The following constructs are available in the library:

L3 constructs

ConstructDescriptionAWS Services used
Data ingestion pipeline - OpenSearchIngestion pipeline providing a RAG (retrieval augmented generation) source for storing documents in a knowledge base.Amazon OpenSearch, AWS Step Functions, Amazon Bedrock, AWS AppSync, AWS Lambda
Data ingestion pipeline - KendraIngestion pipeline providing a RAG (retrieval augmented generation) source for storing documents in a knowledge base.Amazon Kendra, AWS Step Functions, AWS AppSync, AWS Lambda
Question answeringUtilizing Large Language Models (Anthropic Claude V2.1.) for Question Answering on PDF documents with RAG (retrieval augmented generation) source and/or long context. Additionally, leveraging Anthropic Claude 3 for visual question answering on images.Amazon OpenSearch, AWS Lambda, Amazon Bedrock, AWS AppSync
SummarizationDocument summarization with a large language model (Anthropic Claude V2.1).AWS Lambda, Amazon Bedrock, AWS AppSync and Amazon ElastiCache for Redis.
SageMaker model deployment (JumpStart)Deploy a foundation model from Amazon SageMaker JumpStart to an Amazon SageMaker endpoint.Amazon SageMaker
SageMaker model deployment (Hugging Face)Deploy a foundation model from Hugging Face to an Amazon SageMaker endpoint.Amazon SageMaker
SageMaker model deployment (Custom)Deploy a foundation model from an S3 location to an Amazon SageMaker endpoint.Amazon SageMaker
Content GenerationGenerate images from text using Amazon titan-image-generator-v1 or stability.stable-diffusion-xl model.AWS Lambda, Amazon Bedrock, AWS AppSync

L2 Constructs

ConstructDescriptionAWS Services used
Lambda layerPython Lambda layer providing dependencies and utilities to develop generative AI applications on AWS.AWS Lambda, Amazon Bedrock, Amazon SageMaker
Amazon BedrockCDK L2 Constructs for Amazon Bedrock.Amazon Bedrock, Amazon OpenSearch Serverless, AWS Lambda
Amazon OpenSearch Serverless Vector CollectionCDK L2 Constructs to create a vector collection.Amazon OpenSearch Vector Index
Amazon OpenSearch Vector IndexCDK L1 Custom Resource to create a vector index.Amazon OpenSearch Serverless, AWS Lambda

Sample Use Cases

The official samples repository https://github.com/aws-samples/generative-ai-cdk-constructs-samples includes a collection of functional use case implementations to demonstrate the usage of AWS Generative AI CDK Constructs. These can be used in the same way as architectural patterns, and can be conceptualized as an additional "higher-level" abstraction of those patterns. Those patterns (constructs) are composed together into stacks, forming a "CDK app".

Additional Resources

ResourceDescription
AWS re:Invent 2023 - Keynote with Dr. Werner VogelsDr. Werner Vogels, Amazon.com's VP and CTO, announces the AWS Generative AI CDK Constructs during his AWS re:Invent 2023 keynote.
Workshop - Building Generative AI Apps on AWS with CDKIn this workshop, you will explore how to build a sample generative AI app on AWS using CDK and Generative AI CDK Constructs.
Build generative AI applications with Amazon Titan Text Premier, Amazon Bedrock, and AWS CDKBlog post exploring building and deploying two sample applications powered by Amazon Titan Text Premier using the Generative AI CDK constructs.
aws-cdk-stack-builder-toolAWS CDK Builder is a browser-based tool designed to streamline bootstrapping of Infrastructure as Code (IaC) projects using the AWS Cloud Development Kit (CDK).
CDK Live! Building generative AI applications and architectures leveraging AWS CDK Constructs!CDK Live! episode focused on building and deploying generative AI applications and architectures on AWS using the AWS Cloud Development Kit (CDK) and the AWS Generative AI CDK Constructs.
Announcing AWS Generative AI CDK Constructs!Blog post announcing the release of the AWS Generative AI CDK Constructs.
aws-genai-llm-chatbotMulti-Model and Multi-RAG Powered Chatbot Using AWS CDK on AWS allowing you to experiment with a variety of Large Language Models and Multimodal Language Models, settings and prompts in your own AWS account.
amazon-bedrock-ragFully managed RAG solution using Knowledge Bases for Amazon Bedrock.
Amazon Bedrock Multimodal SearchMultimodal product search app built using Amazon Titan Multimodal Embeddings model.
Amazon Bedrock Knowledge Bases with Private DataBlog post and associated code sample demonstrating how to integrate Knowledge Bases into Amazon Bedrock to provide foundational models with contextual data from private data sources.
Automating tasks using Amazon Bedrock Agents and AIBlog post and associated code sample demonstrating how to deploy an Amazon Bedrock Agent and a Knowledge Base through a hotel and spa use case.
Agents for Amazon Bedrock - Powertools for AWS Lambda (Python)Create Agents for Amazon Bedrock using event handlers and auto generation of OpenAPI schemas.

Contributors

contributors

Operational Metrics Collection

Provided CDK constructs collect anonymous operational metrics to help AWS improve the quality and features of the constructs. Data collection is subject to the AWS Privacy Policy (https://aws.amazon.com/privacy/). To opt out of this feature, simply disable it by setting the construct property "enableOperationalMetric" to false for each construct used. Defaults to true.

Roadmap

Roadmap is available through the GitHub Project

Legal Disclaimer

You should consider doing your own independent assessment before using the content in this library for production purposes. This may include (amongst other things) testing, securing, and optimizing the CDK constructs and other content, provided in this library, based on your specific quality control practices and standards.


© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

0.1.154

4 days ago

0.1.153

4 days ago

0.1.149

9 days ago

0.1.150

8 days ago

0.1.152

7 days ago

0.1.151

7 days ago

0.1.147

9 days ago

0.1.148

9 days ago

0.1.146

11 days ago

0.1.145

11 days ago

0.1.144

14 days ago

0.1.143

15 days ago

0.1.142

15 days ago

0.1.141

15 days ago

0.1.140

16 days ago

0.1.139

17 days ago

0.1.138

17 days ago

0.1.137

17 days ago

0.1.136

18 days ago

0.1.135

21 days ago

0.1.134

22 days ago

0.1.133

24 days ago

0.1.132

25 days ago

0.1.131

28 days ago

0.1.129

1 month ago

0.1.128

1 month ago

0.1.127

1 month ago

0.1.130

29 days ago

0.1.126

1 month ago

0.1.125

1 month ago

0.1.124

1 month ago

0.1.123

1 month ago

0.1.121

1 month ago

0.1.120

1 month ago

0.1.122

1 month ago

0.1.118

1 month ago

0.1.117

1 month ago

0.1.119

1 month ago

0.1.116

1 month ago

0.1.114

1 month ago

0.1.115

1 month ago

0.1.113

1 month ago

0.1.110

2 months ago

0.1.112

1 month ago

0.1.111

1 month ago

0.1.109

2 months ago

0.1.108

2 months ago

0.1.107

2 months ago

0.1.106

2 months ago

0.1.105

2 months ago

0.1.103

2 months ago

0.1.104

2 months ago

0.1.102

2 months ago

0.1.101

2 months ago

0.1.99

2 months ago

0.1.100

2 months ago

0.1.96

2 months ago

0.1.97

2 months ago

0.1.98

2 months ago

0.1.95

2 months ago

0.1.94

2 months ago

0.1.92

2 months ago

0.1.93

2 months ago

0.1.91

2 months ago

0.1.90

2 months ago

0.1.85

2 months ago

0.1.86

2 months ago

0.1.87

2 months ago

0.1.88

2 months ago

0.1.89

2 months ago

0.1.84

2 months ago

0.1.83

3 months ago

0.1.82

3 months ago

0.1.80

3 months ago

0.1.81

3 months ago

0.1.79

3 months ago

0.1.75

3 months ago

0.1.76

3 months ago

0.1.77

3 months ago

0.1.78

3 months ago

0.1.74

3 months ago

0.1.73

3 months ago

0.1.72

3 months ago

0.1.71

3 months ago

0.1.70

3 months ago

0.1.69

3 months ago

0.1.68

3 months ago

0.1.67

3 months ago

0.1.66

3 months ago

0.1.65

3 months ago

0.1.64

3 months ago

0.1.63

3 months ago

0.1.62

3 months ago

0.1.61

3 months ago

0.1.60

3 months ago

0.1.59

3 months ago

0.1.58

4 months ago

0.1.57

4 months ago

0.1.56

4 months ago

0.1.55

4 months ago

0.1.54

4 months ago

0.1.53

4 months ago

0.1.52

4 months ago

0.1.51

4 months ago

0.1.50

4 months ago

0.1.49

4 months ago

0.1.48

4 months ago

0.1.47

4 months ago

0.1.46

4 months ago

0.1.45

4 months ago

0.1.44

4 months ago

0.1.43

4 months ago

0.1.42

4 months ago

0.1.41

4 months ago

0.1.40

4 months ago

0.1.39

4 months ago

0.1.38

4 months ago

0.1.37

4 months ago

0.1.36

4 months ago

0.1.35

4 months ago

0.1.34

4 months ago

0.1.33

4 months ago

0.1.32

4 months ago

0.1.31

4 months ago

0.1.30

4 months ago

0.1.29

4 months ago

0.1.28

4 months ago

0.1.27

4 months ago

0.1.26

4 months ago

0.1.25

4 months ago

0.1.24

4 months ago

0.1.23

4 months ago

0.1.22

4 months ago

0.1.21

4 months ago

0.1.20

4 months ago

0.1.19

5 months ago

0.1.18

5 months ago

0.1.17

5 months ago

0.1.16

5 months ago

0.1.15

5 months ago

0.1.14

5 months ago

0.1.13

5 months ago

0.1.12

5 months ago

0.1.11

5 months ago

0.1.10

5 months ago

0.1.9

5 months ago

0.1.8

5 months ago

0.1.7

5 months ago

0.1.6

5 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago

0.0.91

6 months ago

0.0.90

6 months ago

0.0.89

6 months ago

0.0.88

6 months ago

0.0.87

6 months ago

0.0.86

6 months ago

0.0.85

6 months ago

0.0.82

6 months ago

0.0.81

6 months ago

0.0.80

6 months ago

0.0.79

6 months ago

0.0.78

6 months ago

0.0.77

6 months ago

0.0.76

6 months ago

0.0.75

6 months ago

0.0.74

6 months ago

0.0.73

6 months ago

0.0.72

6 months ago

0.0.71

6 months ago

0.0.70

6 months ago

0.0.69

6 months ago

0.0.68

6 months ago