# Document retrievers

In the inference workflow of a Retrieval-Augmented Generation (RAG) application, document retrievers play a crucial role in accessing stored vectorized data. By efficiently retrieving relevant information, they enhance the system's ability to provide accurate and contextually relevant responses.

### Available Document Retrievers

Dynamiq offers a variety of document retrievers, each with unique features and configurations. Let's explore these options:

<figure><img src="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2F013YbsAtuEcRkZeiDYkL%2Fimage.png?alt=media&#x26;token=60f7e2ae-d91c-4186-9262-22a8986d16e6" alt="" width="198"><figcaption></figcaption></figure>

#### Weaviate Retriever

<figure><img src="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2FNw0TIBAHOYN8aI0OOPZo%2Fimage.png?alt=media&#x26;token=75be4a0b-3692-41fe-83f6-2c09cc844e4d" alt="" width="315"><figcaption></figcaption></figure>

**Configuration**

* **Name:** Provide a name for the retriever.
* **Connection:** Establish a connection to Weaviate, a vector database optimized for retrieval.
* **Index Name:** Specify the index name for retrieval.
* **Max Documents:** Set the maximum number of documents to retrieve.
* **Filters:** Apply filters to refine search results.
* **Options:**
  * **Use hybrid search:** Enables hybrid search.
    * **Alpha:** Adjusts the balance between keyword and vector search.
* **Advanced configuration:**
  * **Content Key:**  Specify custom field name used to store content in the storage.

#### Pinecone Retriever

<figure><img src="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2FVGpDE0ZWOlW6qItfHFmv%2Fimage.png?alt=media&#x26;token=e3652db8-c66f-4df0-8519-1e77f845eb79" alt="" width="315"><figcaption></figcaption></figure>

**Configuration**

* **Name:** Provide a name for the retriever.
* **Connection:** Connect to Pinecone, a scalable vector database service.
* **Index Name:** Specify the index name for retrieval.
* **Namespace:** Use namespaces to segment data.
* **Max Documents:** Limit the number of documents retrieved.
* **Filters:** Use filters to narrow down results.
* **Advanced configuration:**
  * **Content Key:**  Specify custom field name used to store content in the storage.

#### Chroma Retriever

<figure><img src="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2FOddZPr77QFjqy6w0YV07%2Fimage.png?alt=media&#x26;token=00229fdb-51ac-4621-bdec-27c1fb25da98" alt="" width="358"><figcaption></figcaption></figure>

**Configuration**

* **Name:** Provide a name for the retriever.
* **Connection:** Connect to Chroma for managing vector data.
* **Index Name:** Specify the index name for retrieval.
* **Max Documents:** Define the maximum documents to fetch.
* **Filters:** Apply filters for targeted retrieval.

#### Qdrant Retriever

<figure><img src="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2FmovdHofn9UqYuDtXyDyx%2Fimage.png?alt=media&#x26;token=cf302196-9293-41cc-85de-d470444022e6" alt="" width="358"><figcaption></figcaption></figure>

**Configuration**

* **Name:** Set a name for easy reference.
* **Connection:** Establish a connection to Qdrant, a high-performance vector database.
* **Index Name:** Specify the index name for retrieval.
* **Max Documents:** Specify the maximum number of documents to retrieve.
* **Filters:** Use filters to refine search results.
* **Advanced configuration:**
  * **Content Key:**  Specify custom field name used to store content in the storage.

#### Milvus Retriever

<figure><img src="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2Fj4bsn7v13jakckzvf7K8%2Fimage.png?alt=media&#x26;token=e0741c5a-76f6-4e7b-9ff2-8577046eef4f" alt="" width="315"><figcaption></figcaption></figure>

**Configuration**

* **Name:** Provide a name for the retriever.
* **Connection:** Establish a connection to Milvus, a highly performant, scalable vector database.
* **Index Name:** Specify the index name for retrieval.
* **Max Documents:** Specify the maximum number of documents to retrieve.
* **Filters:** Use filters to refine search results.
* **Advanced configuration:**
  * **Content Key:**  Specify a unique name for the field in the storage used to keep content.
  * **Embedding key:**  Specify a unique name for the field in the storage used to keep the vector.

#### Elasticsearch Retriever

<figure><img src="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2Fm0AAUnjERLmT1y9vqHWs%2Fimage.png?alt=media&#x26;token=a859e307-54af-44a2-ab16-3fc6f03069e8" alt="" width="298"><figcaption></figcaption></figure>

**Configuration**

* **Name:** Provide a name for the retriever.
* **Connection:** Establish a connection to Elasticsearch, distributed search and analytics engine.
* **Index Name:** Specify the index name for retrieval.
* **Max Documents:** Specify the maximum number of documents to retrieve.
* **Embedding dimension:** Dimension of the embeddings in vector store.
* **Filters:** Use filters to refine search results.
* **Advanced configuration:**
  * **Content Key:**  Specify a unique name for the field in the storage used to keep content.
  * **Embedding key:**  Specify a unique name for the field in the storage used to keep the vector.

#### PGvector Retriever

<figure><img src="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2FJj90Ri0WxxEJh2iPuqWw%2Fimage.png?alt=media&#x26;token=e89b58f3-1b19-4936-8775-c9a366a09323" alt="" width="259"><figcaption></figcaption></figure>

**Configuration**

* **Name:** Provide a name for the retriever.
* **Connection:** Establish a connection to pgvector, open-source vector similarity search for Postgres.
* **Index Name:** Specify the index name for retrieval.
* **Max Documents:** Specify the maximum number of documents to retrieve.
* **Schema name:** Enter the name of the schema in the database.
* **Keyword index name:**  Specify the name for the keyword index.
* **Filters:** Use filters to refine search results.
* **Options:**
  * **Use hybrid search:** Enables hybrid search.
    * **Alpha:** Adjusts the balance between keyword and vector search.
* **Advanced configuration:**
  * **Content Key:**  Specify a unique name for the field in the storage used to keep content.
  * **Embedding key:**  Specify a unique name for the field in the storage used to keep the vector.

### How to Use Document Retrievers

<figure><img src="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2Fy0fW9gNscB22FKoLGKon%2Fimage.png?alt=media&#x26;token=f30f0b21-ed0e-4bff-a5f2-d3cb5cc3cd3f" alt=""><figcaption></figcaption></figure>

**Input:**

* Provide the query vector to initiate the retrieval process.

**Configuration:**

* Select the appropriate retriever based on your retrieval needs.
* Configure necessary parameters such as connection, index name, and filters.

**Output:**

* The retriever fetches relevant documents, making them available for further processing in the RAG application.

### Benefits of Document Retrievers

* **Efficient Retrieval:** Quickly accesses relevant data for accurate responses.
* **Scalability:** Handles large datasets, supporting extensive knowledge bases.
* **Flexibility:** Offers various configurations to suit different retrieval needs.

By effectively utilizing document retrievers, your RAG application can deliver precise and contextually relevant information efficiently.
