IBM Cloud Docs
Milvus search integration setup

Milvus search integration setup

Plus Enterprise

Milvus is a vector database that you can use for handling large-scale datasets. For applications that require real-time search capabilities and numerous concurrent users, you can use Milvus, which has a distributed architecture, high performance, and flexible data model.

You can have only one search integration per environment. When you change the existing search integration to other integration types such as IBM Watson® Discovery, Elasticsearch or Custom service, the settings of the existing search integration are overwritten.

Prerequisites for connecting Milvus to assistant

Connecting Milvus to assistant

Integrating Milvus in assistant involves three platforms.

  1. watsonx Assistant, where we build the integration.
  2. watsonx.data, where we are provisioning the Milvus instance.
  3. watsonx.ai, where we are building the data source called collections.

Connecting to watsonx.data to set up Milvus

After you select Milvus as the search integration, use data on your Milvus instance in watsonx.data to set up Milvus on your assistant.

Connect Milvus data

For more information on creating a Milvus instance in watsonx.data, see Prerequisites for Milvus integration.

You can use the Connect Milvus to connect to the Milvus service inside watsonx.data. In the Connect your search provider section, provide the following fields from watsonx.data to enable your assistant to connect to your Milvus instance.

  • GRPC host and GRPC port

    To get the details of GRPC host and GRPC port, see Connection details.

    Connection details

  • Choose an authentication type

    • If you select Basic authentication, you must provide a username and password.
    • If you select watsonx.data API key, you must provide the corresponding API key.
    • if you select None, you cannot provide any other authentication details.

    For more information about credentials, see Getting credentials.

Ingesting data into the Milvus vector database through watsonx.ai

After you collect information from watsonx.data, you must ingest data into the Milvus database to use in watsonx Assistant.

In the Milvus window of your assistant, click Next to go to Select data source and provide the following details:

Creating a collection

  • In Choose index, select the index.
  • In Choose embedding_model_id, select your model.

For more information on the supported embedding models, see Embedding models.

Your selected model must align with the model that you used to create your index.

Configuring the result content

After you connect Milvus by selecting the data source, you can configure how the search response displays in the Milvus window of your assistant. In the Configure result content section of Select data source, provide the following fields to map the title, body, and URL from Milvus to the search response in assistant window:

  • Title Search result title. Use the title, name, or similar type of field from the collection as the search result title. Select something for the title or no search result response is displayed in the Facebook and Slack integrations.

  • Body Search result description. Use an abstract, summary, or highlight field from the collection as the search result body. Select something for the body or no search result response is displayed in the Facebook and Slack integrations.

  • URL This field can be populated with any footer content that you want to include at the end of the search result.

Enabling conversational search in Milvus

After you configure the result content, click Next to go to Conversational search (optional).

Conversational search is available only in the Plus and Enterprise plans of watsonx Assistant.

To activate conversational search, switch the Conversational Search toggle to on. For more information, see Conversational search.

Defining filter expression

Expand the Advanced Milvus settings section to define Filter.

You define the filter as a string to filter the Milvus search results. For more information, see Milvus-filter-search. For more information on filter expression examples, see Filter expression examples.

Filtering expression examples

After you configure the result content, click Next to go to Conversational search (optional).

Conversational search is available only in the Plus and Enterprise plans of watsonx Assistant.

To activate conversational search, switch the Conversational Search toggle to on. For more information, see Conversational search.

Defining filter expression

Expand the Advanced Milvus settings section to define Filter.

The following examples help you to define a filter expression.

For more information on filter expression examples, see Filter expression examples.

Tuning your conversational search

You can tune your conversational search’s tendency to say “I don’t know" and the generated response length. Use the Message, No results found, and Connectivity issue tabs to customize different messages to share with users based on the successfulness of the search.

Search result messages
Tab Scenario Example message
Message Search results are returned I found this information that might be helpful:
No results found No search results are found I searched my knowledge base for information that might address your query, but did not find anything useful to share.
Connectivity issue I was unable to complete the search for some reason I might have information that could help address your query, but am unable to search my knowledge base at the moment.

You can skip this step if you do not want to change the Milvus instance details. If you want to change the Milvus instance credentials, click the Instance tab, change the authentication type, or edit the credentials, and then click Save. If you want to change the Milvus instance URL, click the Update button next to the URL that takes you to Step 1 to start the initial setup.

Click Save and then Close to finish the Milvus setup.

Filtering expression examples

The following examples help you to define a filter expression.

Contains

title like "%action%"

This filter expression allows only the search results with title that contains the word action.

Doesn't contain

not (title like "%action%")

This filter expression allows only the search results with title not containing the word action.

Equal

"Understand your most and least successful actions"

This filter expression allows only the search results with title equal to the phrase Understand your most and least successful actions.

Doesn't Equal

"Understand your most and least successful actions"

This filter expression allows only the search results with title not equal to the phrase Understand your most and least successful actions.

Nested filter expression

(title like "%action%") and (url in ["www.url1.com", "www.url2.com"])

This filter expression allows only the search results with the title that contains the word "action" and the url being one of ["www.url1.com", "www.url2.com"].

Configuring your assistant to use Milvus

After you configure the Milvus search integration, you must configure your assistant to use Milvus when the response matches no action. For more information about updating No matches to use search, see Use search when no action matches.

Testing Milvus

You can test search integration with Milvus in actions preview, the preview page, or by using the preview link.

You cannot see proper results in your preview when conversational search is off.

In this example, the user asks, What is an action?.

A text-based reply from the best results in your knowledge base displays when conversational search is on.

ConversationalSearchToggleOn