A comprehensive AI-powered chatbot application that provides intelligent guidance and support for adaptive gaming in therapy and rehabilitation settings, powered by AWS Bedrock Knowledge Base and cutting-edge AI technologies.
Watch the full walkthrough of ReSpawn – Adaptive Gaming ChatBot in action:
Respawn-Demo.mp4
Customers are responsible for making their own independent assessment of the information in this document.
This document:
(a) is for informational purposes only,
(b) references AWS product offerings and practices, which are subject to change without notice,
(c) does not create any commitments or assurances from AWS and its affiliates, suppliers or licensors. AWS products or services are provided "as is" without warranties, representations, or conditions of any kind, whether express or implied. The responsibilities and liabilities of AWS to its customers are controlled by AWS agreements, and this document is not part of, nor does it modify, any agreement between AWS and its customers, and
(d) is not to be considered a recommendation or viewpoint of AWS.
Additionally, you are solely responsible for testing, security and optimizing all code and assets on GitHub repo, and all such code and assets should be considered:
(a) as-is and without warranties or representations of any kind,
(b) not suitable for production environments, or on production or other critical data, and
(c) to include shortcuts in order to support rapid prototyping such as, but not limited to, relaxed authentication and authorization and a lack of strict adherence to security best practices.
All work produced is open source. More information can be found in the GitHub repo.
- Overview
- Live Demo
- Architecture
- Key Features
- Technology Stack
- Prerequisites
- Local Development
- Deployment
- Post-Deployment Setup
- Usage
- Infrastructure
- Project Structure
- Configuration
- Troubleshooting
- Documentation
- Credits
- License
ReSpawn is an intelligent chatbot designed to assist therapists, rehabilitation specialists, and healthcare professionals in implementing adaptive gaming solutions for patients with physical limitations. The application combines natural language processing with AWS Bedrock Knowledge Base to deliver accurate, context-aware responses in both English and Spanish.
Built on a serverless architecture with real-time streaming communication, secure knowledge base integration, and an intuitive chat interface, ReSpawn makes adaptive gaming guidance accessible and actionable.
- Multi-Language Support: Seamless English and Spanish conversation with automatic language detection
- AWS Bedrock Knowledge Base Integration: Powered by Amazon Nova Lite and Titan embeddings for intelligent responses
- Real-time Streaming Responses: Server-sent events (SSE) for smooth, progressive answer delivery
- Contextual Conversation Memory: Maintains conversation history across sessions for coherent multi-turn dialogues
- Intelligent FAQ System: Pre-loaded with 10 common adaptive gaming questions in both languages
- Web Crawler Data Source: Automatically ingests and indexes content from specified URLs
- Responsive Chat Interface: Modern Next.js frontend with floating chat widget
- Serverless Architecture: Fully managed AWS infrastructure with API Gateway, Lambda, and OpenSearch Serverless
The application implements a serverless, event-driven architecture with AWS Bedrock at its core:
-
Frontend (Next.js + React + TypeScript)
- Responsive chat widget with floating button interface
- Real-time streaming message display
- Language toggle (EN/ES)
- FAQ sidebar with collapsible panel
- Conversation state management
-
Backend (AWS Lambda + Python)
- RESTful API endpoints (
/api/chat,/health) - Bedrock Agent Runtime integration
- Conversation session management
- Language-aware prompt engineering
- RESTful API endpoints (
-
Knowledge Base (AWS Bedrock + OpenSearch Serverless)
- Vector embeddings using Amazon Titan
- Web crawler data source for content ingestion
- Semantic search and retrieval
- RAG (Retrieval Augmented Generation) pipeline
-
Infrastructure (AWS CDK + TypeScript)
- Infrastructure as Code for reproducible deployments
- API Gateway HTTP API with CORS support
- CloudWatch Logs for monitoring
- AWS Amplify for frontend hosting
- User submits a question through the chat interface
- Frontend sends POST request to API Gateway
/api/chatendpoint - Lambda function receives request and calls Bedrock Agent Runtime
- Bedrock retrieves relevant context from Knowledge Base (OpenSearch Serverless)
- LLM generates response using retrieved context and conversation history
- Response streams back to frontend via Server-Sent Events (SSE)
- Chat widget displays formatted response with suggestions
- Framework: Next.js 16.1.6 (React 19.2.3)
- Language: TypeScript 5
- Styling: Tailwind CSS 4
- Build Tool: Vite
- Deployment: AWS Amplify Hosting
- Runtime: Python 3.11
- Framework: AWS Lambda
- API: API Gateway HTTP API
- AI/ML: AWS Bedrock (Nova Lite, Titan Embeddings)
- Vector Store: OpenSearch Serverless
- IaC: AWS CDK 2.175.0
- Language: TypeScript
- Services: Lambda, API Gateway, Bedrock, OpenSearch Serverless, Amplify, CloudWatch
Before deploying or running locally, ensure you have the required tools and accounts.
- Node.js: v20 or higher
- Python: 3.11 or higher
- AWS CLI: v2.x configured with valid credentials
- AWS CDK: v2.175.0 or higher
- Git: For version control
- AWS Account: With Bedrock model access enabled
- GitHub Account: With Personal Access Token (repo scope)
For complete installation and configuration instructions, including:
- Step-by-step tool installation for macOS, Linux, and Windows
- AWS account setup and credential configuration
- GitHub token creation
- Environment variable configuration
- Verification steps
See the Setup Guide for detailed instructions.
For local development and testing before deployment.
-
Clone Repository
git clone https://github.com/ASUCICREPO/Respawn-Chatbot-Latest.git cd Respawn-Chatbot-Latest -
Backend Setup
cd backend python3 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt cp env.example .env # Edit .env with your configuration uvicorn app.main:app --reload --port 8000
-
Frontend Setup (in a new terminal)
cd frontend npm install echo "NEXT_PUBLIC_API_URL=http://localhost:8000" > .env.local npm run dev
-
Test Locally
- Open
http://localhost:3000 - Click the chat button and test functionality
- Open
For complete local development setup, including:
- Virtual environment configuration
- Dependency installation
- Environment variable setup
- Running backend and frontend servers
- Troubleshooting common issues
See the Setup Guide - Local Development Setup section.
ReSpawn offers multiple deployment options to suit your needs:
Use the automated deployment script for the fastest setup:
# Set environment variables
export AWS_PROFILE="your-aws-profile"
export AWS_REGION="us-east-1"
export AMPLIFY_REPOSITORY="https://github.com/ASUCICREPO/Respawn-Chatbot-Latest"
export AMPLIFY_OAUTH_TOKEN="your-github-token"
export WEB_CRAWL_SEED_URLS="https://www.gamingreadapted.com/,https://gameaccess.info/"
export AMPLIFY_BRANCH="main"
# Run deployment script
chmod +x scripts/deploy.sh
./scripts/deploy.shChoose the deployment method that works best for you:
- Quick Deployment with Script - Automated one-command deployment
- Manual Deployment - Step-by-step control over the deployment process
- AWS CloudShell Deployment - Deploy directly from AWS Console without local setup
- AWS CodeBuild Deployment - Automated CI/CD pipeline for continuous deployment
For comprehensive deployment instructions, see:
- Deployment Guide - Complete deployment instructions for all methods
- Setup Guide - Prerequisites and environment setup
- Prerequisites: AWS CLI, Node.js 20+, Python 3.11+, GitHub token
- Clone Repository:
git clone https://github.com/ASUCICREPO/Respawn-Chatbot-Latest.git - Run Deployment:
./scripts/deploy.sh(after setting environment variables) - Configure: Enable Bedrock models and start Knowledge Base ingestion
After successful deployment, you'll receive:
HttpApiUrl: Your API Gateway endpointKnowledgeBaseId: Bedrock Knowledge Base IDOpenSearchCollectionName: OpenSearch Serverless collection nameAmplifyAppId: Amplify application IDAmplifyAppUrl: Your live application URL (saved toamplify-url.txt)
After deploying the infrastructure, complete these essential configuration steps:
-
Enable Bedrock Model Access (AWS Console)
- Go to Amazon Bedrock → Model access
- Enable: Amazon Nova Lite and Titan Embeddings G1 - Text v2
-
Start Knowledge Base Ingestion
# Get data source ID and start ingestion aws bedrock-agent list-data-sources --knowledge-base-id <KB_ID> --region us-east-1 aws bedrock-agent start-ingestion-job --knowledge-base-id <KB_ID> --data-source-id <DS_ID> --region us-east-1
-
Verify Amplify Deployment
- Check AWS Console → Amplify → adaptive-gaming-guide
- Ensure build status is "Deployed"
-
Test the Application
- Open the Amplify URL (from deployment outputs or
amplify-url.txt) - Test chat functionality in both English and Spanish
- Open the Amplify URL (from deployment outputs or
For complete post-deployment configuration steps, including:
- Bedrock model access setup
- Knowledge Base ingestion monitoring
- Amplify environment variable configuration
- API endpoint testing
- Troubleshooting common issues
See the Deployment Guide - Post-Deployment Configuration section.
- Open Chat: Click the floating chat button (bottom-right corner)
- Select Language: Toggle between EN (English) and ES (Spanish)
- Ask Questions:
- Click an FAQ question from the sidebar
- Type your own question in the input field
- View Responses: Responses stream in real-time with formatted sections:
- Summary
- Recommendations
- Next questions (clickable suggestions)
- Continue Conversation: Ask follow-up questions to maintain context
- Clear Chat: Click the refresh icon to start a new conversation
| Service | Purpose | Configuration |
|---|---|---|
| API Gateway | HTTP API for frontend-backend communication | CORS enabled, CloudWatch logging |
| Lambda | Serverless compute for chat logic | Python 3.11, 1024MB memory, 30s timeout |
| Bedrock | AI/ML foundation models | Nova Lite (LLM), Titan Embeddings |
| OpenSearch Serverless | Vector database for embeddings | VECTORSEARCH collection, public access |
| Amplify | Frontend hosting and CI/CD | Auto-build on push, environment variables |
| CloudWatch | Logging and monitoring | 7-day retention for API and Lambda logs |
| IAM | Access control | Least-privilege roles for Lambda and Bedrock |
- Lambda: Pay per request and compute time
- API Gateway: Pay per million requests
- Bedrock: Pay per input/output tokens
- OpenSearch Serverless: Pay per OCU (OpenSearch Compute Unit)
- Amplify: Pay per build minute and data transfer
Estimated monthly cost for moderate usage: $50-$150
- API Gateway: CORS configured for secure cross-origin requests
- Lambda: Execution role with minimal required permissions
- Bedrock: IAM-based access control
- OpenSearch: Network and encryption policies enforced
- Secrets: GitHub token stored securely in CloudFormation parameters (NoEcho)
.
├── frontend/ # Next.js frontend application
│ ├── src/
│ │ ├── app/ # Next.js app router pages
│ │ ├── components/ # React components
│ │ │ └── chat/ # Chat widget component
│ │ └── types/ # TypeScript type definitions
│ ├── public/ # Static assets
│ │ ├── frontpage.jpg # Landing page image
│ │ └── ReSpawn_logo.png # Brand logo
│ ├── package.json
│ └── tsconfig.json
│
├── backend/ # Python backend (for local dev)
│ ├── app/
│ │ └── main.py # FastAPI application
│ ├── requirements.txt
│ └── env.example
│
├── infrastructure/ # AWS CDK infrastructure
│ └── cdk/
│ ├── bin/
│ │ └── app.ts # CDK app entry point
│ ├── lib/
│ │ └── adaptive-gaming-chatbot-stack.ts # Main stack
│ ├── lambda/
│ │ └── ai-agent/ # Lambda function code
│ │ ├── handler.py
│ │ └── requirements.txt
│ ├── cdk.json
│ └── package.json
│
├── amplify.yml # Amplify build specification
├── documents/ # Documentation assets
│ ├── AdaptiveGamingBotArc.jpg # Architecture diagram
│ └── Respawn Demo.mov # Demo video
├── README.md
└── .gitignore
NEXT_PUBLIC_API_URL=https://your-api-gateway-url.execute-api.us-east-1.amazonaws.comPORT=8000
CORS_ORIGIN=http://localhost:3000
BEDROCK_KB_ID=your-knowledge-base-id
BEDROCK_MODEL_ID=amazon.nova-lite-v1:0
BEDROCK_MODEL_ARN= # Optional overrideBEDROCK_KB_ID: Knowledge Base IDBEDROCK_MODEL_ID: Model identifierBEDROCK_MODEL_ARN: Optional model ARN overrideAWS_REGION: Deployment region
{
"bedrockModelId": "amazon.nova-lite-v1:0",
"embeddingModelArn": "arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0"
}Error: AccessDeniedException: Could not access model
Solution: Enable model access in Bedrock console (see Post-Deployment Setup)
Error: Empty or generic responses
Solution:
- Verify ingestion job completed successfully
- Check web crawler seed URLs are accessible
- Ensure OpenSearch index was created
Error: Access-Control-Allow-Origin errors
Solution:
- Verify API Gateway CORS configuration
- Check
NEXT_PUBLIC_API_URLenvironment variable - Ensure Amplify environment variables are set
Error: Task timed out after 30 seconds
Solution:
- Increase Lambda timeout in CDK stack
- Optimize Bedrock query parameters
- Check Knowledge Base performance
Error: Build fails during deployment
Solution:
- Check Amplify build logs
- Verify
amplify.ymlconfiguration - Ensure
NEXT_PUBLIC_API_URLis set in Amplify environment variables
# Check Lambda logs
aws logs tail /aws/lambda/AdaptiveGamingChatbotStack-AiAgentFn --follow
# Check API Gateway logs
aws logs tail /aws/apigateway/AdaptiveGamingChatbotStack-ChatApi --follow
# Test API endpoint
curl -X POST https://your-api-url/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "test", "language": "en"}'
# Check Knowledge Base status
aws bedrock-agent get-knowledge-base \
--knowledge-base-id <your-kb-id> \
--region us-east-1Comprehensive guides for setup, deployment, and configuration:
- Setup Guide - Complete setup instructions for local development and AWS prerequisites
- Local development environment setup
- AWS account configuration
- GitHub setup and token creation
- Environment variable configuration
- Verification steps and troubleshooting
- Deployment Guide - Multiple deployment options with detailed instructions
- Quick deployment with automated script
- Manual step-by-step deployment
- AWS CloudShell deployment (no local setup required)
- AWS CodeBuild CI/CD deployment
- Post-deployment configuration
- Troubleshooting and cleanup
- Architecture Diagram - Visual representation of the system architecture
- Demo Video - Full walkthrough of the application
- Local Development Setup
- AWS Account Setup
- Quick Deployment
- CloudShell Deployment
- CodeBuild Deployment
- Post-Deployment Configuration
This application was architected and developed by Sayantika Paul and Omdevsinh Zala with solutions architect Arun Arunachalam, program manager Thomas Orr and product manager Rachel Hayden. Thanks to the ASU Cloud Innovation Centre and Career Services' Technical and Project Management teams for their guidance and support.
See LICENSE file for details.
Built by Arizona State University's AI Cloud Innovation Center (AI CIC)
Powered by AWS
