# Retrievers

## Create Retriever

`Retriever Retrievers.Create(RetrieverCreateParamsparameters, CancellationTokencancellationToken = default)`

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

Create a new Retriever.

### Parameters

- `RetrieverCreateParams parameters`

  - `required string name`

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

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `IReadOnlyList<RetrieverPipeline> pipelines`

    Body param: The pipelines this retriever uses.

    - `required string? Description`

      A description of the retriever tool.

    - `required string? Name`

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

    - `required string PipelineID`

      The ID of the pipeline this tool uses.

    - `PresetRetrievalParams PresetRetrievalParameters`

      Parameters for retrieval configuration.

      - `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.

      - `string ClassName`

      - `Double? DenseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Long? DenseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Boolean? EnableReranking`

        Enable reranking for retrieval

      - `Long? FilesTopK`

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

      - `Long? RerankTopN`

        Number of reranked nodes for returning.

      - `RetrievalMode RetrievalMode`

        The retrieval mode for the query.

        - `"auto_routed"AutoRouted`

        - `"chunks"Chunks`

        - `"files_via_content"FilesViaContent`

        - `"files_via_metadata"FilesViaMetadata`

      - `Boolean RetrieveImageNodes`

        Whether to retrieve image nodes.

      - `Boolean RetrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Boolean RetrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `MetadataFilters? SearchFilters`

        Metadata filters for vector stores.

        - `required IReadOnlyList<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

            - `required string Key`

            - `required Value? Value`

              - `Double`

              - `string`

              - `IReadOnlyList<string>`

              - `IReadOnlyList<Double>`

              - `IReadOnlyList<Long>`

            - `Operator Operator`

              Vector store filter operator.

              - `"!="`

              - `"<"`

              - `"<="`

              - `"=="`

              - `">"`

              - `">="`

              - `"all"All`

              - `"any"Any`

              - `"contains"Contains`

              - `"in"In`

              - `"is_empty"IsEmpty`

              - `"nin"Nin`

              - `"text_match"TextMatch`

              - `"text_match_insensitive"TextMatchInsensitive`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Condition? Condition`

          Vector store filter conditions to combine different filters.

          - `"and"And`

          - `"not"Not`

          - `"or"Or`

      - `IReadOnlyDictionary<string, SearchFiltersInferenceSchema?>? SearchFiltersInferenceSchema`

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

        - `IReadOnlyDictionary<string, JsonElement>`

        - `IReadOnlyList<JsonElement>`

        - `string`

        - `Double`

        - `Boolean`

      - `Long? SparseSimilarityTopK`

        Number of nodes for sparse retrieval.

### Returns

- `class Retriever:`

  An entity that retrieves context nodes from several sub RetrieverTools.

  - `required string ID`

    Unique identifier

  - `required string Name`

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

  - `required string ProjectID`

    The ID of the project this retriever resides in.

  - `DateTimeOffset? CreatedAt`

    Creation datetime

  - `IReadOnlyList<RetrieverPipeline> Pipelines`

    The pipelines this retriever uses.

    - `required string? Description`

      A description of the retriever tool.

    - `required string? Name`

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

    - `required string PipelineID`

      The ID of the pipeline this tool uses.

    - `PresetRetrievalParams PresetRetrievalParameters`

      Parameters for retrieval configuration.

      - `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.

      - `string ClassName`

      - `Double? DenseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Long? DenseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Boolean? EnableReranking`

        Enable reranking for retrieval

      - `Long? FilesTopK`

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

      - `Long? RerankTopN`

        Number of reranked nodes for returning.

      - `RetrievalMode RetrievalMode`

        The retrieval mode for the query.

        - `"auto_routed"AutoRouted`

        - `"chunks"Chunks`

        - `"files_via_content"FilesViaContent`

        - `"files_via_metadata"FilesViaMetadata`

      - `Boolean RetrieveImageNodes`

        Whether to retrieve image nodes.

      - `Boolean RetrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Boolean RetrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `MetadataFilters? SearchFilters`

        Metadata filters for vector stores.

        - `required IReadOnlyList<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

            - `required string Key`

            - `required Value? Value`

              - `Double`

              - `string`

              - `IReadOnlyList<string>`

              - `IReadOnlyList<Double>`

              - `IReadOnlyList<Long>`

            - `Operator Operator`

              Vector store filter operator.

              - `"!="`

              - `"<"`

              - `"<="`

              - `"=="`

              - `">"`

              - `">="`

              - `"all"All`

              - `"any"Any`

              - `"contains"Contains`

              - `"in"In`

              - `"is_empty"IsEmpty`

              - `"nin"Nin`

              - `"text_match"TextMatch`

              - `"text_match_insensitive"TextMatchInsensitive`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Condition? Condition`

          Vector store filter conditions to combine different filters.

          - `"and"And`

          - `"not"Not`

          - `"or"Or`

      - `IReadOnlyDictionary<string, SearchFiltersInferenceSchema?>? SearchFiltersInferenceSchema`

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

        - `IReadOnlyDictionary<string, JsonElement>`

        - `IReadOnlyList<JsonElement>`

        - `string`

        - `Double`

        - `Boolean`

      - `Long? SparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `DateTimeOffset? UpdatedAt`

    Update datetime

### Example

```csharp
RetrieverCreateParams parameters = new() { Name = "x" };

