| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
English | 日本語 | 한국어 | 中文 | Français | Deutsch | Español | Italian | Norsk | ไทย | Bahasa Indonesia | Bahasa Melayu | Tiếng Việt | Polski | Português Brasil
A multilingual generative AI platform powered by Amazon Bedrock. Supports chat, custom bots with knowledge (RAG), bot sharing via a bot store, and task automation using agents.
Warning
V3 released. To update, please carefully review the migration guide. Without any care, BOTS FROM V2 WILL BECOME UNUSABLE.
Add your own instruction and knowledge (a.k.a RAG. The bot can be shared among application users via bot store market place. The customized bot also can be published as stand-alone API (See the detail).
ScreenshotsYou can also import existing Amazon Bedrock's KnowledgeBase.
Important
For governance reasons, only allowed users are able to create customized bots. To allow the creation of customized bots, the user must be a member of group called CreatingBotAllowed, which can be set up via the management console > Amazon Cognito User pools or aws cli. Note that the user pool id can be referred by accessing CloudFormation > BedrockChatStack > Outputs > AuthUserPoolIdxxxx.
In Amazon Bedrock Knowledge Bases, by default, the number of Knowledge Bases that can be created in a single AWS account is limited to 100. To work around this limitation, you can use 'multi-tenant' mode, where a Knowledge Base with common settings is shared among multiple bots, and files uploaded by each bot are filtered by attaching the Bot ID as metadata.
Newly created bots will have multi-tenant mode enabled by default. To migrate existing bots to multi-tenant mode, change the bot's knowledge settings to "Create a tenant in a shared Knowledge Base."
To migrate multiple bots to multi-tenant mode in bulk, execute commands like the following:
aws dynamodb execute-statement --statement "UPDATE \"$BotTableNameV3\" SET BedrockKnowledgeBase.type='shared' SET SyncStatus='QUEUED' WHERE PK='$UserID' AND SK='BOT#$BotID'"
# Execute for all target bots
aws stepfunctions start-execution --state-machine-arn $EmbeddingStateMachineArnAPI Management, Mark bots as essential, Analyze usage for bots. detail
ScreenshotsBy using the Agent functionality, your chatbot can automatically handle more complex tasks. For example, to answer a user's question, the Agent can retrieve necessary information from external tools or break down the task into multiple steps for processing.
ScreenshotsA comprehensive workshop is available here.
ScreenshotPlease make sure that you deploy Bedrock Chat in a region where OpenSearch Serverless and Ingestion APIs are available, if you want to use bots and create knowledge bases (OpenSearch Serverless is the default choice). As of August 2025, the following regions are supported: us-east-1, us-east-2, us-west-1, us-west-2, ap-south-1, ap-northeast-1, ap-northeast-2, ap-southeast-1, ap-southeast-2, ca-central-1, eu-central-1, eu-west-1, eu-west-2, eu-south-2, eu-north-1, sa-east-1
For the bedrock-region parameter you need to choose a region where Bedrock is available.
git clone https://github.com/aws-samples/bedrock-chat.git
cd bedrock-chat
chmod +x bin.sh
./bin.shYou can specify the following parameters during deployment to enhance security and customization:
Example usage:
./bin.sh --cdk-json-override '{
"context": {
"selfSignUpEnabled": false,
"enableLambdaSnapStart": true,
"allowedIpV4AddressRanges": ["192.168.1.0/24"],
"allowedCountries": ["US", "CA"],
"allowedSignUpEmailDomains": ["example.com"],
"globalAvailableModels": [
"claude-v3.7-sonnet",
"claude-v3.5-sonnet",
"amazon-nova-pro",
"amazon-nova-lite",
"llama3-3-70b-instruct"
]
}
}'The override JSON must follow the same structure as cdk.json. You can override any context values including:
Note
The override values will be merged with the existing cdk.json configuration during the deployment time in the AWS code build. Values specified in the override will take precedence over the values in cdk.json.
./bin.sh --disable-self-register --ipv4-ranges "192.0.2.0/25,192.0.2.128/25" --ipv6-ranges "2001:db8:1:2::/64,2001:db8:1:3::/64" --allowed-signup-email-domains "example.com,anotherexample.com" --bedrock-region "us-west-2" --version "v1.2.6"Frontend URL: https://xxxxxxxxx.cloudfront.net
The sign-up screen will appear as shown above, where you can register your email and log in.
Important
Without setting the optional parameter, this deployment method allows anyone who knows the URL to sign up. For production use, it is strongly recommended to add IP address restrictions and disable self-signup to mitigate security risks (you can define allowed-signup-email-domains to restrict users so that only email addresses from your company's domain can sign up). Use both ipv4-ranges and ipv6-ranges for IP address restrictions, and disable self-signup by using disable-self-register when executing ./bin.
Tip
If the Frontend URL does not appear or Bedrock Chat does not work properly, it may be a problem with the latest version. In this case, please add --version "v3.0.0" to the parameters and try deployment again.
It's an architecture built on AWS managed services, eliminating the need for infrastructure management. Utilizing Amazon Bedrock, there's no need to communicate with APIs outside of AWS. This enables deploying scalable, reliable, and secure applications.
Super-easy Deployment uses AWS CodeBuild to perform deployment by CDK internally. This section describes the procedure for deploying directly with CDK.
Important
If there is insufficient storage space in the local environment during deployment, CDK bootstrapping may result in an error. We recommend expanding the volume size of the instance before deploying.
git clone https://github.com/aws-samples/bedrock-chat
cd bedrock-chat cd cdk npm ci
If necessary, edit the following entries in cdk.json.
Claude Models: claude-v4-opus, claude-v4.1-opus, claude-v4.5-opus, claude-v4.6-opus, claude-v4.7-opus, claude-v4-sonnet, claude-v4.5-sonnet, claude-v4.6-sonnet, claude-v3.5-sonnet, claude-v3.5-sonnet-v2, claude-v3.7-sonnet, claude-v3.5-haiku, claude-v3-haiku, claude-v3-opus
Amazon Nova Models: amazon-nova-pro, amazon-nova-lite, amazon-nova-micro
Mistral Models: mistral-7b-instruct, mixtral-8x7b-instruct, mistral-large, mistral-large-2
DeepSeek Models: deepseek-r1
Meta Llama Models: llama3-3-70b-instruct, llama3-2-1b-instruct, llama3-2-3b-instruct, llama3-2-11b-instruct, llama3-2-90b-instruct
The full list can be found in index.ts.
npx cdk bootstrap
npx cdk deploy --require-approval never --all
✅ BedrockChatStack
✨ Deployment time: 78.57s
Outputs:
BedrockChatStack.AuthUserPoolClientIdXXXXX = xxxxxxx
BedrockChatStack.AuthUserPoolIdXXXXXX = ap-northeast-1_XXXX
BedrockChatStack.BackendApiBackendApiUrlXXXXX = https://xxxxx.execute-api.ap-northeast-1.amazonaws.com
BedrockChatStack.FrontendURL = https://xxxxx.cloudfront.netYou can define parameters for your deployment in two ways: using cdk.json or using the type-safe parameter.ts file.
The traditional way to configure parameters is by editing the cdk.json file. This approach is simple but lacks type checking:
{
"app": "npx ts-node --prefer-ts-exts bin/bedrock-chat.ts",
"context": {
"bedrockRegion": "us-east-1",
"allowedIpV4AddressRanges": ["0.0.0.0/1", "128.0.0.0/1"],
"selfSignUpEnabled": true,
"globalAvailableModels": [
"claude-v3.7-sonnet",
"claude-v3.5-sonnet",
"amazon-nova-pro",
"amazon-nova-lite",
"llama3-3-70b-instruct"
]
}
}For better type safety and developer experience, you can use the parameter.ts file to define your parameters:
// Define parameters for the default environment
bedrockChatParams.set("default", {
bedrockRegion: "us-east-1",
allowedIpV4AddressRanges: ["192.168.0.0/16"],
selfSignUpEnabled: true,
globalAvailableModels: [
"claude-v3.7-sonnet",
"claude-v3.5-sonnet",
"amazon-nova-pro",
"amazon-nova-lite",
"llama3-3-70b-instruct",
],
});
// Define parameters for additional environments
bedrockChatParams.set("dev", {
bedrockRegion: "us-west-2",
allowedIpV4AddressRanges: ["10.0.0.0/8"],
enableRagReplicas: false, // Cost-saving for dev environment
enableBotStoreReplicas: false, // Cost-saving for dev environment
});
bedrockChatParams.set("prod", {
bedrockRegion: "us-east-1",
allowedIpV4AddressRanges: ["172.16.0.0/12"],
enableLambdaSnapStart: true,
enableRagReplicas: true, // Enhanced availability for production
enableBotStoreReplicas: true, // Enhanced availability for production
});Note
Existing users can continue using cdk.json without any changes. The parameter.ts approach is recommended for new deployments or when you need to manage multiple environments.
You can deploy multiple environments from the same codebase using the parameter.ts file and the -c envName option.
To deploy a specific environment:
# Deploy the dev environment
npx cdk deploy --all -c envName=dev
# Deploy the prod environment
npx cdk deploy --all -c envName=prodIf no environment is specified, the "default" environment is used:
# Deploy the default environment
npx cdk deploy --allStack Naming:
Resource Naming:
Environment Identification:
Default Environment Override: If you define a "default" environment in parameter.ts, it will override the settings in cdk.json. To continue using cdk.json, don't define a "default" environment in parameter.ts.
Environment Requirements: To create environments other than "default", you must use parameter.ts. The -c envName option alone is not sufficient without corresponding environment definitions.
Resource Isolation: Each environment creates its own set of resources, allowing you to have development, testing, and production environments in the same AWS account without conflicts.
You can define parameters for your deployment in two ways: using cdk.json or using the type-safe parameter.ts file.
The traditional way to configure parameters is by editing the cdk.json file. This approach is simple but lacks type checking:
{
"app": "npx ts-node --prefer-ts-exts bin/bedrock-chat.ts",
"context": {
"bedrockRegion": "us-east-1",
"allowedIpV4AddressRanges": ["0.0.0.0/1", "128.0.0.0/1"],
"selfSignUpEnabled": true
}
}For better type safety and developer experience, you can use the parameter.ts file to define your parameters:
// Define parameters for the default environment
bedrockChatParams.set("default", {
bedrockRegion: "us-east-1",
allowedIpV4AddressRanges: ["192.168.0.0/16"],
selfSignUpEnabled: true,
});
// Define parameters for additional environments
bedrockChatParams.set("dev", {
bedrockRegion: "us-west-2",
allowedIpV4AddressRanges: ["10.0.0.0/8"],
enableRagReplicas: false, // Cost-saving for dev environment
});
bedrockChatParams.set("prod", {
bedrockRegion: "us-east-1",
allowedIpV4AddressRanges: ["172.16.0.0/12"],
enableLambdaSnapStart: true,
enableRagReplicas: true, // Enhanced availability for production
});Note
Existing users can continue using cdk.json without any changes. The parameter.ts approach is recommended for new deployments or when you need to manage multiple environments.
You can deploy multiple environments from the same codebase using the parameter.ts file and the -c envName option.
To deploy a specific environment:
# Deploy the dev environment
npx cdk deploy --all -c envName=dev
# Deploy the prod environment
npx cdk deploy --all -c envName=prodIf no environment is specified, the "default" environment is used:
# Deploy the default environment
npx cdk deploy --allStack Naming:
Resource Naming:
Environment Identification:
Default Environment Override: If you define a "default" environment in parameter.ts, it will override the settings in cdk.json. To continue using cdk.json, don't define a "default" environment in parameter.ts.
Environment Requirements: To create environments other than "default", you must use parameter.ts. The -c envName option alone is not sufficient without corresponding environment definitions.
Resource Isolation: Each environment creates its own set of resources, allowing you to have development, testing, and production environments in the same AWS account without conflicts.
If using cli and CDK, please npx cdk destroy. If not, access CloudFormation and then delete BedrockChatStack and FrontendWafStack manually. Please note that FrontendWafStack is in us-east-1 region.
This asset automatically detects the language using i18next-browser-languageDetector. You can switch languages from the application menu. Alternatively, you can use Query String to set the language as shown below.
https://example.com?lng=ja
This sample has self sign up enabled by default. To disable self sign up, open cdk.json and switch selfSignUpEnabled as false. If you configure external identity provider, the value will be ignored and automatically disabled.
By default, this sample does not restrict the domains for sign-up email addresses. To allow sign-ups only from specific domains, open cdk.json and specify the domains as a list in allowedSignUpEmailDomains.
"allowedSignUpEmailDomains": ["example.com"],This sample supports external identity provider. Currently we support Google and custom OIDC provider.
For CloudFront distributions, AWS WAF WebACLs must be created in the us-east-1 region. In some organizations, creating resources outside the primary region is restricted by policy. In such environments, CDK deployment can fail when attempting to provision the Frontend WAF in us-east-1.
To accommodate these restrictions, the Frontend WAF stack is optional. When disabled, the CloudFront distribution is deployed without a WebACL. This means you won’t have IP allow/deny controls at the frontend edge. Authentication and all other application controls continue to work as usual. Note that this setting only affects the Frontend WAF (CloudFront scope); the Published API WAF (regional) remains unaffected.
To disable the Frontend WAF set the following in parameter.ts (Recommended Type-Safe Method):
bedrockChatParams.set("default", {
enableFrontendWaf: false,
});Or if using the legacy cdk/cdk.json set the following:
"enableFrontendWaf": falseThis sample has the following groups to give permissions to users:
If you want newly created users to automatically join groups, you can specify them in cdk.json.
"autoJoinUserGroups": ["CreatingBotAllowed"],By default, newly created users will be joined to the CreatingBotAllowed group.
enableRagReplicas is an option in cdk.json that controls the replica settings for the RAG database, specifically the Knowledge Bases using Amazon OpenSearch Serverless.
This is an account/region-level setting, affecting the entire application rather than individual bots.
Note
As of June 2024, Amazon OpenSearch Serverless supports 0.5 OCU, lowering entry costs for small-scale workloads. Production deployments can start with 2 OCUs, while dev/test workloads can use 1 OCU. OpenSearch Serverless automatically scales based on workload demands. For more detail, visit announcement.
The bot store feature allows users to share and discover custom bots. You can configure the bot store through the following settings in cdk.json:
{
"context": {
"enableBotStore": true,
"enableBotStoreReplicas": false,
"botStoreLanguage": "en"
}
}Important: You can't update this property after the collection is already created. If you attempt to modify this property, the collection continues to use the original value.
Cross-region and Global inference allows Amazon Bedrock to dynamically route model inference requests across multiple AWS regions, enhancing throughput and resilience during peak demand periods. Global inference routes the requests to the optimal region based on latency and availability anywhere in the world, while cross-region inference routes requests within the same AWS region, for example, within the US. Some SCPs may restrict on or the other or both and therefore you can configure them independently. By default both are enabled.
To configure change the following settings in cdk.json or parameters.ts:
"enableBedrockGlobalInference": false,
"enableBedrockCrossRegionInference": false,By default, the application uses claude-v3.7-sonnet as the default model for new chat conversations and claude-v3-haiku for generating conversation titles. However, some AWS accounts may not have access to these specific models, or you may prefer to use different models as defaults.
You can configure the default models using the following parameters in parameter.ts:
bedrockChatParams.set("default", {
// Model selected by default when users start a new chat
defaultModel: "claude-v3.7-sonnet",
// Model used for generating conversation titles (cost optimization)
titleModel: "claude-v3-haiku",
});When to configure these settings:
Note
The titleModel is only used internally for generating short conversation titles. Using a smaller, cheaper model for this purpose is recommended as it reduces costs without affecting the user's chat experience.
Lambda SnapStart improves cold start times for Lambda functions, providing faster response times for better user experience. On the other hand, for Python functions, there is a charge depending on cache size and not available in some regions currently. To disable SnapStart, edit cdk.json.
"enableLambdaSnapStart": falseYou can configure a custom domain for the CloudFront distribution by setting the following parameters in cdk.json:
{
"alternateDomainName": "chat.example.com",
"hostedZoneId": "Z0123456789ABCDEF"
}When these parameters are provided, the deployment will automatically:
Note
The domain must be managed by Route 53 in your AWS account. The hosted zone ID can be found in the Route 53 console.
You can restrict access to Bedrock-Chat based on the country the client is accessing it from. Use the allowedCountries parameter in cdk.json which takes a list of ISO-3166 Country Codes. For example a New Zealand based business may decide that only IP addresses from New Zealand (NZ) and Australia (AU) can access the portal and everyone else should be denied access. To configure this behaviour use the following setting in cdk.json:
{
"allowedCountries": ["NZ", "AU"]
}Or, using parameter.ts (Recommended Type-Safe Method):
// Define parameters for the default environment
bedrockChatParams.set("default", {
allowedCountries: ["NZ", "AU"],
});The frontend gets both IP and IPv6 addresses by default. In some rare circumstances, you may need to disable IPv6 support explicitly. To do this, set the following parameter in parameter.ts or similarly in cdk.json:
"enableFrontendIpv6": falseIf left unset the IPv6 support will be enabled by default.
See LOCAL DEVELOPMENT.
Thank you for considering contributing to this repository! We welcome bug fixes, language translations (i18n), feature enhancements, agent tools, and other improvements.
For feature enhancements and other improvements, before creating a Pull Request, we would greatly appreciate it if you could create a Feature Request Issue to discuss the implementation approach and details. For bug fixes and language translations (i18n), proceed with creating a Pull Request directly.
Please also take a look at the following guidelines before contributing:
This library is licensed under the MIT-0 License. See the LICENSE file.
| Back | FazBrowse Home | New Git URL |