This repository provides examples and techniques for building complex, serverless, and scalable generative AI applications using prompt chaining with Amazon Bedrock. It targets developers looking to orchestrate multi-step LLM interactions for sophisticated tasks, offering a structured approach to complex AI workflows.
How It Works
The core concept is prompt chaining, where a complex task is broken down into smaller, sequential or parallel subtasks, each handled by a specific prompt. These chains can be orchestrated using either AWS Step Functions for robust workflow management with extensive AWS service integration, or Amazon Bedrock Flows, a service purpose-built for generative AI workflows. Both approaches leverage serverless AWS services, eliminating infrastructure management.
Quick Start & Requirements
- Installation: Deploy using AWS CDK.
- Prerequisites: AWS account, AWS CLI, Node.js, Python 3.8+, AWS CDK.
- Resources: Requires AWS services like Amazon Bedrock, AWS Step Functions, AWS Lambda, and potentially others depending on the example.
- Documentation: Development Guide for deployment instructions.
Highlighted Details
- Demonstrates various chaining techniques: sequential, parallel, map, conditional, and service integration.
- Provides example applications for blog posts, story writing, trip planning, movie pitching, meal planning, and repository summarization.
- Illustrates handling failures, waiting for human input, and integrating with other AWS services like SNS and Lambda.
- Offers implementations using both AWS Step Functions and Amazon Bedrock Flows.
Maintenance & Community
- Maintained by AWS Samples.
- Community contributions are welcome via pull requests.
Licensing & Compatibility
- License: MIT-0 License.
- Compatibility: Permissive license allows for commercial use and integration with closed-source applications.
Limitations & Caveats
- Bedrock Flows has more limited direct AWS service integration compared to Step Functions; custom Lambda functions are often required for broader service interaction.
- Some examples, like the Bedrock Agents one, require manual setup steps beyond the CDK deployment.