## 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 pipelineId` - `Optional organizationId` - `Optional projectId` - `String query` The query to retrieve against. - `Optional 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 className` - `Optional denseSimilarityCutoff` Minimum similarity score wrt query for retrieval - `Optional denseSimilarityTopK` Number of nodes for dense retrieval. - `Optional enableReranking` Enable reranking for retrieval - `Optional filesTopK` Number of files to retrieve (only for retrieval mode files_via_metadata and files_via_content). - `Optional rerankTopN` Number of reranked nodes for returning. - `Optional retrievalMode` The retrieval mode for the query. - `Optional retrieveImageNodes` Whether to retrieve image nodes. - `Optional retrievePageFigureNodes` Whether to retrieve page figure nodes. - `Optional retrievePageScreenshotNodes` Whether to retrieve page screenshot nodes. - `Optional searchFilters` Metadata filters for vector stores. - `Optional searchFiltersInferenceSchema` JSON Schema that will be used to infer search_filters. Omit or leave as null to skip inference. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional 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 retrievalNodes` The nodes retrieved by the pipeline for the given query. - `TextNode node` Provided for backward compatibility. - `Optional className` - `Optional> embedding` Embedding of the node. - `Optional endCharIdx` End char index of the node. - `Optional> excludedEmbedMetadataKeys` Metadata keys that are excluded from text for the embed model. - `Optional> excludedLlmMetadataKeys` Metadata keys that are excluded from text for the LLM. - `Optional extraInfo` A flat dictionary of metadata fields - `Optional id` Unique ID of the node. - `Optional metadataSeperator` Separator between metadata fields when converting to string. - `Optional metadataTemplate` Template for how metadata is formatted, with {key} and {value} placeholders. - `Optional mimetype` MIME type of the node content. - `Optional relationships` A mapping of relationships to other node information. - `class RelatedNodeInfo:` - `String nodeId` - `Optional className` - `Optional hash` - `Optional metadata` - `Optional nodeType` - `_1("1")` - `_2("2")` - `_3("3")` - `_4("4")` - `_5("5")` - `List` - `String nodeId` - `Optional className` - `Optional hash` - `Optional metadata` - `Optional nodeType` - `_1("1")` - `_2("2")` - `_3("3")` - `_4("4")` - `_5("5")` - `Optional startCharIdx` Start char index of the node. - `Optional text` Text content of the node. - `Optional textTemplate` Template for how text is formatted, with {content} and {metadata_str} placeholders. - `Optional className` - `Optional score` - `Optional className` - `Optional> 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 for the screenshot - `double score` The score of the screenshot node - `Optional className` - `Optional inferredSearchFilters` Metadata filters for vector stores. - `List 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` - `double` - `String` - `List` - `List` - `List` - `Optional 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` Vector store filter conditions to combine different filters. - `AND("and")` - `OR("or")` - `NOT("not")` - `Optional metadata` Metadata associated with the retrieval execution - `Optional> 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 isLikelyNoise` Whether the figure is likely to be noise - `Optional metadata` Metadata for the figure - `double score` The score of the figure node - `Optional className` - `Optional 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 } } ```