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
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