# Retrievers

## Create Retriever

`Retriever retrievers().create(RetrieverCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/api/v1/retrievers`

Create a new Retriever.

### Parameters

- `RetrieverCreateParams params`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `RetrieverCreate retrieverCreate`

### Returns

- `class Retriever:`

  An entity that retrieves context nodes from several sub RetrieverTools.

  - `String id`

    Unique identifier

  - `String name`

    A name for the retriever tool. Will default to the pipeline name if not provided.

  - `String projectId`

    The ID of the project this retriever resides in.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<List<RetrieverPipeline>> pipelines`

    The pipelines this retriever uses.

    - `Optional<String> description`

      A description of the retriever tool.

    - `Optional<String> name`

      A name for the retriever tool. Will default to the pipeline name if not provided.

    - `String pipelineId`

      The ID of the pipeline this tool uses.

    - `Optional<PresetRetrievalParams> presetRetrievalParameters`

      Parameters for retrieval configuration.

      - `Optional<Double> alpha`

        Alpha value for hybrid retrieval to determine the weights between dense and sparse retrieval. 0 is sparse retrieval and 1 is dense retrieval.

      - `Optional<String> className`

      - `Optional<Double> denseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Optional<Long> denseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Optional<Boolean> enableReranking`

        Enable reranking for retrieval

      - `Optional<Long> filesTopK`

        Number of files to retrieve (only for retrieval mode files_via_metadata and files_via_content).

      - `Optional<Long> rerankTopN`

        Number of reranked nodes for returning.

      - `Optional<RetrievalMode> retrievalMode`

        The retrieval mode for the query.

        - `CHUNKS("chunks")`

        - `FILES_VIA_METADATA("files_via_metadata")`

        - `FILES_VIA_CONTENT("files_via_content")`

        - `AUTO_ROUTED("auto_routed")`

      - `Optional<Boolean> retrieveImageNodes`

        Whether to retrieve image nodes.

      - `Optional<Boolean> retrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Optional<Boolean> retrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `Optional<MetadataFilters> searchFilters`

        Metadata filters for vector stores.

        - `List<Filter> filters`

          - `class MetadataFilter:`

            Comprehensive metadata filter for vector stores to support more operators.

            Value uses Strict types, as int, float and str are compatible types and were all
            converted to string before.

            See: https://docs.pydantic.dev/latest/usage/types/#strict-types

            - `String key`

            - `Optional<Value> value`

              - `double`

              - `String`

              - `List<String>`

              - `List<double>`

              - `List<long>`

            - `Optional<Operator> operator`

              Vector store filter operator.

              - `EQUALS("==")`

              - `GREATER(">")`

              - `LESS("<")`

              - `NOT_EQUALS("!=")`

              - `GREATER_OR_EQUALS(">=")`

              - `LESS_OR_EQUALS("<=")`

              - `IN("in")`

              - `NIN("nin")`

              - `ANY("any")`

              - `ALL("all")`

              - `TEXT_MATCH("text_match")`

              - `TEXT_MATCH_INSENSITIVE("text_match_insensitive")`

              - `CONTAINS("contains")`

              - `IS_EMPTY("is_empty")`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Optional<Condition> condition`

          Vector store filter conditions to combine different filters.

          - `AND("and")`

          - `OR("or")`

          - `NOT("not")`

      - `Optional<SearchFiltersInferenceSchema> searchFiltersInferenceSchema`

        JSON Schema that will be used to infer search_filters. Omit or leave as null to skip inference.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<Long> sparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.retrievers.Retriever;
import com.llamacloud_prod.api.models.retrievers.RetrieverCreate;
import com.llamacloud_prod.api.models.retrievers.RetrieverCreateParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        RetrieverCreate params = RetrieverCreate.builder()
            .name("x")
            .build();
        Retriever retriever = client.retrievers().create(params);
    }
}
```

#### Response

