How aws-solutions/generative-ai-application-builder-on-aws works
And lay out the major components
• Frontend UIs:
• Deployment Dashboard UI (located in source/ui-deployment)
• Chat UI (located in source/ui-chat)
• Cloud Infrastructure:
• AWS CDK defined stacks (source/infrastructure) that deploy the overall architecture.
• Nested CloudFormation stacks for various use cases.
• AWS Serverless Backing:
• REST APIs and WebSocket APIs deployed via Amazon API Gateway.
• AWS Lambda functions (found in source/lambda), including helpers, custom authorizers, and orchestration functions.
• Authentication and Authorization:
• Amazon Cognito for user authentication, integrated with both UI projects and API endpoints.
• Data Stores & Storage:
• Amazon DynamoDB for storing deployment configurations, user policies, LLM configuration options, and chat histories.
• Amazon S3 buckets used for hosting the static web UI assets and storing artifacts (assets are also staged from source/stage-assets.sh).
• Additional Services:
• Amazon CloudFront to serve the frontend UIs.
• Optional usage of Amazon Kendra or Bedrock Knowledge Bases for knowledge retrieval in use cases.
• Amazon SQS being used as part of asynchronous processing in the LangChain Orchestrator workflow.
• Amazon CloudWatch for operational metrics, dashboards, and logging.
Relationships and interactions
• A separation between the two UIs:
• The Deployment Dashboard UI for admin users is delivered via CloudFront. It interacts with API Gateway endpoints (protected via AWS WAF) and invokes Lambda functions that in turn manage CloudFormation (for deploying use cases).
• The Chat UI for business users also leverages CloudFront and a WebSocket API built using API Gateway. It interacts with a series of Lambda functions (the LangChain Orchestrator) that receive asynchronous requests via an SQS queue and then query either Amazon SageMaker or Amazon Bedrock for the LLM response.
• From CloudFront (hosting static assets) → API Gateway → Lambda → possibly DynamoDB (for configuration or session data) → further AWS services (S3, SQS, or external LLM provider endpoints).
• Callback paths, such as Lambda streaming back responses to API Gateway’s WebSocket connection.
• Authentication flow:
• From end users (admin or business) → Cognito (and custom authorizers in some cases) → API Gateway which is secured by Cognito.
Architectural patterns to highlight
• Serverless design using AWS Lambda, API Gateway, and DynamoDB.
• Modular and extensible infrastructure provisioning via AWS CDK and nested stacks.
• Use of asynchronous messaging (SQS) to decouple web API and long-running orchestration tasks.
• Clear separation between UI (frontend) and backend (Lambda functions, data stores, orchestration logic).
Following technical details
• Technologies, frameworks, and libraries:
• AWS CDK (in TypeScript and occasionally Python)
• Lambda functions written in Python, Node.js, and TypeScript
• Use of LangChain (an external open-source library for LLM orchestration)
• Frontend built with React via Vite.
• Usage of AWS CloudFormation; nested stack approach is a key design principle.
• Utility scripts for staging assets, building distribution packages, and running tests.
Final advice
• Next, decompose the system into its layers: presentation (UI), application (API Gateway + Lambda), and data/infrastructure (DynamoDB, S3, CloudFormation/CDK).
• Modularized design as seen in the file tree (notably, separate directories for infrastructure, lambda functions, and UI projects) and indicate that testing, deployment scripts, and asset staging are part of the continuous deployment workflow.