Associate a Passage Retrieval (CPR) model with a query pipeline
Associate a Passage Retrieval (CPR) 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 Passage Retrieval (CPR) model is associated with a query pipeline, the model retrieves the passages that a large language model (LLM) will use to generate an output for a query submitted in the associated application.
Notes
|
Associate a CPR 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.
-
Click Associate Model.
Edit a CPR 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.
-
Click Save.
Dissociate a CPR 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.
CPR model association advanced configuration
You can use the CPR model association advanced configuration to modify the maximum number of items that the CPR model considers when retrieving the relevant text segments (passages) from which your LLM will generate outputs.
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
CPR 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 (passages) from those items. The most relevant passages will then be used by your LLM application.
If you find that your LLM application generates an output using text from low relevance items, you can use the numberOfDocumentsToConsider
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 CPR model retrieves the most relevant passages only from the 20 most relevant items identified 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 CPR
-
On the Query Pipelines (platform-ca | platform-eu | platform-au) page, click the query pipeline associated with the CPR model, and then click Edit components in the Action bar.
-
Select the Machine Learning tab, click the CPR 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, click Switch to JSON view.
-
In the JSON editor, add
"numberOfDocumentsToConsider": "<VALUE>"
undercustomQueryParameters
, where<VALUE>
is the maximum number of items.The value must be an integer between
1
and100
(default is40
).ExampleTo set the custom value to 50, the JSON would be:
{ "passageRetrieval":{ "numberOfDocumentsToConsider": 50 } }
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 |
What’s next?
Use the Passage Retrieval API to extract the passages that were retrieved by the CPR model to use in your LLM-powered application.