```json
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "name": "x",
  "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "created_at": "2019-12-27T18:11:19.117Z",
  "pipelines": [
    {
      "description": "description",
      "name": "x",
      "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "preset_retrieval_parameters": {
        "alpha": 0,
        "class_name": "class_name",
        "dense_similarity_cutoff": 0,
        "dense_similarity_top_k": 1,
        "enable_reranking": true,
        "files_top_k": 1,
        "rerank_top_n": 1,
        "retrieval_mode": "chunks",
        "retrieve_image_nodes": true,
        "retrieve_page_figure_nodes": true,
        "retrieve_page_screenshot_nodes": true,
        "search_filters": {
          "filters": [
            {
              "key": "key",
              "value": 0,
              "operator": "=="
            }
          ],
          "condition": "and"
        },
        "search_filters_inference_schema": {
          "foo": {
            "foo": "bar"
          }
        },
        "sparse_similarity_top_k": 1
      }
    }
  ],
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## Upsert Retriever

`Retriever retrievers().upsert(RetrieverUpsertParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**put** `/api/v1/retrievers`

Upsert a new Retriever.

### Parameters

- `RetrieverUpsertParams params`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `RetrieverCreate retrieverCreate`

### Returns

- `class Retriever:`

  An entity that retrieves context nodes from several sub RetrieverTools.

  - `String id`

    Unique identifier

  - `String name`

    A name for the retriever tool. Will default to the pipeline name if not provided.

  - `String projectId`

    The ID of the project this retriever resides in.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<List<RetrieverPipeline>> pipelines`

    The pipelines this retriever uses.

    - `Optional<String> description`

      A description of the retriever tool.

    - `Optional<String> name`

      A name for the retriever tool. Will default to the pipeline name if not provided.

    - `String pipelineId`

      The ID of the pipeline this tool uses.

    - `Optional<PresetRetrievalParams> presetRetrievalParameters`

      Parameters for retrieval configuration.

      - `Optional<Double> alpha`

        Alpha value for hybrid retrieval to determine the weights between dense and sparse retrieval. 0 is sparse retrieval and 1 is dense retrieval.

      - `Optional<String> className`

      - `Optional<Double> denseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Optional<Long> denseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Optional<Boolean> enableReranking`

        Enable reranking for retrieval

      - `Optional<Long> filesTopK`

        Number of files to retrieve (only for retrieval mode files_via_metadata and files_via_content).

      - `Optional<Long> rerankTopN`

        Number of reranked nodes for returning.

      - `Optional<RetrievalMode> retrievalMode`

        The retrieval mode for the query.

        - `CHUNKS("chunks")`

        - `FILES_VIA_METADATA("files_via_metadata")`

        - `FILES_VIA_CONTENT("files_via_content")`

        - `AUTO_ROUTED("auto_routed")`

      - `Optional<Boolean> retrieveImageNodes`

        Whether to retrieve image nodes.

      - `Optional<Boolean> retrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Optional<Boolean> retrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `Optional<MetadataFilters> searchFilters`

        Metadata filters for vector stores.

        - `List<Filter> filters`

          - `class MetadataFilter:`

            Comprehensive metadata filter for vector stores to support more operators.

            Value uses Strict types, as int, float and str are compatible types and were all
            converted to string before.

            See: https://docs.pydantic.dev/latest/usage/types/#strict-types

            - `String key`

            - `Optional<Value> value`

              - `double`

              - `String`

              - `List<String>`

              - `List<double>`

              - `List<long>`

            - `Optional<Operator> operator`

              Vector store filter operator.

              - `EQUALS("==")`

              - `GREATER(">")`

              - `LESS("<")`

              - `NOT_EQUALS("!=")`

              - `GREATER_OR_EQUALS(">=")`

              - `LESS_OR_EQUALS("<=")`

              - `IN("in")`

              - `NIN("nin")`

              - `ANY("any")`

              - `ALL("all")`

              - `TEXT_MATCH("text_match")`

              - `TEXT_MATCH_INSENSITIVE("text_match_insensitive")`

              - `CONTAINS("contains")`

              - `IS_EMPTY("is_empty")`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Optional<Condition> condition`

          Vector store filter conditions to combine different filters.

          - `AND("and")`

          - `OR("or")`

          - `NOT("not")`

      - `Optional<SearchFiltersInferenceSchema> searchFiltersInferenceSchema`

        JSON Schema that will be used to infer search_filters. Omit or leave as null to skip inference.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<Long> sparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.retrievers.Retriever;
import com.llamacloud_prod.api.models.retrievers.RetrieverCreate;
import com.llamacloud_prod.api.models.retrievers.RetrieverUpsertParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        RetrieverCreate params = RetrieverCreate.builder()
            .name("x")
            .build();
        Retriever retriever = client.retrievers().upsert(params);
    }
}
```

#### Response

```json
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "name": "x",
  "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "created_at": "2019-12-27T18:11:19.117Z",
  "pipelines": [
    {
      "description": "description",
      "name": "x",
      "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "preset_retrieval_parameters": {
        "alpha": 0,
        "class_name": "class_name",
        "dense_similarity_cutoff": 0,
        "dense_similarity_top_k": 1,
        "enable_reranking": true,
        "files_top_k": 1,
        "rerank_top_n": 1,
        "retrieval_mode": "chunks",
        "retrieve_image_nodes": true,
        "retrieve_page_figure_nodes": true,
        "retrieve_page_screenshot_nodes": true,
        "search_filters": {
          "filters": [
            {
              "key": "key",
              "value": 0,
              "operator": "=="
            }
          ],
          "condition": "and"
        },
        "search_filters_inference_schema": {
          "foo": {
            "foo": "bar"
          }
        },
        "sparse_similarity_top_k": 1
      }
    }
  ],
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## List Retrievers

`List<Retriever> retrievers().list(RetrieverListParamsparams = RetrieverListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/api/v1/retrievers`

List Retrievers for a project.

### Parameters

- `RetrieverListParams params`

  - `Optional<String> name`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.retrievers.Retriever;
import com.llamacloud_prod.api.models.retrievers.RetrieverListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        List<Retriever> retrievers = client.retrievers().list();
    }
}
```

#### Response

```json
[
  {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "name": "x",
    "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "created_at": "2019-12-27T18:11:19.117Z",
    "pipelines": [
      {
        "description": "description",
        "name": "x",
        "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "preset_retrieval_parameters": {
          "alpha": 0,
          "class_name": "class_name",
          "dense_similarity_cutoff": 0,
          "dense_similarity_top_k": 1,
          "enable_reranking": true,
          "files_top_k": 1,
          "rerank_top_n": 1,
          "retrieval_mode": "chunks",
          "retrieve_image_nodes": true,
          "retrieve_page_figure_nodes": true,
          "retrieve_page_screenshot_nodes": true,
          "search_filters": {
            "filters": [
              {
                "key": "key",
                "value": 0,
                "operator": "=="
              }
            ],
            "condition": "and"
          },
          "search_filters_inference_schema": {
            "foo": {
              "foo": "bar"
            }
          },
          "sparse_similarity_top_k": 1
        }
      }
    ],
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]
```

## Get Retriever

`Retriever retrievers().get(RetrieverGetParamsparams = RetrieverGetParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/api/v1/retrievers/{retriever_id}`

Get a Retriever by ID.

### Parameters

- `RetrieverGetParams params`

  - `Optional<String> retrieverId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

### Returns

- `class Retriever:`

  An entity that retrieves context nodes from several sub RetrieverTools.

  - `String id`

    Unique identifier

  - `String name`

    A name for the retriever tool. Will default to the pipeline name if not provided.

  - `String projectId`

    The ID of the project this retriever resides in.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<List<RetrieverPipeline>> pipelines`

    The pipelines this retriever uses.

    - `Optional<String> description`

      A description of the retriever tool.

    - `Optional<String> name`

      A name for the retriever tool. Will default to the pipeline name if not provided.

    - `String pipelineId`

      The ID of the pipeline this tool uses.

    - `Optional<PresetRetrievalParams> presetRetrievalParameters`

      Parameters for retrieval configuration.

      - `Optional<Double> alpha`

        Alpha value for hybrid retrieval to determine the weights between dense and sparse retrieval. 0 is sparse retrieval and 1 is dense retrieval.

      - `Optional<String> className`

      - `Optional<Double> denseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Optional<Long> denseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Optional<Boolean> enableReranking`

        Enable reranking for retrieval

      - `Optional<Long> filesTopK`

        Number of files to retrieve (only for retrieval mode files_via_metadata and files_via_content).

      - `Optional<Long> rerankTopN`

        Number of reranked nodes for returning.

      - `Optional<RetrievalMode> retrievalMode`

        The retrieval mode for the query.

        - `CHUNKS("chunks")`

        - `FILES_VIA_METADATA("files_via_metadata")`

        - `FILES_VIA_CONTENT("files_via_content")`

        - `AUTO_ROUTED("auto_routed")`

      - `Optional<Boolean> retrieveImageNodes`

        Whether to retrieve image nodes.

      - `Optional<Boolean> retrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Optional<Boolean> retrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `Optional<MetadataFilters> searchFilters`

        Metadata filters for vector stores.

        - `List<Filter> filters`

          - `class MetadataFilter:`

            Comprehensive metadata filter for vector stores to support more operators.

            Value uses Strict types, as int, float and str are compatible types and were all
            converted to string before.

            See: https://docs.pydantic.dev/latest/usage/types/#strict-types

            - `String key`

            - `Optional<Value> value`

              - `double`

              - `String`

              - `List<String>`

              - `List<double>`

              - `List<long>`

            - `Optional<Operator> operator`

              Vector store filter operator.

              - `EQUALS("==")`

              - `GREATER(">")`

              - `LESS("<")`

              - `NOT_EQUALS("!=")`

              - `GREATER_OR_EQUALS(">=")`

              - `LESS_OR_EQUALS("<=")`

              - `IN("in")`

              - `NIN("nin")`

              - `ANY("any")`

              - `ALL("all")`

              - `TEXT_MATCH("text_match")`

              - `TEXT_MATCH_INSENSITIVE("text_match_insensitive")`

              - `CONTAINS("contains")`

              - `IS_EMPTY("is_empty")`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Optional<Condition> condition`

          Vector store filter conditions to combine different filters.

          - `AND("and")`

          - `OR("or")`

          - `NOT("not")`

      - `Optional<SearchFiltersInferenceSchema> searchFiltersInferenceSchema`

        JSON Schema that will be used to infer search_filters. Omit or leave as null to skip inference.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<Long> sparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.retrievers.Retriever;
import com.llamacloud_prod.api.models.retrievers.RetrieverGetParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        Retriever retriever = client.retrievers().get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
    }
}
```

#### Response

```json
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "name": "x",
  "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "created_at": "2019-12-27T18:11:19.117Z",
  "pipelines": [
    {
      "description": "description",
      "name": "x",
      "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "preset_retrieval_parameters": {
        "alpha": 0,
        "class_name": "class_name",
        "dense_similarity_cutoff": 0,
        "dense_similarity_top_k": 1,
        "enable_reranking": true,
        "files_top_k": 1,
        "rerank_top_n": 1,
        "retrieval_mode": "chunks",
        "retrieve_image_nodes": true,
        "retrieve_page_figure_nodes": true,
        "retrieve_page_screenshot_nodes": true,
        "search_filters": {
          "filters": [
            {
              "key": "key",
              "value": 0,
              "operator": "=="
            }
          ],
          "condition": "and"
        },
        "search_filters_inference_schema": {
          "foo": {
            "foo": "bar"
          }
        },
        "sparse_similarity_top_k": 1
      }
    }
  ],
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## Update Retriever

