Setting up a Milvus vector store

Milvus is a vector database that is designed for scalable similarity search.

You can associate a Milvus vector store with a foundation model prompt to use information from documents in the store to ground the prompt input in current facts.

Before you can associate a Milvus vector store with a foundation model prompt, you must perform the one-time task of setting up a connection to the Milvus vector store.

Prerequisite step

Although the Prompt Lab refers to the Milvus vector store option as watsonx.data Milvus, you can connect to either a stand-alone Milvus vector store or a Milvus vector store that is set up in watsonx.data.

Regardless of where the data store is hosted, create a Milvus connector instead of the watsonx.data Milvus connector to connect to your store.

For more information about setting up the connection, see Milvus connection.

If you specify a certificate for the connection, you must specify a certificate that is signed by a known certificate authority. A self-signed SSL certificate is not sufficient.

Getting Milvus data store details manually

If the data store is hosted in watsonx.data, follow these steps to get the data store details to specify when you create the Milvus connector.

Collect the details about the data source connection.

  1. From the Milvus service in the watsonx.data console, make a note of the gRPC host value.

    gRPC is a Remote Procedure Call (RPC) framework that enables distributed services to communicate.

    For example, the gRPC host value might be 5c3c2a83-b4gg-4d96-8da4-5a2f1739a496.example.appdomain.cloud:30439

  2. From the IBM Cloud console, create a personal API key and store it securely.

    For more information, see Managing user API keys.

  3. From the overview page of your watsonx.ai project, click the Assets tab, and then choose New asset > Ground gen AI with vectorized documents.

  4. In the Vector database details section, choose Select or create a connection, and then choose Create connection.

  5. Add a name for the connection.

  6. For the connection details, convert the gRPC host value that you noted earlier into separate host and port properties.

    For example, if the gRPC host value is 5c3c2a83-b4gg-4d96-8da4-5a2f1739a496.example.appdomain.cloud:30439, specify the properties as follows:

    • host: Segment of the value before the colon. For example, 5c3c2a83-b4gg-4d96-8da4-5a2f1739a496.example.appdomain.cloud.
    • port: Segment of the value after the colon. For example, 30439.
  7. Define the credentials for the connection.

    • When you specify the username, use the following format:

      ibmlhapikey_<your-email-id>
      
    • Use the personal API key that you created earlier as the password for the connection.

  8. Verify that the Port is SSL-enabled option is selected.

  9. If you include a certificate, you must specify a certificate that is signed by a known certificate authority. A self-signed SSL certificate is not sufficient.

  10. Click Create.

Creating a connection to the data store

  1. Follow the steps in Creating a vector index.

    Choose watsonx.data Milvus as the vector store type, and then select the vector store that you created in the prerequisite step.

Learn more

Parent topic: Creating a vector index