Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Filtering chat responses using document attributes and metadata

Focus mode
Filtering chat responses using document attributes and metadata - Amazon Q Business
Note

This section assumes that you have an understanding of document attributes and how they work in Amazon Q.

The Amazon Q Business API includes a feature that lets you filter by document attribute. By using this feature, you can customize and control chat responses for your end user using attributes—or metadata—attached to documents that are mapped to index fields. For example, if data source type is an attribute that's attached to your documents, you can specify that chat responses should 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 to have their chat responses generated using only documents from data sources that they specify.

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 indicate that responses should only be generated from specific authoritative sources within your data.

  • Control response context – You can specify the file type (for example, PDF) and library or collection of documents (for example, business requirements documents) that responses are generated from.

  • Maintain response freshness – You can restrict chat responses to come from only documents that were generated after a specific date.

  • Scope chat responses – You can help your end users to narrow the scope of their responses and get to the right answer more quickly.

Amazon Q Business offers a set of reserved document attributes that you can use. You can also create custom document attributes that better represent your organization’s data and use cases for more finely-tuned chat response control.

Important

Filtering using document attributes in chat is only supported using the API. Boosting search results using document attributes is supported using the console or the API.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.