`Retriever retrievers().update(RetrieverUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**put** `/api/v1/retrievers/{retriever_id}`

Update an existing Retriever.

### Parameters

- `RetrieverUpdateParams params`

  - `Optional<String> retrieverId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `Optional<List<RetrieverPipeline>> pipelines`

    The pipelines this retriever uses.

    - `Optional<String> description`

      A description of the retriever tool.

    - `Optional<String> name`

      A name for the retriever tool. Will default to the pipeline name if not provided.

    - `String pipelineId`

      The ID of the pipeline this tool uses.

    - `Optional<PresetRetrievalParams> presetRetrievalParameters`

      Parameters for retrieval configuration.

      - `Optional<Double> alpha`

        Alpha value for hybrid retrieval to determine the weights between dense and sparse retrieval. 0 is sparse retrieval and 1 is dense retrieval.

      - `Optional<String> className`

      - `Optional<Double> denseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Optional<Long> denseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Optional<Boolean> enableReranking`

        Enable reranking for retrieval

      - `Optional<Long> filesTopK`

        Number of files to retrieve (only for retrieval mode files_via_metadata and files_via_content).

      - `Optional<Long> rerankTopN`

        Number of reranked nodes for returning.

      - `Optional<RetrievalMode> retrievalMode`

        The retrieval mode for the query.

        - `CHUNKS("chunks")`

        - `FILES_VIA_METADATA("files_via_metadata")`

        - `FILES_VIA_CONTENT("files_via_content")`

        - `AUTO_ROUTED("auto_routed")`

      - `Optional<Boolean> retrieveImageNodes`

        Whether to retrieve image nodes.

      - `Optional<Boolean> retrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Optional<Boolean> retrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `Optional<MetadataFilters> searchFilters`

        Metadata filters for vector stores.

        - `List<Filter> filters`

          - `class MetadataFilter:`

            Comprehensive metadata filter for vector stores to support more operators.

            Value uses Strict types, as int, float and str are compatible types and were all
            converted to string before.

            See: https://docs.pydantic.dev/latest/usage/types/#strict-types

            - `String key`

            - `Optional<Value> value`

              - `double`

              - `String`

              - `List<String>`

              - `List<double>`

              - `List<long>`

            - `Optional<Operator> operator`

              Vector store filter operator.

              - `EQUALS("==")`

              - `GREATER(">")`

              - `LESS("<")`

              - `NOT_EQUALS("!=")`

              - `GREATER_OR_EQUALS(">=")`

              - `LESS_OR_EQUALS("<=")`

              - `IN("in")`

              - `NIN("nin")`

              - `ANY("any")`

              - `ALL("all")`

              - `TEXT_MATCH("text_match")`

              - `TEXT_MATCH_INSENSITIVE("text_match_insensitive")`

              - `CONTAINS("contains")`

              - `IS_EMPTY("is_empty")`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Optional<Condition> condition`

          Vector store filter conditions to combine different filters.

          - `AND("and")`

          - `OR("or")`

          - `NOT("not")`

      - `Optional<SearchFiltersInferenceSchema> searchFiltersInferenceSchema`

        JSON Schema that will be used to infer search_filters. Omit or leave as null to skip inference.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<Long> sparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `Optional<String> name`

    A name for the retriever.