var retriever = await client.Retrievers.Create(parameters);

Console.WriteLine(retriever);
```

#### 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": "auto_routed",
        "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(RetrieverUpsertParamsparameters, CancellationTokencancellationToken = default)`

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

Upsert a new Retriever.

### Parameters

- `RetrieverUpsertParams parameters`

  - `required string name`

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

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `IReadOnlyList<RetrieverPipeline> pipelines`

    Body param: The pipelines this retriever uses.

    - `required string? Description`

      A description of the retriever tool.

    - `required string? Name`

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

    - `required string PipelineID`

      The ID of the pipeline this tool uses.

    - `PresetRetrievalParams PresetRetrievalParameters`

      Parameters for retrieval configuration.

      - `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.

      - `string ClassName`

      - `Double? DenseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Long? DenseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Boolean? EnableReranking`

        Enable reranking for retrieval

      - `Long? FilesTopK`

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

      - `Long? RerankTopN`

        Number of reranked nodes for returning.

      - `RetrievalMode RetrievalMode`

        The retrieval mode for the query.

        - `"auto_routed"AutoRouted`

        - `"chunks"Chunks`

        - `"files_via_content"FilesViaContent`

        - `"files_via_metadata"FilesViaMetadata`

      - `Boolean RetrieveImageNodes`

        Whether to retrieve image nodes.

      - `Boolean RetrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Boolean RetrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `MetadataFilters? SearchFilters`

        Metadata filters for vector stores.

        - `required IReadOnlyList<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

            - `required string Key`

            - `required Value? Value`

              - `Double`

              - `string`

              - `IReadOnlyList<string>`

              - `IReadOnlyList<Double>`

              - `IReadOnlyList<Long>`

            - `Operator Operator`

              Vector store filter operator.

              - `"!="`

              - `"<"`

              - `"<="`

              - `"=="`

              - `">"`

              - `">="`

              - `"all"All`

              - `"any"Any`

              - `"contains"Contains`

              - `"in"In`

              - `"is_empty"IsEmpty`

              - `"nin"Nin`

              - `"text_match"TextMatch`

              - `"text_match_insensitive"TextMatchInsensitive`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Condition? Condition`

          Vector store filter conditions to combine different filters.

          - `"and"And`

          - `"not"Not`

          - `"or"Or`

      - `IReadOnlyDictionary<string, SearchFiltersInferenceSchema?>? SearchFiltersInferenceSchema`

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

        - `IReadOnlyDictionary<string, JsonElement>`

        - `IReadOnlyList<JsonElement>`

        - `string`

        - `Double`

        - `Boolean`

      - `Long? SparseSimilarityTopK`

        Number of nodes for sparse retrieval.

### Returns

- `class Retriever:`

  An entity that retrieves context nodes from several sub RetrieverTools.

  - `required string ID`

    Unique identifier

  - `required string Name`

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

  - `required string ProjectID`

    The ID of the project this retriever resides in.

  - `DateTimeOffset? CreatedAt`

    Creation datetime

  - `IReadOnlyList<RetrieverPipeline> Pipelines`

    The pipelines this retriever uses.

    - `required string? Description`

      A description of the retriever tool.

    - `required string? Name`

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

    - `required string PipelineID`

      The ID of the pipeline this tool uses.

    - `PresetRetrievalParams PresetRetrievalParameters`

      Parameters for retrieval configuration.

      - `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.

      - `string ClassName`

      - `Double? DenseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Long? DenseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Boolean? EnableReranking`

        Enable reranking for retrieval

      - `Long? FilesTopK`

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

      - `Long? RerankTopN`

        Number of reranked nodes for returning.

      - `RetrievalMode RetrievalMode`

        The retrieval mode for the query.

        - `"auto_routed"AutoRouted`

        - `"chunks"Chunks`

        - `"files_via_content"FilesViaContent`

        - `"files_via_metadata"FilesViaMetadata`

      - `Boolean RetrieveImageNodes`

        Whether to retrieve image nodes.

      - `Boolean RetrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Boolean RetrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `MetadataFilters? SearchFilters`

        Metadata filters for vector stores.

        - `required IReadOnlyList<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

            - `required string Key`

            - `required Value? Value`

              - `Double`

              - `string`

              - `IReadOnlyList<string>`

              - `IReadOnlyList<Double>`

              - `IReadOnlyList<Long>`

            - `Operator Operator`

              Vector store filter operator.

              - `"!="`

              - `"<"`

              - `"<="`

              - `"=="`

              - `">"`

              - `">="`

              - `"all"All`

              - `"any"Any`

              - `"contains"Contains`

              - `"in"In`

              - `"is_empty"IsEmpty`

              - `"nin"Nin`

              - `"text_match"TextMatch`

              - `"text_match_insensitive"TextMatchInsensitive`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Condition? Condition`

          Vector store filter conditions to combine different filters.

          - `"and"And`

          - `"not"Not`

          - `"or"Or`

      - `IReadOnlyDictionary<string, SearchFiltersInferenceSchema?>? SearchFiltersInferenceSchema`

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

        - `IReadOnlyDictionary<string, JsonElement>`

        - `IReadOnlyList<JsonElement>`

        - `string`

        - `Double`

        - `Boolean`

      - `Long? SparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `DateTimeOffset? UpdatedAt`

    Update datetime

### Example

```csharp
RetrieverUpsertParams parameters = new() { Name = "x" };

