## Run Search

`PipelineRetrieveResponse pipelines().retrieve(PipelineRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

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

  - `Optional<String> pipelineId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `String query`

    The query to retrieve against.

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

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

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

### Returns

- `class PipelineRetrieveResponse:`

  Schema for the result of an retrieval execution.

  - `String pipelineId`

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

  - `List<RetrievalNode> retrievalNodes`

    The nodes retrieved by the pipeline for the given query.

    - `TextNode node`

      Provided for backward compatibility.

      - `Optional<String> className`

      - `Optional<List<Double>> embedding`

        Embedding of the node.

      - `Optional<Long> endCharIdx`

        End char index of the node.

      - `Optional<List<String>> excludedEmbedMetadataKeys`

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

      - `Optional<List<String>> excludedLlmMetadataKeys`

        Metadata keys that are excluded from text for the LLM.

      - `Optional<ExtraInfo> extraInfo`

        A flat dictionary of metadata fields

      - `Optional<String> id`

        Unique ID of the node.

      - `Optional<String> metadataSeperator`

        Separator between metadata fields when converting to string.

      - `Optional<String> metadataTemplate`

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

      - `Optional<String> mimetype`

        MIME type of the node content.

      - `Optional<Relationships> relationships`

        A mapping of relationships to other node information.

        - `class RelatedNodeInfo:`

          - `String nodeId`

          - `Optional<String> className`

          - `Optional<String> hash`

          - `Optional<Metadata> metadata`

          - `Optional<NodeType> nodeType`

            - `_1("1")`

            - `_2("2")`

            - `_3("3")`

            - `_4("4")`

            - `_5("5")`

        - `List<RelatedNodeInfo>`

          - `String nodeId`

          - `Optional<String> className`

          - `Optional<String> hash`

          - `Optional<Metadata> metadata`

          - `Optional<NodeType> nodeType`

            - `_1("1")`

            - `_2("2")`

            - `_3("3")`

            - `_4("4")`

            - `_5("5")`

      - `Optional<Long> startCharIdx`

        Start char index of the node.

      - `Optional<String> text`

        Text content of the node.

      - `Optional<String> textTemplate`

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

    - `Optional<String> className`

    - `Optional<Double> score`

  - `Optional<String> className`

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

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

    Metadata associated with the retrieval execution

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

  - `Optional<RetrievalLatency> retrievalLatency`

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

### 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.pipelines.PipelineRetrieveParams;
import com.llamacloud_prod.api.models.pipelines.PipelineRetrieveResponse;

public final class Main {
    private Main() {}

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

        PipelineRetrieveParams params = PipelineRetrieveParams.builder()
            .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
            .query("x")
            .build();
        PipelineRetrieveResponse pipeline = client.pipelines().retrieve(params);
    }
}
```

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