Skip to content

Conversation

@Yukinobu-Mine
Copy link
Contributor

@Yukinobu-Mine Yukinobu-Mine commented Oct 29, 2025

Issue #, if available:
Closes #888

Description of changes:

Add 'shared' setting to Knowledge Base settings

  • Add type to the model class that handles Knowledge Base configuration
    • dedicated: Create a dedicated Knowledge Base for the bot
    • shared: Share a Knowledge Base with the same settings across multiple bots, separating tenants by Bot ID
  • Add 'Create a tenant in a shared knowledge base' to the bot's knowledge settings in the frontend

Assign Bot ID as metadata for files uploaded by bots

  • Setup a custom transformation function for the S3 data source of the shared Knowledge Base
  • When using a shared Knowledge Base, specify the Bot ID as a filtering condition in retrieve requests to the Knowledge Base

Completely revamp the Embedding state machine

  • Add build and synchronization processes for shared Knowledge Base
    • Build all shared Knowledge Bases in a single CDK stack BrChatSharedKbStack
  • Introduce distributed locking to prevent multiple state machines from simultaneously executing builds or synchronization of the same Knowledge Base

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…ng Step Functions.

- Backend
  - Add `type` to `BedrockKnowledgeBaseModel`.
    - `dedicated` or `shared` or null
    - Add `BedrockKnowledgeBaseType` and `BedrockKnowledgeBaseHash` for sparse index of `BotTable`.
  - When `shared` is selected, dedicated Knowledge Base is not created.

- Frontend
  - Add 'Pool Pattern' selection for Knowledge settings in `BotKbEditPage`.
- Screenshot changes
  - docs/imgs/customized_bot_creation.png
  - docs/imgs/import_existing_kb.png
@Yukinobu-Mine Yukinobu-Mine self-assigned this Oct 29, 2025
@Yukinobu-Mine Yukinobu-Mine force-pushed the feature/multi-tenancy-for-knowledge-bases branch 3 times, most recently from e02cc8e to 948e1ff Compare October 29, 2025 03:14
@Yukinobu-Mine Yukinobu-Mine force-pushed the feature/multi-tenancy-for-knowledge-bases branch from 948e1ff to 59d62a8 Compare October 29, 2025 03:39
- Omit building of shared Knowledge Bases if not necessary.
- Automatically delete expired lock files using S3's lifecycle rule.
- Add comments and update README.md.
@Yukinobu-Mine Yukinobu-Mine changed the title [WIP]Multi-tenant usage of a shared Knowledge Base. Multi-tenant usage of a shared Knowledge Base. Oct 30, 2025
@Yukinobu-Mine Yukinobu-Mine changed the title Multi-tenant usage of a shared Knowledge Base. Multi-tenant usage of shared Knowledge Bases. Nov 1, 2025
@statefb
Copy link
Contributor

statefb commented Nov 5, 2025

Removed pdk-nag temporarily

Removed from cdk.test due to compatibility issues with upgraded CDK/cdk-nag versions. The old pdk-nag referenced deprecated rules, and upgrading it would require significant refactoring due to package structure changes. Removing temporarily to unblock the main upgrade.

Copy link
Contributor

@statefb statefb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@statefb statefb merged commit d3a866c into v3 Nov 5, 2025
10 checks passed
@statefb statefb deleted the feature/multi-tenancy-for-knowledge-bases branch November 5, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bots are limited to 100 due to knowledge base and opensearch service quotas

2 participants