Choose specific documents from Kendra index for RAG

0

Hi! I want to choose specific document IDs from Kendra index to pass to Bedrock as RAG. How do I do it in RetrieveCommand()? I could not fin d an argument that would correspond to it in this function.

KK
質問済み 2ヶ月前140ビュー
1回答
2

Hi KK,

To filter results to specific document IDs in your Kendra index when using the Retrieve API, you can utilize the AttributeFilter parameter. This parameter allows you to define filtering rules based on document attributes or fields. For instance, if you have a unique identifier or a specific attribute that correlates with your document IDs, you can construct an AttributeFilter to include only documents that match these identifiers.

When indexing documents in Kendra, you can also define custom attributes for your documents. A custom attribute could be any key-value pair that you decide to associate with a document, such as a "DocumentID," "CustomID," or any other identifier that uniquely identifies your documents. For more information on the process of creating custom documents you can refer to this. After that when you call the Retrieve API to fetch documents, you can use the AttributeFilter parameter to specify filtering criteria based on your custom attributes.

More resources on setting up your Retrieve API.

AWS
aykazmi
回答済み 2ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