

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 查詢連線至 Amazon Kendra GenAI 指數的知識庫
<a name="kb-test-kendra"></a>

您可以查詢使用 Amazon Kendra GenAI 指數的知識庫，並僅傳回資料來源的相關文字。在此查詢中，使用 [Amazon Bedrock 代理人執行時期端點](https://docs.aws.amazon.com/general/latest/gr/bedrock.html#bra-rt)傳送 [https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html) 請求，例如使用標準知識庫。

從具有 Amazon Kendra GenAI 指數的知識庫傳回的回應結構與標準 [KnowledgeBaseRetrievalResult](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_KnowledgeBaseRetrievalResult.html) 相同。不過，回應也包含來自 Amazon Kendra 的幾個額外欄位。

下表說明您在傳回的回應中可能看到的 Amazon Kendra 欄位。Amazon Bedrock 會從 Amazon Kendra 回應中取得這些欄位。如果該回應不包含這些欄位，則從 Amazon Bedrock 傳回的查詢結果也不會包含這些欄位。


| 欄位 | 說明 | 
| --- | --- | 
|  x-amz-kendra-document-title  |  傳回文件的標題。  | 
|  x-amz-kendra-score-confidence  |  回應與查詢相關性的相對排名。可能的值為 VERY\$1HIGH、HIGH、MEDIUM、LOW 和 NOT\$1AVAILABLE。  | 
|  x-amz-kendra-passage-id  |  傳回段落的 ID。  | 
|  x-amz-kendra-document-id  |  傳回文件的 ID。  | 
|  DocumentAttributes  |  Amazon Kendra 的文件屬性或中繼資料欄位。知識庫傳回的查詢結果會將這些結果存放為中繼資料鍵值對。您可以使用來自 Amazon Bedrock 的中繼資料篩選來篩選結果。如需詳細資訊，請參閱 [DocumentAttribute](https://docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttribute.html)。  | 