Package: cdklabs.generative-ai-cdk-constructs
AWS Generative AI CDK ConstructsAll classes are under active development and subject to non-backward compatible changes or removal in any
future version. These are not subject to theSemantic Versioningmodel.
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.Table of contentsIntroductionCDK VersionsContributingAdding new constructsGetting StartedCatalogSample Use CasesAdditional ResourcesOperational Metrics CollectionRoadmapLegal DisclaimerIntroductionThe AWS Generative AI Constructs Library is an open-source extension of theAWS Cloud Development Kit (AWS CDK)that provides multi-service, well-architected patterns for quickly defining solutions in code to create predictable and repeatable infrastructure, calledconstructs. 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 VersionsAWS 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. TheCHANGELOG.mdfile 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.ContributingContributions of all kinds are welcome! Check out ourcontributor guideDesign guidelines and Development guideIf you want to add a new construct to the library, check out ourdesign guidelines, then follow thedevelopment guideGetting StartedFor TypeScript:Create or use an existing CDK application in TypeScript.cdk init app --language typescriptRunnpm install @cdklabs/generative-ai-cdk-constructsThe 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 Pythoncdk init app --language pythonInstall the package:pip install cdklabs.generative-ai-cdk-constructsImport the library:import cdklabs.generative_ai_cdk_constructsRefer to the documentation for additional guidance on a particular construct:CatalogCatalogThe following constructs are available in the library:ConstructDescriptionAWS Services usedData ingestion pipelineIngestion 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 LambdaQuestion answeringQuestion answering with a large language model (Anthropic Claude V2.1) using a RAG (retrieval augmented generation) source and/or long context.Amazon OpenSearch, AWS Lambda, Amazon Bedrock, AWS AppSyncSummarizationDocument summarization with a large language model (Anthropic Claude V2.1).AWS Lambda, Amazon Bedrock, AWS AppSync and Amazon ElastiCache for Redis.Lambda layerPython Lambda layer providing dependencies and utilities to develop generative AI applications on AWS.AWS Lambda, Amazon Bedrock, Amazon SageMakerSageMaker model deployment (JumpStart)Deploy a foundation model from Amazon SageMaker JumpStart to an Amazon SageMaker endpoint.Amazon SageMakerSageMaker model deployment (Hugging Face)Deploy a foundation model from Hugging Face to an Amazon SageMaker endpoint.Amazon SageMakerSageMaker model deployment (Custom)Deploy a foundation model from an S3 location to an Amazon SageMaker endpoint.Amazon SageMakerAmazon BedrockCDK L2 Constructs for Amazon Bedrock.Amazon Bedrock, Amazon OpenSearch Serverless, AWS LambdaAmazon OpenSearch Serverless Vector CollectionCDK L2 Constructs to create a vector collection.Amazon OpenSearch Vector IndexAmazon OpenSearch Vector IndexCDK L1 Custom Resource to create a vector index.Amazon OpenSearch Serverless, AWS LambdaContent GenerationGenerate images from text using Amazon titan-image-generator-v1 or stability.stable-diffusion-xl model.AWS Lambda, Amazon Bedrock, AWS AppSyncSample Use CasesThe official samples repositoryhttps://github.com/aws-samples/generative-ai-cdk-constructs-samplesincludes 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 intostacks, forming a "CDK app".Additional ResourcesResourceDescriptionAWS 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.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 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.Operational Metrics CollectionProvided 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.RoadmapRoadmap is available through theGitHub ProjectLegal DisclaimerYou 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.