### Returns

- `class Retriever:`

  An entity that retrieves context nodes from several sub RetrieverTools.

  - `String id`

    Unique identifier

  - `String name`

    A name for the retriever tool. Will default to the pipeline name if not provided.

  - `String projectId`

    The ID of the project this retriever resides in.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<List<RetrieverPipeline>> pipelines`

    The pipelines this retriever uses.

    - `Optional<String> description`

      A description of the retriever tool.

    - `Optional<String> name`

      A name for the retriever tool. Will default to the pipeline name if not provided.

    - `String pipelineId`

      The ID of the pipeline this tool uses.

    - `Optional<PresetRetrievalParams> presetRetrievalParameters`

      Parameters for retrieval configuration.

      - `Optional<Double> alpha`

        Alpha value for hybrid retrieval to determine the weights between dense and sparse retrieval. 0 is sparse retrieval and 1 is dense retrieval.

      - `Optional<String> className`

      - `Optional<Double> denseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Optional<Long> denseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Optional<Boolean> enableReranking`

        Enable reranking for retrieval

      - `Optional<Long> filesTopK`

        Number of files to retrieve (only for retrieval mode files_via_metadata and files_via_content).

      - `Optional<Long> rerankTopN`

        Number of reranked nodes for returning.

      - `Optional<RetrievalMode> retrievalMode`

        The retrieval mode for the query.

        - `CHUNKS("chunks")`

        - `FILES_VIA_METADATA("files_via_metadata")`

        - `FILES_VIA_CONTENT("files_via_content")`

        - `AUTO_ROUTED("auto_routed")`

      - `Optional<Boolean> retrieveImageNodes`

        Whether to retrieve image nodes.

      - `Optional<Boolean> retrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Optional<Boolean> retrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `Optional<MetadataFilters> searchFilters`

        Metadata filters for vector stores.

        - `List<Filter> filters`

          - `class MetadataFilter:`

            Comprehensive metadata filter for vector stores to support more operators.

            Value uses Strict types, as int, float and str are compatible types and were all
            converted to string before.

            See: https://docs.pydantic.dev/latest/usage/types/#strict-types

            - `String key`

            - `Optional<Value> value`

              - `double`

              - `String`

              - `List<String>`

              - `List<double>`

              - `List<long>`

            - `Optional<Operator> operator`

              Vector store filter operator.

              - `EQUALS("==")`

              - `GREATER(">")`

              - `LESS("<")`

              - `NOT_EQUALS("!=")`

              - `GREATER_OR_EQUALS(">=")`

              - `LESS_OR_EQUALS("<=")`

              - `IN("in")`

              - `NIN("nin")`

              - `ANY("any")`

              - `ALL("all")`

              - `TEXT_MATCH("text_match")`

              - `TEXT_MATCH_INSENSITIVE("text_match_insensitive")`

              - `CONTAINS("contains")`

              - `IS_EMPTY("is_empty")`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Optional<Condition> condition`

          Vector store filter conditions to combine different filters.

          - `AND("and")`

          - `OR("or")`

          - `NOT("not")`

      - `Optional<SearchFiltersInferenceSchema> searchFiltersInferenceSchema`

        JSON Schema that will be used to infer search_filters. Omit or leave as null to skip inference.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<Long> sparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.retrievers.Retriever;
import com.llamacloud_prod.api.models.retrievers.RetrieverPipeline;
import com.llamacloud_prod.api.models.retrievers.RetrieverUpdateParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        RetrieverUpdateParams params = RetrieverUpdateParams.builder()
            .retrieverId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
            .addPipeline(RetrieverPipeline.builder()
                .description("description")
                .name("x")
                .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .build())
            .build();
        Retriever retriever = client.retrievers().update(params);
    }
}
```

#### Response

