View a markdown version of this page

GAIA Chatbot Starter Package - Secure AI Foundations

GAIA Chatbot Starter Package

The GAIA Chatbot Starter Package deploys a production-ready GenAI chatbot backend using Amazon Bedrock Knowledge Bases, Guardrails, and serverless APIs. You provide the frontend application and documents for the knowledge base; the starter kit deploys the full backend.

GAIA Chatbot starter kit architecture

GAIA Chatbot starter kit — GenAI backend with Cognito auth and AppSync streaming.

This architecture is particularly effective when:

  1. You need a RAG-powered chatbot with enterprise authentication.

  2. You need document Q&A over internal knowledge bases (PDF, TXT, MD, HTML, DOCX).

  3. You need real-time streaming chat via WebSocket (AppSync Events).

  4. You need content-filtered AI responses with Bedrock Guardrails.

Authentication and API Components

  • Cognito User Pool - Email/password or enterprise SSO authentication

  • REST API (API Gateway) - Session management, feedback, and admin operations

  • WebSocket API (AppSync Events) - Real-time chat streaming

  • CloudFront CDN - Serves aws-exports.json configuration

  • WAF - Optional web application firewall

GenAI Components

  • Bedrock Knowledge Base - OpenSearch Serverless vector store

  • Bedrock Guardrails - Content filtering and PII protection

  • VPC-Deployed Lambda Functions - Serverless compute for API handlers

  • KMS-Encrypted S3 Data Lake - Document storage

Deployment Instructions

Manual CLI Deploy Method

Prerequisites

Before deploying the GAIA Chatbot Starter Package using the CLI method, verify you have:

  1. AWS CLI configured with appropriate credentials

  2. Node.js 22.x or later and npm/npx 10.x or later installed

  3. AWS CDK bootstrapped in your target account and region

  4. If deploying outside us-east-1: also bootstrap CDK in us-east-1 in the same account. CloudFront WAF resources must be deployed in us-east-1; the module creates a cross-region stack there automatically via the additional_stacks configuration.

  5. A VPC with private subnets and a NAT Gateway (required — AppSync Events has no VPC endpoint).

  6. Bedrock model access enabled in the AWS console for your target region.

Deployment Steps

Step 1: Scaffold your project

npx @aws-mdaa/cli init my_gaia_chatbot --starter-kit genai_gaia_chatbot cd my_gaia_chatbot

Step 2: Configure your deployment

  • Edit mdaa.yaml:

organization: <your-unique-org-name>
context:
  vpc_id: <your vpc id>
  app_subnet_id_1: <private subnet with NAT route>
  app_subnet_id_2: <private subnet with NAT route>
  data_subnet_id_1: <data subnet>
  data_subnet_id_2: <data subnet>
  inference_model_arn: <Bedrock model ARN or inference profile ARN>
  embedding_model: <embedding model ID>
  waf_allowed_cidrs: [<your ip>, <NAT gateway IP>]

Step 3: Deploy the solution

npx @aws-mdaa/cli ls npx @aws-mdaa/cli synth npx @aws-mdaa/cli deploy

Step 4: Verify deployment

  • Verify the Cognito User Pool, API Gateway REST API, AppSync API, CloudFront distribution, Bedrock Knowledge Base, and OpenSearch Serverless collection are created.

Usage Instructions

  1. Upload documents — Upload documents to the S3 data lake under data/bedrock-knowledge-base/ and sync the knowledge base in the Bedrock console.

  2. Fetch aws-exports.json — CloudFront serves the config file consumed by your frontend application.

  3. Authenticate a user — Create a Cognito user (or configure external SSO) and sign in from your frontend.

  4. Chat via WebSocket — The AppSync Events API streams responses in real time; WAF must allow your NAT Gateway’s public IP for responses to reach Lambda.

For more detailed information, refer to the README.md and docs/USAGE.md files in the starter_kits/genai_gaia_chatbot directory of the MDAA repository.