Setting relevancy preferences
The following tabs provide a procedure to tune the query responses based on document attributes using the console and code examples for the AWS CLI.
- Console
-
To tune the relevancy based on recency or data source
-
Sign in to the AWS Management Console and open the Amazon Q Business console.
-
In Applications, select the name of your application environment from the list of applications.
-
From the left navigation menu under Enhancements, choose Relevance tuning.
-
Enable the attributes to tune the query responses.
-
Drag the attribute to the order you want to prioritize the attributes.
-
To prioritize responses from more recent documents, in Recency, set the Recency Type and Boosting duration. In Recency Type, choose the metadata field you want to use. For Boosting duration, choose the time periods to prioritize when searching through data sources. Documents that were created or updated outside of the specified time periods will not have additional boosting or priority.
-
To prioritize based on data sources, in Sources, choose a data source, and choose Add a source. You can choose up to five data sources to search for documents. Rank the data source based to define the priority to be used for responses.
-
- AWS CLI
-
Update your Amazon Q Business index to apply relevancy tuning
This example shows how to increase the relevancy based on the
_last_update_at
metadata field. In this example, replace eachuser input placeholder
with your own information:aws qbusiness --region
region
update-retriever \ --application-id
\ --retriever-idapplication_id
\ --configuration '{ "nativeIndexConfiguration": { "indexId": "retriever_id
", "boostingOverride": { "_last_updated_at"|"_created_at": { "dateConfiguration": { "boostingLevel": "ONE"|"TWO", "boostingDurationInSeconds":index_id
; } }, "_data_source_id": { "stringConfiguration": { "boostingLevel": "ONE"|"TWO", "attributeValueBoosting": { "long
": "ONE"|"TWO"|"THREE"|"FOUR"|"FIVE", "data_source_id_1
": "ONE"|"TWO"|"THREE"|"FOUR"|"FIVE", ... } } } } } }'data_source_id_1
This example shows an example input. Replace each
user input placeholder
with your own information:aws qbusiness --region us-west-2 update-retriever \ --endpoint-url https://
--no-verify-ssl \ --application-idendpoint-url
--retriever-idapplication_id
\ --configuration '{ "nativeIndexConfiguration": { "indexId": "retriever_id
", "boostingOverride": { "_last_updated_at": { "dateConfiguration": { "boostingLevel": "ONE", "boostingDurationInSeconds": 100 } }, "_data_source_id": { "stringConfiguration": { "boostingLevel": "TWO", "attributeValueBoosting": { "index_id
": "ONE", "data_source_id_1
": "TWO", "data_source_id_1
": "THREE", "data_source_id_1
": "FOUR", "data_source_id_1
": "FIVE" } } } } } }'data_source_id_1