var retriever = await client.Retrievers.Upsert(parameters);

Console.WriteLine(retriever);
```

#### 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": "auto_routed",
        "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

`IReadOnlyList<Retriever> Retrievers.List(RetrieverListParams?parameters, CancellationTokencancellationToken = default)`

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

List Retrievers for a project.

### Parameters

- `RetrieverListParams parameters`

  - `string? name`

  - `string? organizationID`

  - `string? projectID`

### Example

```csharp
RetrieverListParams parameters = new();

var retrievers = await client.Retrievers.List(parameters);

Console.WriteLine(retrievers);
```

#### 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": "auto_routed",
          "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(RetrieverGetParamsparameters, CancellationTokencancellationToken = default)`

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

Get a Retriever by ID.

### Parameters

- `RetrieverGetParams parameters`

  - `required string retrieverID`

  - `string? organizationID`

  - `string? projectID`

### Returns

- `class Retriever:`

  An entity that retrieves context nodes from several sub RetrieverTools.

  - `required string ID`

    Unique identifier

  - `required string Name`

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

  - `required string ProjectID`

    The ID of the project this retriever resides in.

  - `DateTimeOffset? CreatedAt`

    Creation datetime

  - `IReadOnlyList<RetrieverPipeline> Pipelines`

    The pipelines this retriever uses.

    - `required string? Description`

      A description of the retriever tool.

    - `required string? Name`

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

    - `required string PipelineID`

      The ID of the pipeline this tool uses.

    - `PresetRetrievalParams PresetRetrievalParameters`

      Parameters for retrieval configuration.

      - `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.

      - `string ClassName`

      - `Double? DenseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Long? DenseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Boolean? EnableReranking`

        Enable reranking for retrieval

      - `Long? FilesTopK`

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

      - `Long? RerankTopN`

        Number of reranked nodes for returning.

      - `RetrievalMode RetrievalMode`

        The retrieval mode for the query.

        - `"auto_routed"AutoRouted`

        - `"chunks"Chunks`

        - `"files_via_content"FilesViaContent`

        - `"files_via_metadata"FilesViaMetadata`

      - `Boolean RetrieveImageNodes`

        Whether to retrieve image nodes.

      - `Boolean RetrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Boolean RetrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `MetadataFilters? SearchFilters`

        Metadata filters for vector stores.

        - `required IReadOnlyList<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

            - `required string Key`

            - `required Value? Value`

              - `Double`

              - `string`

              - `IReadOnlyList<string>`

              - `IReadOnlyList<Double>`

              - `IReadOnlyList<Long>`

            - `Operator Operator`

              Vector store filter operator.

              - `"!="`

              - `"<"`

              - `"<="`

              - `"=="`

              - `">"`

              - `">="`

              - `"all"All`

              - `"any"Any`

              - `"contains"Contains`

              - `"in"In`

              - `"is_empty"IsEmpty`

              - `"nin"Nin`

              - `"text_match"TextMatch`

              - `"text_match_insensitive"TextMatchInsensitive`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Condition? Condition`

          Vector store filter conditions to combine different filters.

          - `"and"And`

          - `"not"Not`

          - `"or"Or`

      - `IReadOnlyDictionary<string, SearchFiltersInferenceSchema?>? SearchFiltersInferenceSchema`

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

        - `IReadOnlyDictionary<string, JsonElement>`

        - `IReadOnlyList<JsonElement>`

        - `string`

        - `Double`

        - `Boolean`

      - `Long? SparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `DateTimeOffset? UpdatedAt`

    Update datetime

### Example

```csharp
RetrieverGetParams parameters = new()
{
    RetrieverID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
};

var retriever = await client.Retrievers.Get(parameters);

Console.WriteLine(retriever);
```

#### 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": "auto_routed",
        "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(RetrieverUpdateParamsparameters, CancellationTokencancellationToken = default)`

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

Update an existing Retriever.

### Parameters

