Associate a Relevance Generative Answering (RGA) model with a query pipeline
Associate a Relevance Generative Answering (RGA) model with a query pipeline
When a Coveo Machine Learning (Coveo ML) model has been created, it must be associated with a query pipeline to be effective in a search interface.
organization members with the required privileges can access the Machine Learning tab of a query pipeline configuration page to manage Coveo ML model associations for that query pipeline.
When a Relevance Generative Answering (RGA) model is associated with a query pipeline, the model is used to generate answers for queries that are submitted in the search interface that’s associated with the query pipeline.
Notes
|
Associate an RGA model
-
On the Query Pipelines (platform-ca | platform-eu | platform-au) page, click the query pipeline for which you want to associate the model, and then click Edit components in the Action bar.
-
On the subpage that opens, select the Machine Learning tab, and then in the upper-right corner, click Associate Model.
-
In the Model dropdown menu, select the desired model.
-
On the right side, under Condition, you can select a query pipeline condition in the dropdown menu or create a new one.
NoteAn RGA model must be associated with a
Query is not empty
condition. -
Click Associate Model.
Edit an RGA model association
-
On the Query Pipelines (platform-ca | platform-eu | platform-au) page, click the query pipeline for which you want to edit a model association, and then click Edit components in the Action bar.
-
On the subpage that opens, select the Machine Learning tab, click the desired model, and then click Edit in the Action bar.
-
On the right side, under Condition, you can select a query pipeline condition in the dropdown menu or create a new one.
NoteAn RGA model must be associated with a
Query is not empty
condition. -
Click Save.
Dissociate a model
-
On the Query Pipelines (platform-ca | platform-eu | platform-au) page, click the query pipeline from which you want to dissociate a model, and then click Edit components in the Action bar.
-
On the subpage that opens, select the Machine Learning tab.
-
In the Machine Learning tab, click the model you want to dissociate from the pipeline, and then click Dissociate in the Action bar.
RGA model association advanced configuration
You can use the RGA model association advanced configuration to:
-
Modify the maximum number of items that the RGA model considers when retrieving the relevant segments of text (chunks) from which to generate answers.
-
Modify the semantic similarity threshold that’s used by the RGA model to determine whether or not a segment of text (chunk) is relevant to the query.
Modifying the default values for the model association advanced parameters may result in unintended model behavior following a model version upgrade. |
Maximum number of items to consider
RGA uses two stages of content retrieval. First-stage content retrieval identifies the most relevant items in the index, and second-stage content retrieval identifies the most relevant segments of text (chunks) from the items identified during first-stage content retrieval. The answer is generated using the most relevant chunks.
If you find that answers are being generated using text from low relevance documents, you can use the numberOfRankedResultsToConsider
model association parameter to set a custom value for the maximum number of items considered during second-stage content retrieval.
For example, if you set the maximum number of items to 20, the RGA model retrieves the most relevant chunks only from the 20 most relevant items that were retrieved during first-stage content retrieval.
This is an advanced model association configuration that should be used by experienced Coveo administrators only. The default setting of |
To set a custom value for the number of items to consider for RGA
-
On the Query Pipelines (platform-ca | platform-eu | platform-au) page, click the query pipeline to which the RGA model is associated, and then click Edit components in the Action bar.
-
Select the Machine Learning tab, click the RGA model, and then click Edit in the Action bar.
-
On the Edit a Model Association subpage, in the upper-right corner, click , and then click Switch to JSON view.
-
In the confirmation window that appears, click Switch to JSON view.
-
In the JSON editor, add the following
"numberOfRankedResultsToConsider": "<VALUE>"
undercustomQueryParameters
, where<VALUE>
is the maximum number of items.The value must be an integer between
1
and100
(default is100
).ExampleTo set the custom value to 20, the JSON would be as follows:
{ "customQueryParameters":{ "numberOfRankedResultsToConsider": 20 } }
RGA semantic similarity threshold
During second-stage content retrieval, RGA retrieves the most relevant segments of text (chunks) based on semantic similarity with the query. The answer is then generated using the most relevant chunks. A preset similarity threshold, however, determines whether or not a chunk is considered relevant by the RGA model.
Depending on your indexed content, the default semantic similarity threshold may result in one of the following scenarios:
-
An answer isn’t generated due to a lack of relevant chunks (threshold value is too high).
-
An answer is generated, but some of the chunks used to generate the answer are of lower relevance (threshold value is too low).
If you find that answers aren’t being generated, or answers are generated with less relevant chunks, you can use the chunksSimilarityThreshold
model association parameter to set a custom value for the semantic similarity threshold.
This is an advanced model association configuration that should be used by experienced Coveo administrators only. The default setting of |
To set a custom value for the RGA semantic similarity threshold
-
On the Query Pipelines (platform-ca | platform-eu | platform-au) page, click the query pipeline to which the RGA model is associated, and then click Edit components in the Action bar.
-
Select the Machine Learning tab, click the RGA model, and then click Edit in the Action bar.
-
On the Edit a Model Association subpage, in the upper-right corner, click , and then click Switch to JSON view.
-
In the confirmation window that appears, click Switch to JSON view.
-
In the JSON editor, add
"chunksSimilarityThreshold": "<VALUE>"
undercustomQueryParameters
, where<VALUE>
is the threshold value.The value must be a floating-point number between
0
and1.0
(default is0.5
).A higher threshold value means that a chunk needs to be highly similar to the query to be considered relevant. A lower threshold value means that a chunks only needs to be slightly similar to the query to be considered relevant.
ExampleAnswers aren’t being generated with expected regularity, so you decide to lower the semantic similarity threshold to
0.45
. In this case, the JSON would be as follows:{ "customQueryParameters":{ "chunksSimilarityThreshold": 0.45 } }
Rich text formatting
By default, the answers generated by RGA are displayed in the RGA search interface component using plain text. This means that the generated answers don’t include any rich text formatting, such as bold text, code blocks, or tables.
Rich text formatting makes the generated answers more visually appealing and easier to read.
To enable rich text formatting for generated answers, you must enable the enableContentFormat
model association parameter.
RGA supports the following rich text formatting:
-
Headings
-
Strong and emphasized text (bold/italic)
-
Inline and multi-line code blocks
-
Quote blocks
-
Ordered and unordered lists
-
Tables
The following are examples of a generated answer with rich text formatting:
If you’re using the Coveo Headless library for your search interface, besides enabling rich text formatting as detailed in this section, you must also set |
-
On the Query Pipelines (platform-ca | platform-eu | platform-au) page, click the query pipeline to which the RGA model is associated, and then click Edit components in the Action bar.
-
Select the Machine Learning tab, click the RGA model, and then click Edit in the Action bar.
-
On the Edit a Model Association subpage, in the upper-right corner, click , and then click Switch to JSON view.
-
In the confirmation window that appears, click Switch to JSON view.
-
In the JSON editor, add
"enableContentFormat": true
undercustomQueryParameters
to enable rich text formatting.ExampleTo enable rich text formatting, the JSON would be as follows:
{ "customQueryParameters":{ "enableContentFormat": true } }
Reference
Required privileges
By default, members with the required privileges can view and edit elements of the Models (platform-ca | platform-eu | platform-au) page.
The following table indicates the privileges required to use elements of the Models page and associated panels (see Manage privileges and Privilege reference).
Action | Service - Domain | Required access level |
---|---|---|
View model associations |
Machine Learning - Models |
View |
Edit model associations |
Organization - Organization |
View |
Search - Query pipelines |
Edit |