```json
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "name": "x",
  "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "created_at": "2019-12-27T18:11:19.117Z",
  "pipelines": [
    {
      "description": "description",
      "name": "x",
      "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "preset_retrieval_parameters": {
        "alpha": 0,
        "class_name": "class_name",
        "dense_similarity_cutoff": 0,
        "dense_similarity_top_k": 1,
        "enable_reranking": true,
        "files_top_k": 1,
        "rerank_top_n": 1,
        "retrieval_mode": "chunks",
        "retrieve_image_nodes": true,
        "retrieve_page_figure_nodes": true,
        "retrieve_page_screenshot_nodes": true,
        "search_filters": {
          "filters": [
            {
              "key": "key",
              "value": 0,
              "operator": "=="
            }
          ],
          "condition": "and"
        },
        "search_filters_inference_schema": {
          "foo": {
            "foo": "bar"
          }
        },
        "sparse_similarity_top_k": 1
      }
    }
  ],
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## Delete Retriever

`retrievers().delete(RetrieverDeleteParamsparams = RetrieverDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**delete** `/api/v1/retrievers/{retriever_id}`

Delete a Retriever by ID.

### Parameters

- `RetrieverDeleteParams params`

  - `Optional<String> retrieverId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.retrievers.RetrieverDeleteParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        client.retrievers().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
    }
}
```

## Direct Retrieve

`CompositeRetrievalResult retrievers().search(RetrieverSearchParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/api/v1/retrievers/retrieve`

Retrieve data using specified pipelines without creating a persistent retriever.

### Parameters

- `RetrieverSearchParams params`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `String query`

    The query to retrieve against.

  - `Optional<CompositeRetrievalMode> mode`

    The mode of composite retrieval.

  - `Optional<List<RetrieverPipeline>> pipelines`

    The pipelines to use for retrieval.

    - `Optional<String> description`

      A description of the retriever tool.

    - `Optional<String> name`

      A name for the retriever tool. Will default to the pipeline name if not provided.

    - `String pipelineId`

      The ID of the pipeline this tool uses.

    - `Optional<PresetRetrievalParams> presetRetrievalParameters`

      Parameters for retrieval configuration.

      - `Optional<Double> alpha`

        Alpha value for hybrid retrieval to determine the weights between dense and sparse retrieval. 0 is sparse retrieval and 1 is dense retrieval.

      - `Optional<String> className`

      - `Optional<Double> denseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Optional<Long> denseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Optional<Boolean> enableReranking`

        Enable reranking for retrieval

      - `Optional<Long> filesTopK`

        Number of files to retrieve (only for retrieval mode files_via_metadata and files_via_content).

      - `Optional<Long> rerankTopN`

        Number of reranked nodes for returning.

      - `Optional<RetrievalMode> retrievalMode`

        The retrieval mode for the query.

        - `CHUNKS("chunks")`

        - `FILES_VIA_METADATA("files_via_metadata")`

        - `FILES_VIA_CONTENT("files_via_content")`

        - `AUTO_ROUTED("auto_routed")`

      - `Optional<Boolean> retrieveImageNodes`

        Whether to retrieve image nodes.

      - `Optional<Boolean> retrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Optional<Boolean> retrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `Optional<MetadataFilters> searchFilters`

        Metadata filters for vector stores.

        - `List<Filter> filters`

          - `class MetadataFilter:`

            Comprehensive metadata filter for vector stores to support more operators.

            Value uses Strict types, as int, float and str are compatible types and were all
            converted to string before.

            See: https://docs.pydantic.dev/latest/usage/types/#strict-types

            - `String key`

            - `Optional<Value> value`

              - `double`

              - `String`

              - `List<String>`

              - `List<double>`

              - `List<long>`

            - `Optional<Operator> operator`

              Vector store filter operator.

              - `EQUALS("==")`

              - `GREATER(">")`

              - `LESS("<")`

              - `NOT_EQUALS("!=")`

              - `GREATER_OR_EQUALS(">=")`

              - `LESS_OR_EQUALS("<=")`

              - `IN("in")`

              - `NIN("nin")`

              - `ANY("any")`

              - `ALL("all")`

              - `TEXT_MATCH("text_match")`

              - `TEXT_MATCH_INSENSITIVE("text_match_insensitive")`

              - `CONTAINS("contains")`

              - `IS_EMPTY("is_empty")`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Optional<Condition> condition`

          Vector store filter conditions to combine different filters.

          - `AND("and")`

          - `OR("or")`

          - `NOT("not")`

      - `Optional<SearchFiltersInferenceSchema> searchFiltersInferenceSchema`

        JSON Schema that will be used to infer search_filters. Omit or leave as null to skip inference.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<Long> sparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `Optional<ReRankConfig> rerankConfig`

    The rerank configuration for composite retrieval.

  - `Optional<Long> rerankTopN`

    (use rerank_config.top_n instead) The number of nodes to retrieve after reranking over retrieved nodes from all retrieval tools.

### Returns

- `class CompositeRetrievalResult:`

  - `Optional<List<PageScreenshotNodeWithScore>> imageNodes`

    The image nodes retrieved by the pipeline for the given query. Deprecated - will soon be replaced with 'page_screenshot_nodes'.

    - `Node node`

      - `String fileId`

        The ID of the file that the page screenshot was taken from

      - `long imageSize`

        The size of the image in bytes

      - `long pageIndex`

        The index of the page for which the screenshot is taken (0-indexed)

      - `Optional<Metadata> metadata`

        Metadata for the screenshot

    - `double score`

      The score of the screenshot node

    - `Optional<String> className`

  - `Optional<List<Node>> nodes`

    The retrieved nodes from the composite retrieval.

    - `InnerNode node`

      - `String id`

        The ID of the retrieved node.

      - `Optional<Long> endCharIdx`

        The end character index of the retrieved node in the document

      - `String pipelineId`

        The ID of the pipeline this node was retrieved from.

      - `String retrieverId`

        The ID of the retriever this node was retrieved from.

      - `String retrieverPipelineName`

        The name of the retrieval pipeline this node was retrieved from.

      - `Optional<Long> startCharIdx`

        The start character index of the retrieved node in the document

      - `String text`

        The text of the retrieved node.

      - `Optional<Metadata> metadata`

        Metadata associated with the retrieved node.

    - `Optional<String> className`

    - `Optional<Double> score`

  - `Optional<List<PageFigureNodeWithScore>> pageFigureNodes`

    The page figure nodes retrieved by the pipeline for the given query.

    - `Node node`

      - `double confidence`

        The confidence of the figure

      - `String figureName`

        The name of the figure

      - `long figureSize`

        The size of the figure in bytes

      - `String fileId`

        The ID of the file that the figure was taken from

      - `long pageIndex`

        The index of the page for which the figure is taken (0-indexed)

      - `Optional<Boolean> isLikelyNoise`

        Whether the figure is likely to be noise

      - `Optional<Metadata> metadata`

        Metadata for the figure

    - `double score`

      The score of the figure node

    - `Optional<String> className`

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.retrievers.CompositeRetrievalResult;
import com.llamacloud_prod.api.models.retrievers.RetrieverSearchParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        RetrieverSearchParams params = RetrieverSearchParams.builder()
            .query("x")
            .build();
        CompositeRetrievalResult compositeRetrievalResult = client.retrievers().search(params);
    }
}
```

#### Response

```json
{
  "image_nodes": [
    {
      "node": {
        "file_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "image_size": 0,
        "page_index": 0,
        "metadata": {
          "foo": "bar"
        }
      },
      "score": 0,
      "class_name": "class_name"
    }
  ],
  "nodes": [
    {
      "node": {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "end_char_idx": 0,
        "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "retriever_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "retriever_pipeline_name": "retriever_pipeline_name",
        "start_char_idx": 0,
        "text": "text",
        "metadata": {
          "foo": "bar"
        }
      },
      "class_name": "class_name",
      "score": 0
    }
  ],
  "page_figure_nodes": [
    {
      "node": {
        "confidence": 0,
        "figure_name": "figure_name",
        "figure_size": 0,
        "file_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "page_index": 0,
        "is_likely_noise": true,
        "metadata": {
          "foo": "bar"
        }
      },
      "score": 0,
      "class_name": "class_name"
    }
  ]
}
```

## Domain Types

### Composite Retrieval Mode

- `enum CompositeRetrievalMode:`

  Enum for the mode of composite retrieval.

  - `ROUTING("routing")`

  - `FULL("full")`

### Composite Retrieval Result

- `class CompositeRetrievalResult:`

  - `Optional<List<PageScreenshotNodeWithScore>> imageNodes`

    The image nodes retrieved by the pipeline for the given query. Deprecated - will soon be replaced with 'page_screenshot_nodes'.

    - `Node node`

      - `String fileId`

        The ID of the file that the page screenshot was taken from

      - `long imageSize`

        The size of the image in bytes

      - `long pageIndex`

        The index of the page for which the screenshot is taken (0-indexed)

      - `Optional<Metadata> metadata`

        Metadata for the screenshot

    - `double score`

      The score of the screenshot node

    - `Optional<String> className`

  - `Optional<List<Node>> nodes`

    The retrieved nodes from the composite retrieval.

    - `InnerNode node`

      - `String id`

        The ID of the retrieved node.

      - `Optional<Long> endCharIdx`

        The end character index of the retrieved node in the document

      - `String pipelineId`

        The ID of the pipeline this node was retrieved from.

      - `String retrieverId`

        The ID of the retriever this node was retrieved from.

      - `String retrieverPipelineName`

        The name of the retrieval pipeline this node was retrieved from.

      - `Optional<Long> startCharIdx`

        The start character index of the retrieved node in the document

      - `String text`

        The text of the retrieved node.

      - `Optional<Metadata> metadata`

        Metadata associated with the retrieved node.

    - `Optional<String> className`

    - `Optional<Double> score`

  - `Optional<List<PageFigureNodeWithScore>> pageFigureNodes`

    The page figure nodes retrieved by the pipeline for the given query.

    - `Node node`

      - `double confidence`

        The confidence of the figure

      - `String figureName`

        The name of the figure

      - `long figureSize`

        The size of the figure in bytes

      - `String fileId`

        The ID of the file that the figure was taken from

      - `long pageIndex`

        The index of the page for which the figure is taken (0-indexed)

      - `Optional<Boolean> isLikelyNoise`

        Whether the figure is likely to be noise

      - `Optional<Metadata> metadata`

        Metadata for the figure

    - `double score`

      The score of the figure node

    - `Optional<String> className`

### Re Rank Config

- `class ReRankConfig:`

  - `Optional<Long> topN`

    The number of nodes to retrieve after reranking over retrieved nodes from all retrieval tools.

  - `Optional<Type> type`

    The type of reranker to use.

    - `SYSTEM_DEFAULT("system_default")`

    - `LLM("llm")`

    - `COHERE("cohere")`

    - `BEDROCK("bedrock")`

    - `SCORE("score")`

    - `DISABLED("disabled")`

### Retriever

- `class Retriever:`

  An entity that retrieves context nodes from several sub RetrieverTools.

  - `String id`

    Unique identifier

  - `String name`

    A name for the retriever tool. Will default to the pipeline name if not provided.

  - `String projectId`

    The ID of the project this retriever resides in.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<List<RetrieverPipeline>> pipelines`

    The pipelines this retriever uses.

    - `Optional<String> description`

      A description of the retriever tool.

    - `Optional<String> name`

      A name for the retriever tool. Will default to the pipeline name if not provided.

    - `String pipelineId`

      The ID of the pipeline this tool uses.

    - `Optional<PresetRetrievalParams> presetRetrievalParameters`

      Parameters for retrieval configuration.

      - `Optional<Double> alpha`

        Alpha value for hybrid retrieval to determine the weights between dense and sparse retrieval. 0 is sparse retrieval and 1 is dense retrieval.

      - `Optional<String> className`

      - `Optional<Double> denseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Optional<Long> denseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Optional<Boolean> enableReranking`

        Enable reranking for retrieval

      - `Optional<Long> filesTopK`

        Number of files to retrieve (only for retrieval mode files_via_metadata and files_via_content).

      - `Optional<Long> rerankTopN`

        Number of reranked nodes for returning.

      - `Optional<RetrievalMode> retrievalMode`

        The retrieval mode for the query.

        - `CHUNKS("chunks")`

        - `FILES_VIA_METADATA("files_via_metadata")`

        - `FILES_VIA_CONTENT("files_via_content")`

        - `AUTO_ROUTED("auto_routed")`

      - `Optional<Boolean> retrieveImageNodes`

        Whether to retrieve image nodes.

      - `Optional<Boolean> retrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Optional<Boolean> retrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `Optional<MetadataFilters> searchFilters`

        Metadata filters for vector stores.

        - `List<Filter> filters`

          - `class MetadataFilter:`

            Comprehensive metadata filter for vector stores to support more operators.

            Value uses Strict types, as int, float and str are compatible types and were all
            converted to string before.

            See: https://docs.pydantic.dev/latest/usage/types/#strict-types

            - `String key`

            - `Optional<Value> value`

              - `double`

              - `String`

              - `List<String>`

              - `List<double>`

              - `List<long>`

            - `Optional<Operator> operator`

              Vector store filter operator.

              - `EQUALS("==")`

              - `GREATER(">")`

              - `LESS("<")`

              - `NOT_EQUALS("!=")`

              - `GREATER_OR_EQUALS(">=")`

              - `LESS_OR_EQUALS("<=")`

              - `IN("in")`

              - `NIN("nin")`

              - `ANY("any")`

              - `ALL("all")`

              - `TEXT_MATCH("text_match")`

              - `TEXT_MATCH_INSENSITIVE("text_match_insensitive")`

              - `CONTAINS("contains")`

              - `IS_EMPTY("is_empty")`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Optional<Condition> condition`

          Vector store filter conditions to combine different filters.

          - `AND("and")`

          - `OR("or")`

          - `NOT("not")`

      - `Optional<SearchFiltersInferenceSchema> searchFiltersInferenceSchema`

        JSON Schema that will be used to infer search_filters. Omit or leave as null to skip inference.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<Long> sparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