- `RetrieverUpdateParams parameters`

  - `required string retrieverID`

    Path param

  - `required IReadOnlyList<RetrieverPipeline>? pipelines`

    Body param: The pipelines this retriever uses.

    - `required string? Description`

      A description of the retriever tool.

    - `required string? Name`

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

    - `required string PipelineID`

      The ID of the pipeline this tool uses.

    - `PresetRetrievalParams PresetRetrievalParameters`

      Parameters for retrieval configuration.

      - `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.

      - `string ClassName`

      - `Double? DenseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Long? DenseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Boolean? EnableReranking`

        Enable reranking for retrieval

      - `Long? FilesTopK`

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

      - `Long? RerankTopN`

        Number of reranked nodes for returning.

      - `RetrievalMode RetrievalMode`

        The retrieval mode for the query.

        - `"auto_routed"AutoRouted`

        - `"chunks"Chunks`

        - `"files_via_content"FilesViaContent`

        - `"files_via_metadata"FilesViaMetadata`

      - `Boolean RetrieveImageNodes`

        Whether to retrieve image nodes.

      - `Boolean RetrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Boolean RetrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `MetadataFilters? SearchFilters`

        Metadata filters for vector stores.

        - `required IReadOnlyList<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

            - `required string Key`

            - `required Value? Value`

              - `Double`

              - `string`

              - `IReadOnlyList<string>`

              - `IReadOnlyList<Double>`

              - `IReadOnlyList<Long>`

            - `Operator Operator`

              Vector store filter operator.

              - `"!="`

              - `"<"`

              - `"<="`

              - `"=="`

              - `">"`

              - `">="`

              - `"all"All`

              - `"any"Any`

              - `"contains"Contains`

              - `"in"In`

              - `"is_empty"IsEmpty`

              - `"nin"Nin`

              - `"text_match"TextMatch`

              - `"text_match_insensitive"TextMatchInsensitive`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Condition? Condition`

          Vector store filter conditions to combine different filters.

          - `"and"And`

          - `"not"Not`

          - `"or"Or`

      - `IReadOnlyDictionary<string, SearchFiltersInferenceSchema?>? SearchFiltersInferenceSchema`

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

        - `IReadOnlyDictionary<string, JsonElement>`

        - `IReadOnlyList<JsonElement>`

        - `string`

        - `Double`

        - `Boolean`

      - `Long? SparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `string? name`

    Body param: A name for the retriever.

### Returns

- `class Retriever:`

  An entity that retrieves context nodes from several sub RetrieverTools.

  - `required string ID`

    Unique identifier

  - `required string Name`

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

  - `required string ProjectID`

    The ID of the project this retriever resides in.

  - `DateTimeOffset? CreatedAt`

    Creation datetime

  - `IReadOnlyList<RetrieverPipeline> Pipelines`

    The pipelines this retriever uses.

    - `required string? Description`

      A description of the retriever tool.

    - `required string? Name`

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

    - `required string PipelineID`

      The ID of the pipeline this tool uses.

    - `PresetRetrievalParams PresetRetrievalParameters`

      Parameters for retrieval configuration.

      - `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.

      - `string ClassName`

      - `Double? DenseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Long? DenseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Boolean? EnableReranking`

        Enable reranking for retrieval

      - `Long? FilesTopK`

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

      - `Long? RerankTopN`

        Number of reranked nodes for returning.

      - `RetrievalMode RetrievalMode`

        The retrieval mode for the query.

        - `"auto_routed"AutoRouted`

        - `"chunks"Chunks`

        - `"files_via_content"FilesViaContent`

        - `"files_via_metadata"FilesViaMetadata`

      - `Boolean RetrieveImageNodes`

        Whether to retrieve image nodes.

      - `Boolean RetrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Boolean RetrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `MetadataFilters? SearchFilters`

        Metadata filters for vector stores.

        - `required IReadOnlyList<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

            - `required string Key`

            - `required Value? Value`

              - `Double`

              - `string`

              - `IReadOnlyList<string>`

              - `IReadOnlyList<Double>`

              - `IReadOnlyList<Long>`

            - `Operator Operator`

              Vector store filter operator.

              - `"!="`

              - `"<"`

              - `"<="`

              - `"=="`

              - `">"`

              - `">="`

              - `"all"All`

              - `"any"Any`

              - `"contains"Contains`

              - `"in"In`

              - `"is_empty"IsEmpty`

              - `"nin"Nin`

              - `"text_match"TextMatch`

              - `"text_match_insensitive"TextMatchInsensitive`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Condition? Condition`

          Vector store filter conditions to combine different filters.

          - `"and"And`

          - `"not"Not`

          - `"or"Or`

      - `IReadOnlyDictionary<string, SearchFiltersInferenceSchema?>? SearchFiltersInferenceSchema`

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

        - `IReadOnlyDictionary<string, JsonElement>`

        - `IReadOnlyList<JsonElement>`

        - `string`

        - `Double`

        - `Boolean`

      - `Long? SparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `DateTimeOffset? UpdatedAt`

    Update datetime

### Example

