Vector Database
To use the Search module, you must configure a vector database. A detailed explanation of why this setup is required is provided on the Architecture page. The complete YAML configuration is documented on the Configuration page.
service
| └── search
| | └── vectorDatabase
| | | └── type
| | | └── milvus
| | | | └── user
| | | | └── password
| | | | └── token
| | | | └── endpoint
| | | | └── consistency
| | | | └── reload
| | | | └── index
| | | | | └── type
| | | | | └── params
| | | | | | └── nlist
| | | | └── search
| | | | | └── type
| | | | | └── params
| | | | | | └── nprobe
| | | └── opensearch
| | | | └── awsAuth
| | | | | └── accessKey
| | | | | └── enabled
| | | | | └── region
| | | | | └── secretKey
| | | | └── dimension
| | | | └── host
| | | | └── password
| | | | └── port
| | | | └── useSsl
| | | | └── username
| | | | └── verifyCerts
| | | └── atlas
| | | | └── connectionString
The following vector database types are supported:
-
Milvus. A Milvus deployment typically includes the Milvus Operator, MinIO, etcd, and Pulsar components. It can run on-premises or in the cloud (for example, on Google Cloud Platform or Amazon Web Services). Trial credits are available in the AWS Ohio region, but you may choose another region if needed.
-
OpenSearch: Minimum supported version is 2.19.0
To enable a specific database type, configure the corresponding parameters in the YAML file as described below. All stored data is de-identified and represented only as vectors.
Note
Milvus and OpenSearch credentials can be provided through environment variables. These variables have priority over the corresponding values specified in config.yaml:
FACEAPI_MILVUS_USERFACEAPI_MILVUS_PASSWORDFACEAPI_MILVUS_TOKENFACEAPI_OPENSEARCH_USERNAMEFACEAPI_OPENSEARCH_PASSWORD
OpenSearch does not provide token-based authentication out of the box. When using AWS OpenSearch, use AWS authentication with accessKey and secretKey.
| Parameter | Type | Default | Description |
|---|---|---|---|
vectorDatabase → type |
string | milvus, opensearch, atlas |
The vector database type. |
milvus → user |
string | — | The user for connecting to the Milvus instance. If both user and password are provided, the system will include the corresponding header in every RPC call. Can be set using the FACEAPI_MILVUS_USER environment variable, which has priority over the value specified in config.yaml. |
milvus → password |
string | — | The password corresponding to the specified user. Can be set using the FACEAPI_MILVUS_PASSWORD environment variable, which has priority over the value specified in config.yaml. |
milvus → token |
string | — | Serves as the key for identification and authentication purposes. When a token is provided, the system adds the corresponding header to each RPC call. Users can use either user+password or token. If both are filled, the system logs in using user+password. Can be set using the FACEAPI_MILVUS_TOKEN environment variable, which has priority over the value specified in config.yaml. |
milvus → endpoint |
string | http://localhost:19530 |
The endpoint URL for the Milvus instance. |
milvus → consistency |
string | "Bounded" |
The consistency level to use when searching in a collection. Options for consistency level include Strong, Bounded, Eventually, Session, and Customized. |
milvus → reload |
boolean | false | If set to true, checks that collections for searching are in memory and loads them if not. If set to false, this option is disabled. |
milvus → index |
map | — | Parameters for the index to achieve better search performance. |
index → type |
string | "IVF_FLAT" |
Index type, see the Milvus documentation for details. |
index → params → nlist |
integer | 128 |
Number of cluster units, see the IVF_FLAT article for details. |
search → type |
string | "L2" |
The similarity metric type, metrics used to measure similarity of vectors, see the Similarity Metrics article for details. |
search → params → nprobe |
integer | 5 |
Number of units to query, see the IVF_FLAT article for details. |
opensearch → awsAuth → accessKey |
string | — | AWS access key ID used for authenticating requests to an OpenSearch cluster that is protected with AWS SigV4. |
opensearch → awsAuth → enabled |
boolean | false |
Enables AWS SigV4 authentication for OpenSearch. Set to true when using AWS OpenSearch with access key and secret key authentication. |
opensearch → awsAuth → region |
string | — | AWS region where the OpenSearch cluster is hosted (for example, us-east-1). Required when awsAuth.enabled is true. |
opensearch → awsAuth → secretKey |
string | — | AWS secret access key paired with the access key ID. Used to sign requests to OpenSearch. |
opensearch → password |
string | "" |
Password for the specified OpenSearch user. Can be set using the FACEAPI_OPENSEARCH_PASSWORD environment variable, which has priority over the value specified in config.yaml. |
opensearch → username |
string | admin |
Username for OpenSearch authentication. Can be set using the FACEAPI_OPENSEARCH_USERNAME environment variable, which has priority over the value specified in config.yaml. |
opensearch → dimension |
integer | 512 |
Dimensionality of the vector embeddings stored in the OpenSearch k-NN index. Must match your model’s embedding size. |
opensearch → host |
string | localhost |
OpenSearch host name or IP. |
opensearch → port |
string | "9200" |
OpenSearch port. |
opensearch → useSsl |
boolean | false |
Whether to enable HTTPS. |
opensearch → verifyCerts |
boolean | false |
Whether to verify server SSL certificates when useSsl is true. |
atlas → connectionString |
string | — | MongoDB Atlas connection string, for example, mongodb+srv://<user>:<password>@<cluster>/<db>?retryWrites=true&w=majority&appName=<app>. |