AWS bedrock documentation change
Summary
Updated knowledge base setup documentation with PostgreSQL metadata handling improvements, Neptune Analytics networking clarification, OpenSearch Serverless field changes, and MongoDB Atlas search index option
Security assessment
Changes focus on metadata management optimizations (GIN indexes), networking configuration updates (Neptune connectivity handled by Bedrock), and documentation clarifications. No explicit security vulnerabilities or security feature additions are mentioned. The AWS Secrets Manager reference was already present and only renumbered.
Diff
diff --git a/bedrock/latest/userguide/knowledge-base-setup.md b/bedrock/latest/userguide/knowledge-base-setup.md index d0cb572ab..e9dcc817a 100644 --- a//bedrock/latest/userguide/knowledge-base-setup.md +++ b//bedrock/latest/userguide/knowledge-base-setup.md @@ -210,0 +211,2 @@ Amazon Aurora (RDS) +You must provide these fields before creating the knowledge base. They connot be updated once the knowledge base has been created. + @@ -216,0 +219,17 @@ metadata | JSON | Bedrock-managed metadata field | `metadataField` | Contains me +custom_metadata | JSONB | Custom metadata field | `customMetadataField` | Optional field that indicates the column where Amazon Bedrock will write all the information of any metadata files from your data sources. + + 2. You must create an index on the columns vector and text for your text and embeddings fields. If you're using the custom metadata field, you must also create a GIN index on this column. GIN indexes can be used to efficiently search for key-value pairs in jsonb documents for metadata filtering. For more information, see [jsonb indexing](https://www.postgresql.org/docs/current/datatype-json.html#JSON-INDEXING) in the _PostgreSQL documentation_. + +Column name | Create index on | Required? +---|---|--- +vector | `CREATE INDEX ON bedrock_integration.bedrock_kb USING hnsw (embedding vector_cosine_ops);` | Yes +text | `CREATE INDEX ON bedrock_integration.bedrock_kb USING gin (to_tsvector('simple', chunks));` | Yes +custom metadata | `CREATE INDEX ON bedrock_integration.bedrock_kb USING gin (custom_metadata);` | Only if you have created the custom metadata column. + + 3. (Optional) If you [added metadata to your files for filtering](./kb-test-config.html), we recommend that you provide the column name in the custom metadata field to store all your metadata in a single column. During [data ingestion](./kb-data-source-sync-ingest.html), this column will be populated with all the information in the metadata files from your data sources. If you choose to provide this field, you must create a GIN index on this column. + +###### Note + +If you frequently use range filters over numerical metadata, then to optimize performance, create an index for the specific key. For example, if you use filters such as `"lessThan": { "key": "year", "value": 1989 }`, create an expression index on the `year` key. For more information, see [Indexes on expressions](https://www.postgresql.org/docs/current/indexes-expressional.html) in the _PostgreSQL documentation_. + + CREATE INDEX ON your_table ((custom_metadata->>'year')::double precision @@ -218 +237 @@ metadata | JSON | Bedrock-managed metadata field | `metadataField` | Contains me - 2. (Optional) If you [added metadata to your files for filtering](./kb-test-config.html), you must also create a column for each metadata attribute in your files and specify the data type (text, number, or boolean). For example, if the attribute `genre` exists in your data source, you would add a column named `genre` and specify`text` as the data type. During [data ingestion](./kb-data-source-sync-ingest.html), these columns will be populated with the corresponding attribute values. +Alternatively, if you don't provide this field name, you can create a column for each metadata attribute in your files and specify the data type (text, number, or boolean). For example, if the attribute `genre` exists in your data source, you would add a column named `genre` and specify `text` as the data type. During [data ingestion](./kb-data-source-sync-ingest.html), these separate columns will be populated with the corresponding attribute values. @@ -220 +239 @@ metadata | JSON | Bedrock-managed metadata field | `metadataField` | Contains me - 3. Configure an AWS Secrets Manager secret for your Aurora DB cluster by following the steps at [Password management with Amazon Aurora and AWS Secrets Manager](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html). + 4. Configure an AWS Secrets Manager secret for your Aurora DB cluster by following the steps at [Password management with Amazon Aurora and AWS Secrets Manager](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html). @@ -222 +241 @@ metadata | JSON | Bedrock-managed metadata field | `metadataField` | Contains me - 4. Take note of the following information after you create your DB cluster and set up the secret. + 5. Take note of the following information after you create your DB cluster and set up the secret. @@ -253 +272 @@ The capacity of your graph can be modified later. We recommend that you start wi - 3. You can leave the default availability settings, and under **Network and Security** , you must enable public access. Neptune Analytics graphs behind a VPC are not supported. + 3. You can leave the default availability settings. Amazon Bedrock will create a networking connection to the Neptune Analytics graph that you associate the knowledge base with. You do not have to configure public connectivity or private endpoints for your graph. @@ -272,9 +290,0 @@ Cohere Embed Multilingual | 1,024 - 3. Expand the **Metadata management** section and add two fields to configure the vector index to store additional metadata that's managed by Amazon Bedrock. The following table describes the fields and the values to specify for each field: - -Field description | Mapping field | Data type | Filterable ----|---|---|--- -Amazon Bedrock chunks the raw text from your data and stores the chunks in this field. | Name of your choice (for example, `text`) | String | True -Amazon Bedrock stores metadata related to your knowledge base in this field, such as the Amazon S3 location of the file that contains this text. | Name of your choice (for example, `bedrock-metadata`) | String | False - - 4. Take note of the names you choose for the vector index name, vector field name, and metadata management mapping field names for when you create your knowledge base. Then choose **Create**. - @@ -289,2 +299,2 @@ Graph ARN | Neptune Analytics Graph ARN | graphARN | The Amazon Resource Name (A -Metadata management (first mapping field) | Text field name | textField | The name of the field in which to store the raw text from your data sources. -Metadata management (second mapping field) | Bedrock-managed metadata field | metadataField | The name of the field in which to store metadata that Amazon Bedrock manages. +Metadata management (first mapping field) | Text field name | textField | The name of the field in which to store the raw text from your data sources. You can provide any value for this field, for example, _text_. +Metadata management (second mapping field) | Bedrock-managed metadata field | metadataField | The name of the field in which to store metadata that Amazon Bedrock manages. You can provide any value for this field, for example, _metadata_. @@ -427,0 +438,2 @@ There are additional configurations for **Field mapping** that you must provide + * **(Optional) Text search index name** – The name of the MongoDB Atlas Search index on your collection. +