Use project data as a data source
You can configure an Amazon Bedrock knowledge base to use data sources that are already configured for your project.
Project data sources
You can include the following data sources from your project:
Amazon S3 bucket
Amazon S3 is an object storage service that stores data as objects within buckets. You can use files in your project's bucket as a data source for a knowledge base.
Amazon Redshift
Amazon Redshift is a serverless data warehouse service that automatically provisions and scales data warehouse capacity to deliver high performance for demanding and unpredictable workloads without the need to manage infrastructure.
You can include all data tables from an Amazon Redshift database or select up to 50 data tables from the available schemas. After selecting the tables, you can select the columms that you want include. You can also preview data from the database, based on the selected columns.
Amazon SageMaker Lakehouse
Amazon SageMaker Lakehouse unifies your data across Amazon S3 data lakes and Amazon Redshift data warehouses.
Create a knowledge base with a project data source
The following procedure shows how to create a knowledge base with an Amazon S3 bucket, an Amazon Redshift data warehouse, or with Amazon SageMaker Lakehouse.
To create a knowledge base with a project data source
-
Navigate to the Amazon SageMaker Unified Studio landing page by using the URL from your administrator.
-
Access Amazon SageMaker Unified Studio using your IAM or single sign-on (SSO) credentials. For more information, see Access Amazon SageMaker Unified Studio.
-
Choose the Build menu at the top of the page.
-
In the MACHINE LEARNING & GENERATIVE AI section, choose My apps.
In the Select or create a new project to continue dialog box, select the project that you want to use.
-
In the left pane, choose Asset gallery.
-
Choose My components.
-
In the Components section, choose Create component and then Knowledge Base. The Create Knowledge Base pane is shown.
-
For Name, enter a name for the Knowledge Base.
-
For Description, enter a description for the Knowledge Base.
-
For Select data source type, select Project data sources.
-
In Select data source, select an existing data source (S3, Redshift, or Lakehouse). Alternatively choose to add a new connection.
-
S3 – Do the following:
For S3 URI enter the the Amazon S3 Uniform Resource Identifier (URI) of the file or folder that you want to use. Alternatively, choose Browse to browse the bucket and choose file or folder.
-
Choose Save to save your changes.
-
Redshift (Lakehouse) – Do the following:
-
For Select a database select the database that you want to use.
-
Choose Update data tables and columns to choose the tables and columns that you want to use. To preview the data from the selections you made, you choose Data.
-
Choose Save to save your changes.
-
-
Lakehouse – Do the following:
-
For Select catalog select the catalog that you want to use.
-
For Select a database select the database that you want to use.
-
Choose Update data tables and columns to choose the tables and columns that you want to use. To preview the data from the selections you made, you choose Data.
-
Choose Save to save your changes.
-
-
(Optional) For Amazon Redshift and Amazon SageMaker Lakehouse data sources you can make the following configuration changes:
-
Maximum query time ‐ Limit the time that a query can take by setting a maximum query time, in seconds.
-
Descriptions ‐ Add descriptions and annotations to the names of tables and columns to improve the accuracy of responses from a chat agent app.
-
Curated queries ‐ Use curated queries that help guide the agent to create better responses. A curated query is an example question along with the matching SQL query for the question.
-
-
-
Choose Create to create the Knowledge Base.
-
Use the Knowledge Base in an app, by doing one of the following:
-
If your app is a chat agent app, do Add an Amazon Bedrock Knowledge Base component to a chat agent app.
-
If your app is a flow app, do Add a Knowledge Base component to a flow app.
-