Skip to content

Commit 2136820

Browse files
authored
feat(bedrock): add support for MongoDbAtlas and supplemental data storage in KB (#1079)
* chore(bedrock): add mongodbatlas support in kb and add support for supplemental data storage
1 parent 86c6d15 commit 2136820

23 files changed

+1011
-15
lines changed

apidocs/@cdklabs/namespaces/bedrock/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- [SalesforceObjectType](enumerations/SalesforceObjectType.md)
4141
- [SharePointDataSourceAuthType](enumerations/SharePointDataSourceAuthType.md)
4242
- [SharePointObjectType](enumerations/SharePointObjectType.md)
43+
- [SupplementalDataStorageLocationType](enumerations/SupplementalDataStorageLocationType.md)
4344
- [TransformationStep](enumerations/TransformationStep.md)
4445
- [VectorStoreType](enumerations/VectorStoreType.md)
4546
- [VectorType](enumerations/VectorType.md)
@@ -88,6 +89,7 @@
8889
- [S3DataSource](classes/S3DataSource.md)
8990
- [SalesforceDataSource](classes/SalesforceDataSource.md)
9091
- [SharePointDataSource](classes/SharePointDataSource.md)
92+
- [SupplementalDataStorageLocation](classes/SupplementalDataStorageLocation.md)
9193
- [ToolChoice](classes/ToolChoice.md)
9294
- [Topic](classes/Topic.md)
9395
- [VectorKnowledgeBase](classes/VectorKnowledgeBase.md)
@@ -160,13 +162,18 @@
160162
- [SharePointCrawlingFilters](interfaces/SharePointCrawlingFilters.md)
161163
- [SharePointDataSourceAssociationProps](interfaces/SharePointDataSourceAssociationProps.md)
162164
- [SharePointDataSourceProps](interfaces/SharePointDataSourceProps.md)
165+
- [SupplementalDataStorageS3Config](interfaces/SupplementalDataStorageS3Config.md)
163166
- [TextPromptVariantProps](interfaces/TextPromptVariantProps.md)
164167
- [ToolConfiguration](interfaces/ToolConfiguration.md)
165168
- [VectorKnowledgeBaseAttributes](interfaces/VectorKnowledgeBaseAttributes.md)
166169
- [VectorKnowledgeBaseProps](interfaces/VectorKnowledgeBaseProps.md)
167170
- [WebCrawlerDataSourceAssociationProps](interfaces/WebCrawlerDataSourceAssociationProps.md)
168171
- [WebCrawlerDataSourceProps](interfaces/WebCrawlerDataSourceProps.md)
169172

173+
## Type Aliases
174+
175+
- [SupplementalDataStorageLocationConfig](type-aliases/SupplementalDataStorageLocationConfig.md)
176+
170177
## Variables
171178

172179
- [REGION\_TO\_GEO\_AREA](variables/REGION_TO_GEO_AREA.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
[**@cdklabs/generative-ai-cdk-constructs**](../../../../README.md)
2+
3+
***
4+
5+
[@cdklabs/generative-ai-cdk-constructs](../../../../README.md) / [bedrock](../README.md) / SupplementalDataStorageLocation
6+
7+
# Class: SupplementalDataStorageLocation
8+
9+
Represents a supplemental data storage location for images extracted from multimodal documents in your data source.
10+
11+
## Constructors
12+
13+
### Constructor
14+
15+
> **new SupplementalDataStorageLocation**(`type`, `locationConfig`): `SupplementalDataStorageLocation`
16+
17+
Creates a new SupplementalDataStorageLocation
18+
19+
#### Parameters
20+
21+
##### type
22+
23+
[`S3`](../enumerations/SupplementalDataStorageLocationType.md#s3)
24+
25+
The type of the storage location
26+
27+
##### locationConfig
28+
29+
[`SupplementalDataStorageS3Config`](../interfaces/SupplementalDataStorageS3Config.md)
30+
31+
The configuration for the storage location
32+
33+
#### Returns
34+
35+
`SupplementalDataStorageLocation`
36+
37+
## Properties
38+
39+
### locationConfig
40+
41+
> `readonly` **locationConfig**: [`SupplementalDataStorageS3Config`](../interfaces/SupplementalDataStorageS3Config.md)
42+
43+
The configuration for the storage location
44+
45+
***
46+
47+
### type
48+
49+
> `readonly` **type**: [`S3`](../enumerations/SupplementalDataStorageLocationType.md#s3)
50+
51+
The type of the storage location
52+
53+
## Methods
54+
55+
### \_\_render()
56+
57+
> **\_\_render**(): `SupplementalDataStorageLocationProperty`
58+
59+
**`Internal`**
60+
61+
Renders as Cfn Property
62+
This is an internal core function and should not be called directly.
63+
64+
#### Returns
65+
66+
`SupplementalDataStorageLocationProperty`
67+
68+
***
69+
70+
### s3()
71+
72+
> `static` **s3**(`config`): `SupplementalDataStorageLocation`
73+
74+
Creates a new S3 supplemental data storage location
75+
76+
#### Parameters
77+
78+
##### config
79+
80+
[`SupplementalDataStorageS3Config`](../interfaces/SupplementalDataStorageS3Config.md)
81+
82+
The configuration for the storage location
83+
84+
#### Returns
85+
86+
`SupplementalDataStorageLocation`
87+
88+
A new SupplementalDataStorageLocation instance

apidocs/@cdklabs/namespaces/bedrock/classes/VectorKnowledgeBase.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ The type of knowledge base.
195195

196196
### vectorStore
197197

198-
> `readonly` **vectorStore**: [`ExistingAmazonAuroraVectorStore`](../../amazonaurora/classes/ExistingAmazonAuroraVectorStore.md) \| [`AmazonAuroraVectorStore`](../../amazonaurora/classes/AmazonAuroraVectorStore.md) \| [`VectorCollection`](../../opensearchserverless/classes/VectorCollection.md) \| [`PineconeVectorStore`](../../pinecone/classes/PineconeVectorStore.md)
198+
> `readonly` **vectorStore**: [`ExistingAmazonAuroraVectorStore`](../../amazonaurora/classes/ExistingAmazonAuroraVectorStore.md) \| [`AmazonAuroraVectorStore`](../../amazonaurora/classes/AmazonAuroraVectorStore.md) \| [`MongoDBAtlasVectorStore`](../../mongodbAtlas/classes/MongoDBAtlasVectorStore.md) \| [`VectorCollection`](../../opensearchserverless/classes/VectorCollection.md) \| [`PineconeVectorStore`](../../pinecone/classes/PineconeVectorStore.md)
199199
200200
The vector store for the knowledge base.
201201

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[**@cdklabs/generative-ai-cdk-constructs**](../../../../README.md)
2+
3+
***
4+
5+
[@cdklabs/generative-ai-cdk-constructs](../../../../README.md) / [bedrock](../README.md) / SupplementalDataStorageLocationType
6+
7+
# Enumeration: SupplementalDataStorageLocationType
8+
9+
## Enumeration Members
10+
11+
### S3
12+
13+
> **S3**: `"S3"`
14+
15+
Contains information about the Amazon S3 location for the extracted images.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[**@cdklabs/generative-ai-cdk-constructs**](../../../../README.md)
2+
3+
***
4+
5+
[@cdklabs/generative-ai-cdk-constructs](../../../../README.md) / [bedrock](../README.md) / SupplementalDataStorageS3Config
6+
7+
# Interface: SupplementalDataStorageS3Config
8+
9+
## Properties
10+
11+
### uri
12+
13+
> `readonly` **uri**: `string`
14+
15+
The S3 URI for the storage location

apidocs/@cdklabs/namespaces/bedrock/interfaces/VectorKnowledgeBaseProps.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ The name of the knowledge base.
105105

106106
***
107107

108+
### supplementalDataStorageLocations?
109+
110+
> `readonly` `optional` **supplementalDataStorageLocations**: [`SupplementalDataStorageLocation`](../classes/SupplementalDataStorageLocation.md)[]
111+
112+
The supplemental data storage locations for the knowledge base
113+
114+
***
115+
108116
### vectorField?
109117

110118
> `readonly` `optional` **vectorField**: `string`
@@ -138,11 +146,11 @@ if vector store is of `VectorCollection` type.
138146

139147
### vectorStore?
140148

141-
> `readonly` `optional` **vectorStore**: [`ExistingAmazonAuroraVectorStore`](../../amazonaurora/classes/ExistingAmazonAuroraVectorStore.md) \| [`AmazonAuroraVectorStore`](../../amazonaurora/classes/AmazonAuroraVectorStore.md) \| [`VectorCollection`](../../opensearchserverless/classes/VectorCollection.md) \| [`PineconeVectorStore`](../../pinecone/classes/PineconeVectorStore.md)
149+
> `readonly` `optional` **vectorStore**: [`ExistingAmazonAuroraVectorStore`](../../amazonaurora/classes/ExistingAmazonAuroraVectorStore.md) \| [`AmazonAuroraVectorStore`](../../amazonaurora/classes/AmazonAuroraVectorStore.md) \| [`MongoDBAtlasVectorStore`](../../mongodbAtlas/classes/MongoDBAtlasVectorStore.md) \| [`VectorCollection`](../../opensearchserverless/classes/VectorCollection.md) \| [`PineconeVectorStore`](../../pinecone/classes/PineconeVectorStore.md)
142150
143151
The vector store for the knowledge base. Must be either of
144152
type `VectorCollection`, `RedisEnterpriseVectorStore`,
145-
`PineconeVectorStore` or `AmazonAuroraVectorStore`.
153+
`PineconeVectorStore`, `AmazonAuroraVectorStore`, or `MongoDBAtlasVectorStore`.
146154

147155
#### Default
148156

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[**@cdklabs/generative-ai-cdk-constructs**](../../../../README.md)
2+
3+
***
4+
5+
[@cdklabs/generative-ai-cdk-constructs](../../../../README.md) / [bedrock](../README.md) / SupplementalDataStorageLocationConfig
6+
7+
# Type Alias: SupplementalDataStorageLocationConfig
8+
9+
> **SupplementalDataStorageLocationConfig** = [`SupplementalDataStorageS3Config`](../interfaces/SupplementalDataStorageS3Config.md)
10+
11+
Union type for all possible location configurations
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[**@cdklabs/generative-ai-cdk-constructs**](../../../README.md)
2+
3+
***
4+
5+
[@cdklabs/generative-ai-cdk-constructs](../../../README.md) / mongodbAtlas
6+
7+
# mongodbAtlas
8+
9+
## Classes
10+
11+
- [MongoDBAtlasVectorStore](classes/MongoDBAtlasVectorStore.md)
12+
13+
## Interfaces
14+
15+
- [MongoDbAtlasFieldMapping](interfaces/MongoDbAtlasFieldMapping.md)
16+
- [MongoDBAtlasVectorStoreProps](interfaces/MongoDBAtlasVectorStoreProps.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[**@cdklabs/generative-ai-cdk-constructs**](../../../../README.md)
2+
3+
***
4+
5+
[@cdklabs/generative-ai-cdk-constructs](../../../../README.md) / [mongodbAtlas](../README.md) / MongoDBAtlasVectorStore
6+
7+
# Class: MongoDBAtlasVectorStore
8+
9+
Construct for MongoDB Atlas vector store
10+
11+
## Constructors
12+
13+
### Constructor
14+
15+
> **new MongoDBAtlasVectorStore**(`props`): `MongoDBAtlasVectorStore`
16+
17+
Creates a new instance of the MongoDBAtlas class
18+
19+
#### Parameters
20+
21+
##### props
22+
23+
[`MongoDBAtlasVectorStoreProps`](../interfaces/MongoDBAtlasVectorStoreProps.md)
24+
25+
The properties for the MongoDB Atlas vector store
26+
27+
#### Returns
28+
29+
`MongoDBAtlasVectorStore`
30+
31+
## Properties
32+
33+
### collectionName
34+
35+
> `readonly` **collectionName**: `string`
36+
37+
The name of the collection
38+
39+
***
40+
41+
### credentialsSecretArn
42+
43+
> `readonly` **credentialsSecretArn**: `string`
44+
45+
The ARN of the secret containing MongoDB Atlas credentials
46+
47+
***
48+
49+
### databaseName
50+
51+
> `readonly` **databaseName**: `string`
52+
53+
The name of the database
54+
55+
***
56+
57+
### endpoint
58+
59+
> `readonly` **endpoint**: `string`
60+
61+
The endpoint URL for MongoDB Atlas
62+
63+
***
64+
65+
### endpointServiceName
66+
67+
> `readonly` **endpointServiceName**: `string`
68+
69+
The name of the endpoint service
70+
71+
***
72+
73+
### fieldMapping
74+
75+
> `readonly` **fieldMapping**: [`MongoDbAtlasFieldMapping`](../interfaces/MongoDbAtlasFieldMapping.md)
76+
77+
The field mapping for MongoDB Atlas
78+
79+
***
80+
81+
### vectorIndexName
82+
83+
> `readonly` **vectorIndexName**: `string`
84+
85+
The name of the vector index
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[**@cdklabs/generative-ai-cdk-constructs**](../../../../README.md)
2+
3+
***
4+
5+
[@cdklabs/generative-ai-cdk-constructs](../../../../README.md) / [mongodbAtlas](../README.md) / MongoDBAtlasVectorStoreProps
6+
7+
# Interface: MongoDBAtlasVectorStoreProps
8+
9+
Interface for MongoDB Atlas vector store configuration
10+
11+
## Properties
12+
13+
### collectionName
14+
15+
> `readonly` **collectionName**: `string`
16+
17+
The name of the collection
18+
19+
***
20+
21+
### credentialsSecretArn
22+
23+
> `readonly` **credentialsSecretArn**: `string`
24+
25+
The ARN of the secret containing MongoDB Atlas credentials
26+
27+
***
28+
29+
### databaseName
30+
31+
> `readonly` **databaseName**: `string`
32+
33+
The name of the database
34+
35+
***
36+
37+
### endpoint
38+
39+
> `readonly` **endpoint**: `string`
40+
41+
The endpoint URL for MongoDB Atlas
42+
43+
***
44+
45+
### endpointServiceName
46+
47+
> `readonly` **endpointServiceName**: `string`
48+
49+
The name of the endpoint service
50+
51+
***
52+
53+
### fieldMapping
54+
55+
> `readonly` **fieldMapping**: [`MongoDbAtlasFieldMapping`](MongoDbAtlasFieldMapping.md)
56+
57+
The field mapping for MongoDB Atlas
58+
59+
***
60+
61+
### vectorIndexName
62+
63+
> `readonly` **vectorIndexName**: `string`
64+
65+
The name of the vector index

0 commit comments

Comments
 (0)