### Retriever Create

- `class RetrieverCreate:`

  - `String name`

    A name for the retriever tool. Will default to the pipeline name if not provided.

  - `Optional<List<RetrieverPipeline>> pipelines`

    The pipelines this retriever uses.

    - `Optional<String> description`

      A description of the retriever tool.

    - `Optional<String> name`

      A name for the retriever tool. Will default to the pipeline name if not provided.

    - `String pipelineId`

      The ID of the pipeline this tool uses.

    - `Optional<PresetRetrievalParams> presetRetrievalParameters`

      Parameters for retrieval configuration.

      - `Optional<Double> alpha`

        Alpha value for hybrid retrieval to determine the weights between dense and sparse retrieval. 0 is sparse retrieval and 1 is dense retrieval.

      - `Optional<String> className`

      - `Optional<Double> denseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Optional<Long> denseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Optional<Boolean> enableReranking`

        Enable reranking for retrieval

      - `Optional<Long> filesTopK`

        Number of files to retrieve (only for retrieval mode files_via_metadata and files_via_content).

      - `Optional<Long> rerankTopN`

        Number of reranked nodes for returning.

      - `Optional<RetrievalMode> retrievalMode`

        The retrieval mode for the query.

        - `CHUNKS("chunks")`

        - `FILES_VIA_METADATA("files_via_metadata")`

        - `FILES_VIA_CONTENT("files_via_content")`

        - `AUTO_ROUTED("auto_routed")`

      - `Optional<Boolean> retrieveImageNodes`

        Whether to retrieve image nodes.

      - `Optional<Boolean> retrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Optional<Boolean> retrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `Optional<MetadataFilters> searchFilters`

        Metadata filters for vector stores.

        - `List<Filter> filters`

          - `class MetadataFilter:`

            Comprehensive metadata filter for vector stores to support more operators.

            Value uses Strict types, as int, float and str are compatible types and were all
            converted to string before.

            See: https://docs.pydantic.dev/latest/usage/types/#strict-types

            - `String key`

            - `Optional<Value> value`

              - `double`

              - `String`

              - `List<String>`

              - `List<double>`

              - `List<long>`

            - `Optional<Operator> operator`

              Vector store filter operator.

              - `EQUALS("==")`

              - `GREATER(">")`

              - `LESS("<")`

              - `NOT_EQUALS("!=")`

              - `GREATER_OR_EQUALS(">=")`

              - `LESS_OR_EQUALS("<=")`

              - `IN("in")`

              - `NIN("nin")`

              - `ANY("any")`

              - `ALL("all")`

              - `TEXT_MATCH("text_match")`

              - `TEXT_MATCH_INSENSITIVE("text_match_insensitive")`

              - `CONTAINS("contains")`

              - `IS_EMPTY("is_empty")`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Optional<Condition> condition`

          Vector store filter conditions to combine different filters.

          - `AND("and")`

          - `OR("or")`

          - `NOT("not")`

      - `Optional<SearchFiltersInferenceSchema> searchFiltersInferenceSchema`

        JSON Schema that will be used to infer search_filters. Omit or leave as null to skip inference.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<Long> sparseSimilarityTopK`

        Number of nodes for sparse retrieval.

### Retriever Pipeline

- `class RetrieverPipeline:`

  - `Optional<String> description`

    A description of the retriever tool.

  - `Optional<String> name`

    A name for the retriever tool. Will default to the pipeline name if not provided.

  - `String pipelineId`

    The ID of the pipeline this tool uses.

  - `Optional<PresetRetrievalParams> presetRetrievalParameters`

    Parameters for retrieval configuration.

    - `Optional<Double> alpha`

      Alpha value for hybrid retrieval to determine the weights between dense and sparse retrieval. 0 is sparse retrieval and 1 is dense retrieval.

    - `Optional<String> className`

    - `Optional<Double> denseSimilarityCutoff`

      Minimum similarity score wrt query for retrieval

    - `Optional<Long> denseSimilarityTopK`

      Number of nodes for dense retrieval.

    - `Optional<Boolean> enableReranking`

      Enable reranking for retrieval

    - `Optional<Long> filesTopK`

      Number of files to retrieve (only for retrieval mode files_via_metadata and files_via_content).

    - `Optional<Long> rerankTopN`

      Number of reranked nodes for returning.

    - `Optional<RetrievalMode> retrievalMode`

      The retrieval mode for the query.

      - `CHUNKS("chunks")`

      - `FILES_VIA_METADATA("files_via_metadata")`

      - `FILES_VIA_CONTENT("files_via_content")`

      - `AUTO_ROUTED("auto_routed")`

    - `Optional<Boolean> retrieveImageNodes`

      Whether to retrieve image nodes.

    - `Optional<Boolean> retrievePageFigureNodes`

      Whether to retrieve page figure nodes.

    - `Optional<Boolean> retrievePageScreenshotNodes`

      Whether to retrieve page screenshot nodes.

    - `Optional<MetadataFilters> searchFilters`

      Metadata filters for vector stores.

      - `List<Filter> filters`

        - `class MetadataFilter:`

          Comprehensive metadata filter for vector stores to support more operators.

          Value uses Strict types, as int, float and str are compatible types and were all
          converted to string before.

          See: https://docs.pydantic.dev/latest/usage/types/#strict-types

          - `String key`

          - `Optional<Value> value`

            - `double`

            - `String`

            - `List<String>`

            - `List<double>`

            - `List<long>`

          - `Optional<Operator> operator`

            Vector store filter operator.

            - `EQUALS("==")`

            - `GREATER(">")`

            - `LESS("<")`

            - `NOT_EQUALS("!=")`

            - `GREATER_OR_EQUALS(">=")`

            - `LESS_OR_EQUALS("<=")`

            - `IN("in")`

            - `NIN("nin")`

            - `ANY("any")`

            - `ALL("all")`

            - `TEXT_MATCH("text_match")`

            - `TEXT_MATCH_INSENSITIVE("text_match_insensitive")`

            - `CONTAINS("contains")`

            - `IS_EMPTY("is_empty")`

        - `class MetadataFilters:`

          Metadata filters for vector stores.

      - `Optional<Condition> condition`

        Vector store filter conditions to combine different filters.

        - `AND("and")`

        - `OR("or")`

        - `NOT("not")`

    - `Optional<SearchFiltersInferenceSchema> searchFiltersInferenceSchema`

      JSON Schema that will be used to infer search_filters. Omit or leave as null to skip inference.

      - `class UnionMember0:`

      - `List<JsonValue>`

      - `String`

      - `double`

      - `boolean`

    - `Optional<Long> sparseSimilarityTopK`

      Number of nodes for sparse retrieval.

# Retriever

## Retrieve

`CompositeRetrievalResult retrievers().retriever().search(RetrieverSearchParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/api/v1/retrievers/{retriever_id}/retrieve`

Retrieve data using a Retriever.

### Parameters

- `RetrieverSearchParams params`

  - `Optional<String> retrieverId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `String query`

    The query to retrieve against.

  - `Optional<CompositeRetrievalMode> mode`

    The mode of composite retrieval.

  - `Optional<ReRankConfig> rerankConfig`

    The rerank configuration for composite retrieval.

  - `Optional<Long> rerankTopN`

    (use rerank_config.top_n instead) The number of nodes to retrieve after reranking over retrieved nodes from all retrieval tools.

### Returns

- `class CompositeRetrievalResult:`

  - `Optional<List<PageScreenshotNodeWithScore>> imageNodes`

    The image nodes retrieved by the pipeline for the given query. Deprecated - will soon be replaced with 'page_screenshot_nodes'.

    - `Node node`

      - `String fileId`

        The ID of the file that the page screenshot was taken from

      - `long imageSize`

        The size of the image in bytes

      - `long pageIndex`

        The index of the page for which the screenshot is taken (0-indexed)

      - `Optional<Metadata> metadata`

        Metadata for the screenshot

    - `double score`

      The score of the screenshot node

    - `Optional<String> className`

  - `Optional<List<Node>> nodes`

    The retrieved nodes from the composite retrieval.

    - `InnerNode node`

      - `String id`

        The ID of the retrieved node.

      - `Optional<Long> endCharIdx`

        The end character index of the retrieved node in the document

      - `String pipelineId`

        The ID of the pipeline this node was retrieved from.

      - `String retrieverId`

        The ID of the retriever this node was retrieved from.

      - `String retrieverPipelineName`

        The name of the retrieval pipeline this node was retrieved from.

      - `Optional<Long> startCharIdx`

        The start character index of the retrieved node in the document

      - `String text`

        The text of the retrieved node.

      - `Optional<Metadata> metadata`

        Metadata associated with the retrieved node.

    - `Optional<String> className`

    - `Optional<Double> score`

  - `Optional<List<PageFigureNodeWithScore>> pageFigureNodes`

    The page figure nodes retrieved by the pipeline for the given query.

    - `Node node`

      - `double confidence`

        The confidence of the figure

      - `String figureName`

        The name of the figure

      - `long figureSize`

        The size of the figure in bytes

      - `String fileId`

        The ID of the file that the figure was taken from

      - `long pageIndex`

        The index of the page for which the figure is taken (0-indexed)

      - `Optional<Boolean> isLikelyNoise`

        Whether the figure is likely to be noise

      - `Optional<Metadata> metadata`

        Metadata for the figure

    - `double score`

      The score of the figure node

    - `Optional<String> className`

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.retrievers.CompositeRetrievalResult;
import com.llamacloud_prod.api.models.retrievers.retriever.RetrieverSearchParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        RetrieverSearchParams params = RetrieverSearchParams.builder()
            .retrieverId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
            .query("x")
            .build();
        CompositeRetrievalResult compositeRetrievalResult = client.retrievers().retriever().search(params);
    }
}
```

#### Response

```json
{
  "image_nodes": [
    {
      "node": {
        "file_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "image_size": 0,
        "page_index": 0,
        "metadata": {
          "foo": "bar"
        }
      },
      "score": 0,
      "class_name": "class_name"
    }
  ],
  "nodes": [
    {
      "node": {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "end_char_idx": 0,
        "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "retriever_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "retriever_pipeline_name": "retriever_pipeline_name",
        "start_char_idx": 0,
        "text": "text",
        "metadata": {
          "foo": "bar"
        }
      },
      "class_name": "class_name",
      "score": 0
    }
  ],
  "page_figure_nodes": [
    {
      "node": {
        "confidence": 0,
        "figure_name": "figure_name",
        "figure_size": 0,
        "file_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "page_index": 0,
        "is_likely_noise": true,
        "metadata": {
          "foo": "bar"
        }
      },
      "score": 0,
      "class_name": "class_name"
    }
  ]
}
```