```csharp
RetrieverUpdateParams parameters = new()
{
    RetrieverID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    Pipelines =
    [
        new()
        {
            Description = "description",
            Name = "x",
            PipelineID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            PresetRetrievalParameters = new()
            {
                Alpha = 0,
                ClassName = "class_name",
                DenseSimilarityCutoff = 0,
                DenseSimilarityTopK = 1,
                EnableReranking = true,
                FilesTopK = 1,
                RerankTopN = 1,
                RetrievalMode = RetrievalMode.AutoRouted,
                RetrieveImageNodes = true,
                RetrievePageFigureNodes = true,
                RetrievePageScreenshotNodes = true,
                SearchFilters = new()
                {
                    Filters =
                    [
                        new MetadataFilter()
                        {
                            Key = "key",
                            Value = 0,
                            Operator = Operator.,
                        },
                    ],
                    Condition = Condition.And,
                },
                SearchFiltersInferenceSchema = new Dictionary<string, SearchFiltersInferenceSchema?>(

                )
                {
                    { "foo", new(
                        new Dictionary<string, JsonElement>()
                        {
                            { "foo", JsonSerializer.SerializeToElement("bar") }
                        }
                    ) },
                },
                SparseSimilarityTopK = 1,
            },
        },
    ],
};

var retriever = await client.Retrievers.Update(parameters);

Console.WriteLine(retriever);
```

#### 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": "auto_routed",
        "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(RetrieverDeleteParamsparameters, CancellationTokencancellationToken = default)`

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

Delete a Retriever by ID.

### Parameters

- `RetrieverDeleteParams parameters`

  - `required string retrieverID`

  - `string? organizationID`

  - `string? projectID`

### Example

```csharp
RetrieverDeleteParams parameters = new()
{
    RetrieverID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
};

await client.Retrievers.Delete(parameters);
```

## Direct Retrieve

`CompositeRetrievalResult Retrievers.Search(RetrieverSearchParamsparameters, CancellationTokencancellationToken = default)`

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

Retrieve data using specified pipelines without creating a persistent retriever.

### Parameters

- `RetrieverSearchParams parameters`

  - `required string query`

    Body param: The query to retrieve against.

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `CompositeRetrievalMode mode`

    Body param: The mode of composite retrieval.

  - `IReadOnlyList<RetrieverPipeline> pipelines`

    Body param: The pipelines to use for retrieval.

    - `required string? Description`

      A description of the retriever tool.

    - `required string? Name`

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

    - `required string PipelineID`

      The ID of the pipeline this tool uses.

    - `PresetRetrievalParams PresetRetrievalParameters`

      Parameters for retrieval configuration.

      - `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.

      - `string ClassName`

      - `Double? DenseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Long? DenseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Boolean? EnableReranking`

        Enable reranking for retrieval

      - `Long? FilesTopK`

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

      - `Long? RerankTopN`

        Number of reranked nodes for returning.

      - `RetrievalMode RetrievalMode`

        The retrieval mode for the query.

        - `"auto_routed"AutoRouted`

        - `"chunks"Chunks`

        - `"files_via_content"FilesViaContent`

        - `"files_via_metadata"FilesViaMetadata`

      - `Boolean RetrieveImageNodes`

        Whether to retrieve image nodes.

      - `Boolean RetrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Boolean RetrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `MetadataFilters? SearchFilters`

        Metadata filters for vector stores.

        - `required IReadOnlyList<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

            - `required string Key`

            - `required Value? Value`

              - `Double`

              - `string`

              - `IReadOnlyList<string>`

              - `IReadOnlyList<Double>`

              - `IReadOnlyList<Long>`

            - `Operator Operator`

              Vector store filter operator.

              - `"!="`

              - `"<"`

              - `"<="`

              - `"=="`

              - `">"`

              - `">="`

              - `"all"All`

              - `"any"Any`

              - `"contains"Contains`

              - `"in"In`

              - `"is_empty"IsEmpty`

              - `"nin"Nin`

              - `"text_match"TextMatch`

              - `"text_match_insensitive"TextMatchInsensitive`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Condition? Condition`

          Vector store filter conditions to combine different filters.

          - `"and"And`

          - `"not"Not`

          - `"or"Or`

      - `IReadOnlyDictionary<string, SearchFiltersInferenceSchema?>? SearchFiltersInferenceSchema`

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

        - `IReadOnlyDictionary<string, JsonElement>`

        - `IReadOnlyList<JsonElement>`

        - `string`

        - `Double`

        - `Boolean`

      - `Long? SparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `ReRankConfig rerankConfig`

    Body param: The rerank configuration for composite retrieval.

  - `Long? rerankTopN`

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

### Returns

- `class CompositeRetrievalResult:`

  - `IReadOnlyList<PageScreenshotNodeWithScore> ImageNodes`

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

    - `required Node Node`

      - `required string FileID`

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

      - `required Long ImageSize`

        The size of the image in bytes

      - `required Long PageIndex`

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

      - `IReadOnlyDictionary<string, JsonElement>? Metadata`

        Metadata for the screenshot

    - `required Double Score`

      The score of the screenshot node

    - `string ClassName`

  - `IReadOnlyList<Node> Nodes`

    The retrieved nodes from the composite retrieval.

    - `required Node Node`

      - `required string ID`

        The ID of the retrieved node.

      - `required Long? EndCharIdx`

        The end character index of the retrieved node in the document

      - `required string PipelineID`

        The ID of the pipeline this node was retrieved from.

      - `required string RetrieverID`

        The ID of the retriever this node was retrieved from.

      - `required string RetrieverPipelineName`

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

      - `required Long? StartCharIdx`

        The start character index of the retrieved node in the document

      - `required string Text`

        The text of the retrieved node.

      - `IReadOnlyDictionary<string, JsonElement> Metadata`

        Metadata associated with the retrieved node.

    - `string ClassName`

    - `Double? Score`

  - `IReadOnlyList<PageFigureNodeWithScore> PageFigureNodes`

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

    - `required Node Node`

      - `required Double Confidence`

        The confidence of the figure

      - `required string FigureName`

        The name of the figure

      - `required Long FigureSize`

        The size of the figure in bytes

      - `required string FileID`

        The ID of the file that the figure was taken from

      - `required Long PageIndex`

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

      - `Boolean IsLikelyNoise`

        Whether the figure is likely to be noise

      - `IReadOnlyDictionary<string, JsonElement>? Metadata`

        Metadata for the figure

    - `required Double Score`

      The score of the figure node

    - `string ClassName`

### Example

```csharp
RetrieverSearchParams parameters = new() { Query = "x" };

