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
posta 2 mesi fa141 visualizzazioni
1 Risposta
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
con risposta 2 mesi fa
profile picture
ESPERTO
verificato un mese fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande