Skip to content

Sample project to show how to build a Chatbot with AWS serverless architecture.

Notifications You must be signed in to change notification settings

jc1518/simple-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Chatbot

Description

Simple Chatbot is a sample project to demostrate how to build a Chatbot with AWS serverless architecture.

The frontend is written in React and deployed to CloudFront with Cognito authentication.

The backend has 3 options:

  • Lambda function URL (with streaming support)
  • API Gateway (Rest API) + Lambda
  • API Gateway (Websocket API) + Lambda (with streaming support)

Lambda uses Converse API to interact with LLM models in Bedrock.

The conversation history is stored in browser local storage for simpility.

simple_chatbot

Architecture

architecture

Usage

Customization

Go to simple-chatbot.ts and update the settings accordinly:

const props = {
  appName: process.env.APP_NAME || "SimpleChatbot",
  allowedDomain: process.env.ALLOWED_DOMAIN || "amazon.com", // Allowed email domain in Cognito
  region: process.env.REGION || "ap-southeast-2",
  bedrockRegion: process.env.BEDROCK_REGION || "ap-southeast-2",
  modelId:
    process.env.MODEL_ID || "apac.anthropic.claude-3-5-sonnet-20240620-v1:0",
};

Create stack

cd cdk
npm install
cdk deploy

Destroy stack

cd cdk
cdk destroy

Demo

Watch the video

About

Sample project to show how to build a Chatbot with AWS serverless architecture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published