var compositeRetrievalResult = await client.Retrievers.Search(parameters);

Console.WriteLine(compositeRetrievalResult);
```

#### 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.

  - `"full"Full`

  - `"routing"Routing`

### Composite Retrieval Result

- `class CompositeRetrievalResult:`

  - `IReadOnlyList<PageScreenshotNodeWithScore> ImageNodes`

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

    - `required Node Node`

      - `required string FileID`

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

      - `required Long ImageSize`

        The size of the image in bytes

      - `required Long PageIndex`

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

      - `IReadOnlyDictionary<string, JsonElement>? Metadata`

        Metadata for the screenshot

    - `required Double Score`

      The score of the screenshot node

    - `string ClassName`

  - `IReadOnlyList<Node> Nodes`

    The retrieved nodes from the composite retrieval.

    - `required Node Node`

      - `required string ID`

        The ID of the retrieved node.

      - `required Long? EndCharIdx`

        The end character index of the retrieved node in the document

      - `required string PipelineID`

        The ID of the pipeline this node was retrieved from.

      - `required string RetrieverID`

        The ID of the retriever this node was retrieved from.

      - `required string RetrieverPipelineName`

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

      - `required Long? StartCharIdx`

        The start character index of the retrieved node in the document

      - `required string Text`

        The text of the retrieved node.

      - `IReadOnlyDictionary<string, JsonElement> Metadata`

        Metadata associated with the retrieved node.

    - `string ClassName`

    - `Double? Score`

  - `IReadOnlyList<PageFigureNodeWithScore> PageFigureNodes`

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

    - `required Node Node`

      - `required Double Confidence`

        The confidence of the figure

      - `required string FigureName`

        The name of the figure

      - `required Long FigureSize`

        The size of the figure in bytes

      - `required string FileID`

        The ID of the file that the figure was taken from

      - `required Long PageIndex`

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

      - `Boolean IsLikelyNoise`

        Whether the figure is likely to be noise

      - `IReadOnlyDictionary<string, JsonElement>? Metadata`

        Metadata for the figure

    - `required Double Score`

      The score of the figure node

    - `string ClassName`

### Re Rank Config

- `class ReRankConfig:`

  - `Long TopN`

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

  - `Type Type`

    The type of reranker to use.

    - `"bedrock"Bedrock`

    - `"cohere"Cohere`

    - `"disabled"Disabled`

    - `"llm"Llm`

    - `"score"Score`

    - `"system_default"SystemDefault`

### Retriever

- `class Retriever:`

  An entity that retrieves context nodes from several sub RetrieverTools.

  - `required string ID`

    Unique identifier

  - `required string Name`

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

  - `required string ProjectID`

    The ID of the project this retriever resides in.

  - `DateTimeOffset? CreatedAt`

    Creation datetime

  - `IReadOnlyList<RetrieverPipeline> Pipelines`

    The pipelines this retriever uses.

    - `required string? Description`

      A description of the retriever tool.

    - `required string? Name`

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

    - `required string PipelineID`

      The ID of the pipeline this tool uses.

    - `PresetRetrievalParams PresetRetrievalParameters`

      Parameters for retrieval configuration.

      - `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.

      - `string ClassName`

      - `Double? DenseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Long? DenseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Boolean? EnableReranking`

        Enable reranking for retrieval

      - `Long? FilesTopK`

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

      - `Long? RerankTopN`

        Number of reranked nodes for returning.

      - `RetrievalMode RetrievalMode`

        The retrieval mode for the query.

        - `"auto_routed"AutoRouted`

        - `"chunks"Chunks`

        - `"files_via_content"FilesViaContent`

        - `"files_via_metadata"FilesViaMetadata`

      - `Boolean RetrieveImageNodes`

        Whether to retrieve image nodes.

      - `Boolean RetrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Boolean RetrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `MetadataFilters? SearchFilters`

        Metadata filters for vector stores.

        - `required IReadOnlyList<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

            - `required string Key`

            - `required Value? Value`

              - `Double`

              - `string`

              - `IReadOnlyList<string>`

              - `IReadOnlyList<Double>`

              - `IReadOnlyList<Long>`

            - `Operator Operator`

              Vector store filter operator.

              - `"!="`

              - `"<"`

              - `"<="`

              - `"=="`

              - `">"`

              - `">="`

              - `"all"All`

              - `"any"Any`

              - `"contains"Contains`

              - `"in"In`

              - `"is_empty"IsEmpty`

              - `"nin"Nin`

              - `"text_match"TextMatch`

              - `"text_match_insensitive"TextMatchInsensitive`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Condition? Condition`

          Vector store filter conditions to combine different filters.

          - `"and"And`

          - `"not"Not`

          - `"or"Or`

      - `IReadOnlyDictionary<string, SearchFiltersInferenceSchema?>? SearchFiltersInferenceSchema`

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

        - `IReadOnlyDictionary<string, JsonElement>`

        - `IReadOnlyList<JsonElement>`

        - `string`

        - `Double`

        - `Boolean`

      - `Long? SparseSimilarityTopK`

        Number of nodes for sparse retrieval.

  - `DateTimeOffset? UpdatedAt`

    Update datetime

### Retriever Create

- `class RetrieverCreate:`

  - `required string Name`

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

  - `IReadOnlyList<RetrieverPipeline> Pipelines`

    The pipelines this retriever uses.

    - `required string? Description`

      A description of the retriever tool.

    - `required string? Name`

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

    - `required string PipelineID`

      The ID of the pipeline this tool uses.

    - `PresetRetrievalParams PresetRetrievalParameters`

      Parameters for retrieval configuration.

      - `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.

      - `string ClassName`

      - `Double? DenseSimilarityCutoff`

        Minimum similarity score wrt query for retrieval

      - `Long? DenseSimilarityTopK`

        Number of nodes for dense retrieval.

      - `Boolean? EnableReranking`

        Enable reranking for retrieval

      - `Long? FilesTopK`

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

      - `Long? RerankTopN`

        Number of reranked nodes for returning.

      - `RetrievalMode RetrievalMode`

        The retrieval mode for the query.

        - `"auto_routed"AutoRouted`

        - `"chunks"Chunks`

        - `"files_via_content"FilesViaContent`

        - `"files_via_metadata"FilesViaMetadata`

      - `Boolean RetrieveImageNodes`

        Whether to retrieve image nodes.

      - `Boolean RetrievePageFigureNodes`

        Whether to retrieve page figure nodes.

      - `Boolean RetrievePageScreenshotNodes`

        Whether to retrieve page screenshot nodes.

      - `MetadataFilters? SearchFilters`

        Metadata filters for vector stores.

        - `required IReadOnlyList<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

            - `required string Key`

            - `required Value? Value`

              - `Double`

              - `string`

              - `IReadOnlyList<string>`

              - `IReadOnlyList<Double>`

              - `IReadOnlyList<Long>`

            - `Operator Operator`

              Vector store filter operator.

              - `"!="`

              - `"<"`

              - `"<="`

              - `"=="`

              - `">"`

              - `">="`

              - `"all"All`

              - `"any"Any`

              - `"contains"Contains`

              - `"in"In`

              - `"is_empty"IsEmpty`

              - `"nin"Nin`

              - `"text_match"TextMatch`

              - `"text_match_insensitive"TextMatchInsensitive`

          - `class MetadataFilters:`

            Metadata filters for vector stores.

        - `Condition? Condition`

          Vector store filter conditions to combine different filters.

          - `"and"And`

          - `"not"Not`

          - `"or"Or`

      - `IReadOnlyDictionary<string, SearchFiltersInferenceSchema?>? SearchFiltersInferenceSchema`

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

        - `IReadOnlyDictionary<string, JsonElement>`

        - `IReadOnlyList<JsonElement>`

        - `string`

        - `Double`

        - `Boolean`

      - `Long? SparseSimilarityTopK`

        Number of nodes for sparse retrieval.

### Retriever Pipeline

- `class RetrieverPipeline:`

  - `required string? Description`

    A description of the retriever tool.

  - `required string? Name`

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

  - `required string PipelineID`

    The ID of the pipeline this tool uses.

  - `PresetRetrievalParams PresetRetrievalParameters`

    Parameters for retrieval configuration.

    - `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.

    - `string ClassName`

    - `Double? DenseSimilarityCutoff`

      Minimum similarity score wrt query for retrieval

    - `Long? DenseSimilarityTopK`

      Number of nodes for dense retrieval.

    - `Boolean? EnableReranking`

      Enable reranking for retrieval

    - `Long? FilesTopK`

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

    - `Long? RerankTopN`

      Number of reranked nodes for returning.

    - `RetrievalMode RetrievalMode`

      The retrieval mode for the query.

      - `"auto_routed"AutoRouted`

      - `"chunks"Chunks`

      - `"files_via_content"FilesViaContent`

      - `"files_via_metadata"FilesViaMetadata`

    - `Boolean RetrieveImageNodes`

      Whether to retrieve image nodes.

    - `Boolean RetrievePageFigureNodes`

      Whether to retrieve page figure nodes.

    - `Boolean RetrievePageScreenshotNodes`

      Whether to retrieve page screenshot nodes.

    - `MetadataFilters? SearchFilters`

      Metadata filters for vector stores.

      - `required IReadOnlyList<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

          - `required string Key`

          - `required Value? Value`

            - `Double`

            - `string`

            - `IReadOnlyList<string>`

            - `IReadOnlyList<Double>`

            - `IReadOnlyList<Long>`

          - `Operator Operator`

            Vector store filter operator.

            - `"!="`

            - `"<"`

            - `"<="`

            - `"=="`

            - `">"`

            - `">="`

            - `"all"All`

            - `"any"Any`

            - `"contains"Contains`

            - `"in"In`

            - `"is_empty"IsEmpty`

            - `"nin"Nin`

            - `"text_match"TextMatch`

            - `"text_match_insensitive"TextMatchInsensitive`

        - `class MetadataFilters:`

          Metadata filters for vector stores.

      - `Condition? Condition`

        Vector store filter conditions to combine different filters.

        - `"and"And`

        - `"not"Not`

        - `"or"Or`

    - `IReadOnlyDictionary<string, SearchFiltersInferenceSchema?>? SearchFiltersInferenceSchema`

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

      - `IReadOnlyDictionary<string, JsonElement>`

      - `IReadOnlyList<JsonElement>`

      - `string`

      - `Double`

      - `Boolean`

    - `Long? SparseSimilarityTopK`

      Number of nodes for sparse retrieval.

# Retriever

## Retrieve

`CompositeRetrievalResult Retrievers.Retriever.Search(RetrieverSearchParamsparameters, CancellationTokencancellationToken = default)`

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

Retrieve data using a Retriever.

### Parameters

- `RetrieverSearchParams parameters`

  - `required string retrieverID`

    Path param

  - `required string query`

    Body param: The query to retrieve against.

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `CompositeRetrievalMode mode`

    Body param: The mode of composite retrieval.

  - `ReRankConfig rerankConfig`

    Body param: The rerank configuration for composite retrieval.

  - `Long? rerankTopN`

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

### Returns

- `class CompositeRetrievalResult:`

  - `IReadOnlyList<PageScreenshotNodeWithScore> ImageNodes`

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

    - `required Node Node`

      - `required string FileID`

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

      - `required Long ImageSize`

        The size of the image in bytes

      - `required Long PageIndex`

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

      - `IReadOnlyDictionary<string, JsonElement>? Metadata`

        Metadata for the screenshot

    - `required Double Score`

      The score of the screenshot node

    - `string ClassName`

  - `IReadOnlyList<Node> Nodes`

    The retrieved nodes from the composite retrieval.

    - `required Node Node`

      - `required string ID`

        The ID of the retrieved node.

      - `required Long? EndCharIdx`

        The end character index of the retrieved node in the document

      - `required string PipelineID`

        The ID of the pipeline this node was retrieved from.

      - `required string RetrieverID`

        The ID of the retriever this node was retrieved from.

      - `required string RetrieverPipelineName`

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

      - `required Long? StartCharIdx`

        The start character index of the retrieved node in the document

      - `required string Text`

        The text of the retrieved node.

      - `IReadOnlyDictionary<string, JsonElement> Metadata`

        Metadata associated with the retrieved node.

    - `string ClassName`

    - `Double? Score`

  - `IReadOnlyList<PageFigureNodeWithScore> PageFigureNodes`

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

    - `required Node Node`

      - `required Double Confidence`

        The confidence of the figure

      - `required string FigureName`

        The name of the figure

      - `required Long FigureSize`

        The size of the figure in bytes

      - `required string FileID`

        The ID of the file that the figure was taken from

      - `required Long PageIndex`

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

      - `Boolean IsLikelyNoise`

        Whether the figure is likely to be noise

      - `IReadOnlyDictionary<string, JsonElement>? Metadata`

        Metadata for the figure

    - `required Double Score`

      The score of the figure node

    - `string ClassName`

### Example

```csharp
RetrieverSearchParams parameters = new()
{
    RetrieverID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    Query = "x",
};

var compositeRetrievalResult = await client.Retrievers.Retriever.Search(parameters);

Console.WriteLine(compositeRetrievalResult);
```

#### 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"
    }
  ]
}
```

# Query
