Filtering chat responses using document attributes
Note
This section assumes you have an understanding of document attributes and how they work in Amazon Q.
If you use the API, Amazon Q Business includes a filtering by document attribute feature. With this feature, you can customize and control chat responses for your end user using attributes—or metadata attached to documents mapped to index fields. For example, if data source type is an attribute attached to your documents, you can specify that chat responses be generated only from a specific data source.
Or, you can allow end users to restrict the scope of chat responses using the attribute filters that you have selected. For example, an end user can choose that their chat responses be generated using documents from specific data sources.
Filtering chat responses using metadata has the following key benefits:
-
Q&A on LLM knowledge: Users can ask questions and get answers from the general knowledge that the LLM has.
-
Ensure response relevance and accuracy – You can specify that responses be generated from and limited to authoritative sources within your data
-
Control response context – You can specify the type (PDF, for example) and corpus (Business Requirement Documents, for example) of documents that responses will be generated from.
-
Maintain response freshness – You can restrict chat responses to only documents that were generated after a specific date.
-
Scope chat responses – You can help your end user narrow the scope of their responses and get to the right answer quicker.
Amazon Q Business offers a set of reserved document attributes that you can use. You can also create custom document attributes that are more representative of your organization’s data and use cases for more fine-grained chat response control.
Important
Filtering using document attributes in chat is only supported through the API. Boosting search results using document attributes is supported on both the console and the API.