Skip to content

Commit

Permalink
feat(client-bedrock-agent): This release adds support for using Mongo…
Browse files Browse the repository at this point in the history
…DB Atlas as a vector store when creating a knowledge base.
  • Loading branch information
awstools committed May 1, 2024
1 parent 56df20c commit 93917f7
Show file tree
Hide file tree
Showing 6 changed files with 312 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export interface CreateKnowledgeBaseCommandOutput extends CreateKnowledgeBaseRes
* },
* },
* storageConfiguration: { // StorageConfiguration
* type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD" || "RDS", // required
* type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD" || "RDS" || "MONGO_DB_ATLAS", // required
* opensearchServerlessConfiguration: { // OpenSearchServerlessConfiguration
* collectionArn: "STRING_VALUE", // required
* vectorIndexName: "STRING_VALUE", // required
Expand Down Expand Up @@ -118,6 +118,19 @@ export interface CreateKnowledgeBaseCommandOutput extends CreateKnowledgeBaseRes
* metadataField: "STRING_VALUE", // required
* },
* },
* mongoDbAtlasConfiguration: { // MongoDbAtlasConfiguration
* endpoint: "STRING_VALUE", // required
* databaseName: "STRING_VALUE", // required
* collectionName: "STRING_VALUE", // required
* vectorIndexName: "STRING_VALUE", // required
* credentialsSecretArn: "STRING_VALUE", // required
* fieldMapping: { // MongoDbAtlasFieldMapping
* vectorField: "STRING_VALUE", // required
* textField: "STRING_VALUE", // required
* metadataField: "STRING_VALUE", // required
* },
* endpointServiceName: "STRING_VALUE",
* },
* },
* tags: { // TagsMap
* "<keys>": "STRING_VALUE",
Expand All @@ -139,7 +152,7 @@ export interface CreateKnowledgeBaseCommandOutput extends CreateKnowledgeBaseRes
* // },
* // },
* // storageConfiguration: { // StorageConfiguration
* // type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD" || "RDS", // required
* // type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD" || "RDS" || "MONGO_DB_ATLAS", // required
* // opensearchServerlessConfiguration: { // OpenSearchServerlessConfiguration
* // collectionArn: "STRING_VALUE", // required
* // vectorIndexName: "STRING_VALUE", // required
Expand Down Expand Up @@ -180,6 +193,19 @@ export interface CreateKnowledgeBaseCommandOutput extends CreateKnowledgeBaseRes
* // metadataField: "STRING_VALUE", // required
* // },
* // },
* // mongoDbAtlasConfiguration: { // MongoDbAtlasConfiguration
* // endpoint: "STRING_VALUE", // required
* // databaseName: "STRING_VALUE", // required
* // collectionName: "STRING_VALUE", // required
* // vectorIndexName: "STRING_VALUE", // required
* // credentialsSecretArn: "STRING_VALUE", // required
* // fieldMapping: { // MongoDbAtlasFieldMapping
* // vectorField: "STRING_VALUE", // required
* // textField: "STRING_VALUE", // required
* // metadataField: "STRING_VALUE", // required
* // },
* // endpointServiceName: "STRING_VALUE",
* // },
* // },
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED" || "DELETE_UNSUCCESSFUL", // required
* // createdAt: new Date("TIMESTAMP"), // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface GetKnowledgeBaseCommandOutput extends GetKnowledgeBaseResponse,
* // },
* // },
* // storageConfiguration: { // StorageConfiguration
* // type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD" || "RDS", // required
* // type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD" || "RDS" || "MONGO_DB_ATLAS", // required
* // opensearchServerlessConfiguration: { // OpenSearchServerlessConfiguration
* // collectionArn: "STRING_VALUE", // required
* // vectorIndexName: "STRING_VALUE", // required
Expand Down Expand Up @@ -94,6 +94,19 @@ export interface GetKnowledgeBaseCommandOutput extends GetKnowledgeBaseResponse,
* // metadataField: "STRING_VALUE", // required
* // },
* // },
* // mongoDbAtlasConfiguration: { // MongoDbAtlasConfiguration
* // endpoint: "STRING_VALUE", // required
* // databaseName: "STRING_VALUE", // required
* // collectionName: "STRING_VALUE", // required
* // vectorIndexName: "STRING_VALUE", // required
* // credentialsSecretArn: "STRING_VALUE", // required
* // fieldMapping: { // MongoDbAtlasFieldMapping
* // vectorField: "STRING_VALUE", // required
* // textField: "STRING_VALUE", // required
* // metadataField: "STRING_VALUE", // required
* // },
* // endpointServiceName: "STRING_VALUE",
* // },
* // },
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED" || "DELETE_UNSUCCESSFUL", // required
* // createdAt: new Date("TIMESTAMP"), // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface UpdateKnowledgeBaseCommandOutput extends UpdateKnowledgeBaseRes
* },
* },
* storageConfiguration: { // StorageConfiguration
* type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD" || "RDS", // required
* type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD" || "RDS" || "MONGO_DB_ATLAS", // required
* opensearchServerlessConfiguration: { // OpenSearchServerlessConfiguration
* collectionArn: "STRING_VALUE", // required
* vectorIndexName: "STRING_VALUE", // required
Expand Down Expand Up @@ -106,6 +106,19 @@ export interface UpdateKnowledgeBaseCommandOutput extends UpdateKnowledgeBaseRes
* metadataField: "STRING_VALUE", // required
* },
* },
* mongoDbAtlasConfiguration: { // MongoDbAtlasConfiguration
* endpoint: "STRING_VALUE", // required
* databaseName: "STRING_VALUE", // required
* collectionName: "STRING_VALUE", // required
* vectorIndexName: "STRING_VALUE", // required
* credentialsSecretArn: "STRING_VALUE", // required
* fieldMapping: { // MongoDbAtlasFieldMapping
* vectorField: "STRING_VALUE", // required
* textField: "STRING_VALUE", // required
* metadataField: "STRING_VALUE", // required
* },
* endpointServiceName: "STRING_VALUE",
* },
* },
* };
* const command = new UpdateKnowledgeBaseCommand(input);
Expand All @@ -124,7 +137,7 @@ export interface UpdateKnowledgeBaseCommandOutput extends UpdateKnowledgeBaseRes
* // },
* // },
* // storageConfiguration: { // StorageConfiguration
* // type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD" || "RDS", // required
* // type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD" || "RDS" || "MONGO_DB_ATLAS", // required
* // opensearchServerlessConfiguration: { // OpenSearchServerlessConfiguration
* // collectionArn: "STRING_VALUE", // required
* // vectorIndexName: "STRING_VALUE", // required
Expand Down Expand Up @@ -165,6 +178,19 @@ export interface UpdateKnowledgeBaseCommandOutput extends UpdateKnowledgeBaseRes
* // metadataField: "STRING_VALUE", // required
* // },
* // },
* // mongoDbAtlasConfiguration: { // MongoDbAtlasConfiguration
* // endpoint: "STRING_VALUE", // required
* // databaseName: "STRING_VALUE", // required
* // collectionName: "STRING_VALUE", // required
* // vectorIndexName: "STRING_VALUE", // required
* // credentialsSecretArn: "STRING_VALUE", // required
* // fieldMapping: { // MongoDbAtlasFieldMapping
* // vectorField: "STRING_VALUE", // required
* // textField: "STRING_VALUE", // required
* // metadataField: "STRING_VALUE", // required
* // },
* // endpointServiceName: "STRING_VALUE",
* // },
* // },
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED" || "DELETE_UNSUCCESSFUL", // required
* // createdAt: new Date("TIMESTAMP"), // required
Expand Down
89 changes: 84 additions & 5 deletions clients/client-bedrock-agent/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,7 @@ export interface S3DataSourceConfiguration {
inclusionPrefixes?: string[];

/**
* <p>The account ID for the owner of the S3 bucket.</p>
* <p>The bucket account owner ID for the S3 bucket.</p>
* @public
*/
bucketOwnerAccountId?: string;
Expand Down Expand Up @@ -2379,7 +2379,7 @@ export interface CreateDataSourceRequest {
dataSourceConfiguration: DataSourceConfiguration | undefined;

/**
* <p>The deletion policy for the requested data source</p>
* <p>The data deletion policy assigned to the data source.</p>
* @public
*/
dataDeletionPolicy?: DataDeletionPolicy;
Expand Down Expand Up @@ -2474,7 +2474,7 @@ export interface DataSource {
vectorIngestionConfiguration?: VectorIngestionConfiguration;

/**
* <p>The deletion policy for the data source.</p>
* <p>The data deletion policy for a data source.</p>
* @public
*/
dataDeletionPolicy?: DataDeletionPolicy;
Expand All @@ -2492,7 +2492,7 @@ export interface DataSource {
updatedAt: Date | undefined;

/**
* <p>The details of the failure reasons related to the data source.</p>
* <p>The detailed reasons on the failure to delete a data source.</p>
* @public
*/
failureReasons?: string[];
Expand Down Expand Up @@ -2694,7 +2694,7 @@ export interface UpdateDataSourceRequest {
dataSourceConfiguration: DataSourceConfiguration | undefined;

/**
* <p>The data deletion policy of the updated data source.</p>
* <p>The data deletion policy assigned to the data source.</p>
* @public
*/
dataDeletionPolicy?: DataDeletionPolicy;
Expand Down Expand Up @@ -3239,6 +3239,78 @@ export interface KnowledgeBaseConfiguration {
vectorKnowledgeBaseConfiguration?: VectorKnowledgeBaseConfiguration;
}

/**
* <p>Contains the names of the fields to which to map information about the vector store.</p>
* @public
*/
export interface MongoDbAtlasFieldMapping {
/**
* <p>The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.</p>
* @public
*/
vectorField: string | undefined;

/**
* <p>The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.</p>
* @public
*/
textField: string | undefined;

/**
* <p>The name of the field in which Amazon Bedrock stores metadata about the vector store.</p>
* @public
*/
metadataField: string | undefined;
}

/**
* <p>Contains details about the storage configuration of the knowledge base in MongoDB Atlas. </p>
* @public
*/
export interface MongoDbAtlasConfiguration {
/**
* <p>The endpoint URL of your MongoDB Atlas cluster for your knowledge base.</p>
* @public
*/
endpoint: string | undefined;

/**
* <p>The database name in your MongoDB Atlas cluster for your knowledge base.</p>
* @public
*/
databaseName: string | undefined;

/**
* <p>The collection name of the knowledge base in MongoDB Atlas.</p>
* @public
*/
collectionName: string | undefined;

/**
* <p>The name of the MongoDB Atlas vector search index.</p>
* @public
*/
vectorIndexName: string | undefined;

/**
* <p>The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.</p>
* @public
*/
credentialsSecretArn: string | undefined;

/**
* <p>Contains the names of the fields to which to map information about the vector store.</p>
* @public
*/
fieldMapping: MongoDbAtlasFieldMapping | undefined;

/**
* <p>The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.</p>
* @public
*/
endpointServiceName?: string;
}

/**
* <p>Contains the names of the fields to which to map information about the vector store.</p>
* @public
Expand Down Expand Up @@ -3460,6 +3532,7 @@ export interface RedisEnterpriseCloudConfiguration {
* @enum
*/
export const KnowledgeBaseStorageType = {
MONGO_DB_ATLAS: "MONGO_DB_ATLAS",
OPENSEARCH_SERVERLESS: "OPENSEARCH_SERVERLESS",
PINECONE: "PINECONE",
RDS: "RDS",
Expand Down Expand Up @@ -3505,6 +3578,12 @@ export interface StorageConfiguration {
* @public
*/
rdsConfiguration?: RdsConfiguration;

/**
* <p>Contains the storage configuration of the knowledge base in MongoDB Atlas.</p>
* @public
*/
mongoDbAtlasConfiguration?: MongoDbAtlasConfiguration;
}

/**
Expand Down
10 changes: 10 additions & 0 deletions clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ import {
KnowledgeBase,
KnowledgeBaseConfiguration,
KnowledgeBaseSummary,
MongoDbAtlasConfiguration,
MongoDbAtlasFieldMapping,
OpenSearchServerlessConfiguration,
OpenSearchServerlessFieldMapping,
ParameterDetail,
Expand Down Expand Up @@ -2133,6 +2135,10 @@ const se_InferenceConfiguration = (input: InferenceConfiguration, context: __Ser

// se_KnowledgeBaseConfiguration omitted.

// se_MongoDbAtlasConfiguration omitted.

// se_MongoDbAtlasFieldMapping omitted.

// se_OpenSearchServerlessConfiguration omitted.

// se_OpenSearchServerlessFieldMapping omitted.
Expand Down Expand Up @@ -2636,6 +2642,10 @@ const de_KnowledgeBaseSummary = (output: any, context: __SerdeContext): Knowledg
}) as any;
};

// de_MongoDbAtlasConfiguration omitted.

// de_MongoDbAtlasFieldMapping omitted.

// de_OpenSearchServerlessConfiguration omitted.

// de_OpenSearchServerlessFieldMapping omitted.
Expand Down
Loading

0 comments on commit 93917f7

Please sign in to comment.