Milvus search integration setup
Plus Enterprise
Milvus is a vector database that you can use for handling large-scale datasets. For applications requiring 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.
Selecting Milvus
To select Milvus as the search integration, use one of the following procedures:
-
Selecting Milvus search integration from the Integrations page
- After you create a watsonx Assistant instance, go to Home > Integrations.
- Click Open inside the Search tile to view the Open Search window.
- In the Open Search window, select the
Draft
option if you want to set up Custom service in your assistant’s draft environment. If you want to set up Custom service in your assistant’s live environment, select theLive
option. - In the Edit an existing new search integration window, select the Milvus tile.
-
Selecting Milvus search integration from the Environments page
-
After you create a watsonx Assistant instance, go to Home > Environments.
-
Select the
Draft
tab if you want to set up Milvus in the draft environment. If you want to set up Milvus in the live environment, select theLive
tab. -
In the Resolution methods section, click Add inside the Search tile under Extensions if you want to add a Milvus search integration.
If you already added the Milvus search integration, you see the Open button instead of Add inside the Search tile under Extensions.
-
In the
Set up a new search extension
window, select the Milvus tile to see theSearch integration
dialog.
-
Setting up Milvus
To set up Milvus on your assistant, use the following procedure:
In the Connect your search provider section of the Milvus window,
-
Provide the following fields to enable your assistant to connect to your Milvus instance:
- URL
- GRPC port (optional)
- Choose an authentication type
- If you select
Basic authentication
, you must provide 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.
- If you select
-
Click Next to go to Select data source and provide the following details:
- In Database, select your preferred database.
- In Choose collection, select your collection.
- In Choose index, select the index.
- In Choose embedding_model_id, select your model.
-
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. -
In the Configure result content section, provide the following fields to map the title, body, and URL to the search response:
-
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.
-
-
Expand the Advanced Milvus settings section to define Filter.
For more information on defining filter expression examples, see Filter expression examples
-
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.
-
Skip this step if you do not want to change 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 from initial setup.
-
Click Save and then Close to finish the Milvus setup.
Defining filter expression
You define the filter as a string to filter the Milvus search results. For more information, see Milvus-filter-search.
Few filter expression examples:
Contains
title like "%action%"
This filter expression allows only the search results with title containing 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 title containing the word "action" and 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 may not 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
.