## Run Search

`PipelineRetrieveResponse Pipelines.Retrieve(PipelineRetrieveParamsparameters, CancellationTokencancellationToken = default)`

**post** `/api/v1/pipelines/{pipeline_id}/retrieve`

Run a retrieval query against a managed pipeline.

Searches the pipeline's vector store using the provided query
and retrieval parameters. Supports dense, sparse, and hybrid
search modes with configurable top-k and reranking.

### Parameters

- `PipelineRetrieveParams parameters`

  - `required string pipelineID`

    Path param

  - `required string query`

    Body param: The query to retrieve against.

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `Double? alpha`

    Body param: 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`

    Body param

  - `Double? denseSimilarityCutoff`

    Body param: Minimum similarity score wrt query for retrieval

  - `Long? denseSimilarityTopK`

    Body param: Number of nodes for dense retrieval.

  - `Boolean? enableReranking`

    Body param: Enable reranking for retrieval

  - `Long? filesTopK`

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

  - `Long? rerankTopN`

    Body param: Number of reranked nodes for returning.

  - `RetrievalMode retrievalMode`

    Body param: The retrieval mode for the query.

  - `Boolean retrieveImageNodes`

    Body param: Whether to retrieve image nodes.

  - `Boolean retrievePageFigureNodes`

    Body param: Whether to retrieve page figure nodes.

  - `Boolean retrievePageScreenshotNodes`

    Body param: Whether to retrieve page screenshot nodes.

  - `MetadataFilters? searchFilters`

    Body param: Metadata filters for vector stores.

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

    Body param: 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`

    Body param: Number of nodes for sparse retrieval.

### Returns

- `class PipelineRetrieveResponse:`

  Schema for the result of an retrieval execution.

  - `required string PipelineID`

    The ID of the pipeline that the query was retrieved against.

  - `required IReadOnlyList<RetrievalNode> RetrievalNodes`

    The nodes retrieved by the pipeline for the given query.

    - `required TextNode Node`

      Provided for backward compatibility.

      - `string ClassName`

      - `IReadOnlyList<Double>? Embedding`

        Embedding of the node.

      - `Long? EndCharIdx`

        End char index of the node.

      - `IReadOnlyList<string> ExcludedEmbedMetadataKeys`

        Metadata keys that are excluded from text for the embed model.

      - `IReadOnlyList<string> ExcludedLlmMetadataKeys`

        Metadata keys that are excluded from text for the LLM.

      - `IReadOnlyDictionary<string, JsonElement> ExtraInfo`

        A flat dictionary of metadata fields

      - `string ID`

        Unique ID of the node.

      - `string MetadataSeperator`

        Separator between metadata fields when converting to string.

      - `string MetadataTemplate`

        Template for how metadata is formatted, with {key} and {value} placeholders.

      - `string Mimetype`

        MIME type of the node content.

      - `IReadOnlyDictionary<string, Relationship> Relationships`

        A mapping of relationships to other node information.

        - `class RelatedNodeInfo:`

          - `required string NodeID`

          - `string ClassName`

          - `string? Hash`

          - `IReadOnlyDictionary<string, JsonElement> Metadata`

          - `NodeType? NodeType`

            - `"1"1`

            - `"2"2`

            - `"3"3`

            - `"4"4`

            - `"5"5`

        - `IReadOnlyList<RelatedNodeInfo>`

          - `required string NodeID`

          - `string ClassName`

          - `string? Hash`

          - `IReadOnlyDictionary<string, JsonElement> Metadata`

          - `NodeType? NodeType`

            - `"1"1`

            - `"2"2`

            - `"3"3`

            - `"4"4`

            - `"5"5`

      - `Long? StartCharIdx`

        Start char index of the node.

      - `string Text`

        Text content of the node.

      - `string TextTemplate`

        Template for how text is formatted, with {content} and {metadata_str} placeholders.

    - `string ClassName`

    - `Double? Score`

  - `string ClassName`

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

  - `MetadataFilters? InferredSearchFilters`

    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, string> Metadata`

    Metadata associated with the retrieval execution

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

  - `IReadOnlyDictionary<string, Double> RetrievalLatency`

    The end-to-end latency for retrieval and reranking.

### Example

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

var pipeline = await client.Pipelines.Retrieve(parameters);

Console.WriteLine(pipeline);
```

#### Response

```json
{
  "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "retrieval_nodes": [
    {
      "node": {
        "class_name": "class_name",
        "embedding": [
          0
        ],
        "end_char_idx": 0,
        "excluded_embed_metadata_keys": [
          "string"
        ],
        "excluded_llm_metadata_keys": [
          "string"
        ],
        "extra_info": {
          "foo": "bar"
        },
        "id_": "id_",
        "metadata_seperator": "metadata_seperator",
        "metadata_template": "metadata_template",
        "mimetype": "mimetype",
        "relationships": {
          "foo": {
            "node_id": "node_id",
            "class_name": "class_name",
            "hash": "hash",
            "metadata": {
              "foo": "bar"
            },
            "node_type": "1"
          }
        },
        "start_char_idx": 0,
        "text": "text",
        "text_template": "text_template"
      },
      "class_name": "class_name",
      "score": 0
    }
  ],
  "class_name": "class_name",
  "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"
    }
  ],
  "inferred_search_filters": {
    "filters": [
      {
        "key": "key",
        "value": 0,
        "operator": "!="
      }
    ],
    "condition": "and"
  },
  "metadata": {
    "foo": "string"
  },
  "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"
    }
  ],
  "retrieval_latency": {
    "foo": 0
  }
}
```
