Retrievers

Retrievers fetch documents relvant to the query from the document store. They're used in query pipelines.

When given a query, a retriever sifts through the documents in the document store, scores each documents for its relevance to the query, and returns top candidates.

Retriever and document store are tightly coupled. When configuring a retriever, you must always specify and configure the document store.

Available retrievers:

  • FilterRetriever: Retrieves all documents that match given filters, for example specific metadata field values.
  • OpenSearchBM25Retriever: A keyword retriever that looks for keywords shared between the documents and the query.
  • OpenSearchEmbeddingRetriever: A vector retriever that compares query and document embeddings and returns documents that are most similar to the query.
  • SentenceWindowRetrieval: A retriever that enhances context by retrieving surrounding documents.