Skip to content
Get started

Run Search

client.pipelines.retrieve(stringpipelineID, PipelineRetrieveParams { query, organization_id, project_id, 14 more } params, RequestOptionsoptions?): PipelineRetrieveResponse { pipeline_id, retrieval_nodes, class_name, 5 more }
POST/api/v1/pipelines/{pipeline_id}/retrieve

Get retrieval results for a managed pipeline and a query

ParametersExpand Collapse
pipelineID: string
params: PipelineRetrieveParams { query, organization_id, project_id, 14 more }
query: string

Body param: The query to retrieve against.

minLength1
organization_id?: string | null

Query param

formatuuid
project_id?: string | null

Query param

formatuuid
alpha?: number | null

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.

maximum1
minimum0
class_name?: string

Body param

dense_similarity_cutoff?: number | null

Body param: Minimum similarity score wrt query for retrieval

maximum1
minimum0
dense_similarity_top_k?: number | null

Body param: Number of nodes for dense retrieval.

maximum100
minimum1
enable_reranking?: boolean | null

Body param: Enable reranking for retrieval

files_top_k?: number | null

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

maximum5
minimum1
rerank_top_n?: number | null

Body param: Number of reranked nodes for returning.

maximum100
minimum1
retrieval_mode?: RetrievalMode

Body param: The retrieval mode for the query.

Accepts one of the following:
"chunks"
"files_via_metadata"
"files_via_content"
"auto_routed"
Deprecatedretrieve_image_nodes?: boolean

Body param: Whether to retrieve image nodes.

retrieve_page_figure_nodes?: boolean

Body param: Whether to retrieve page figure nodes.

retrieve_page_screenshot_nodes?: boolean

Body param: Whether to retrieve page screenshot nodes.

search_filters?: MetadataFilters { filters, condition } | null

Body param: Metadata filters for vector stores.

filters: Array<MetadataFilter { key, value, operator } | MetadataFilters { filters, condition } >
Accepts one of the following:
MetadataFilter { key, value, operator }

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

key: string
value: number | string | Array<string> | 2 more | null
Accepts one of the following:
number
string
Array<string>
Array<number>
Array<number>
operator?: "==" | ">" | "<" | 11 more

Vector store filter operator.

Accepts one of the following:
"=="
">"
"<"
"!="
">="
"<="
"in"
"nin"
"any"
"all"
"text_match"
"text_match_insensitive"
"contains"
"is_empty"
MetadataFilters { filters, condition }

Metadata filters for vector stores.

filters: Array<MetadataFilter { key, value, operator } | MetadataFilters { filters, condition } >
Accepts one of the following:
MetadataFilter { key, value, operator }

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

key: string
value: number | string | Array<string> | 2 more | null
Accepts one of the following:
number
string
Array<string>
Array<number>
Array<number>
operator?: "==" | ">" | "<" | 11 more

Vector store filter operator.

Accepts one of the following:
"=="
">"
"<"
"!="
">="
"<="
"in"
"nin"
"any"
"all"
"text_match"
"text_match_insensitive"
"contains"
"is_empty"
MetadataFilters { filters, condition }
condition?: "and" | "or" | "not" | null

Vector store filter conditions to combine different filters.

Accepts one of the following:
"and"
"or"
"not"
condition?: "and" | "or" | "not" | null

Vector store filter conditions to combine different filters.

Accepts one of the following:
"and"
"or"
"not"
search_filters_inference_schema?: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null> | null

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

Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
sparse_similarity_top_k?: number | null

Body param: Number of nodes for sparse retrieval.

maximum100
minimum1
ReturnsExpand Collapse
PipelineRetrieveResponse { pipeline_id, retrieval_nodes, class_name, 5 more }

Schema for the result of an retrieval execution.

pipeline_id: string

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

formatuuid
retrieval_nodes: Array<RetrievalNode>

The nodes retrieved by the pipeline for the given query.

node: TextNode { class_name, embedding, end_char_idx, 11 more }

Provided for backward compatibility.

Note: we keep the field with the typo "seperator" to maintain backward compatibility for serialized objects.

class_name?: string
embedding?: Array<number> | null

Embedding of the node.

end_char_idx?: number | null

End char index of the node.

excluded_embed_metadata_keys?: Array<string>

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

excluded_llm_metadata_keys?: Array<string>

Metadata keys that are excluded from text for the LLM.

extra_info?: Record<string, unknown>

A flat dictionary of metadata fields

id_?: string

Unique ID of the node.

metadata_seperator?: string

Separator between metadata fields when converting to string.

metadata_template?: string

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

mimetype?: string

MIME type of the node content.

relationships?: Record<string, RelatedNodeInfo { node_id, class_name, hash, 2 more } | Array<UnionMember1>>

A mapping of relationships to other node information.

Accepts one of the following:
RelatedNodeInfo { node_id, class_name, hash, 2 more }
node_id: string
class_name?: string
hash?: string | null
metadata?: Record<string, unknown>
node_type?: "1" | "2" | "3" | 2 more | (string & {}) | null
Accepts one of the following:
"1" | "2" | "3" | 2 more
"1"
"2"
"3"
"4"
"5"
(string & {})
Array<UnionMember1>
node_id: string
class_name?: string
hash?: string | null
metadata?: Record<string, unknown>
node_type?: "1" | "2" | "3" | 2 more | (string & {}) | null
Accepts one of the following:
"1" | "2" | "3" | 2 more
"1"
"2"
"3"
"4"
"5"
(string & {})
start_char_idx?: number | null

Start char index of the node.

text?: string

Text content of the node.

text_template?: string

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

class_name?: string
score?: number | null
class_name?: string
Deprecatedimage_nodes?: Array<PageScreenshotNodeWithScore { node, score, class_name } >

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

node: Node { file_id, image_size, page_index, metadata }
file_id: string

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

formatuuid
image_size: number

The size of the image in bytes

minimum0
page_index: number

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

minimum0
metadata?: Record<string, unknown> | null

Metadata for the screenshot

score: number

The score of the screenshot node

class_name?: string
inferred_search_filters?: MetadataFilters { filters, condition } | null

Metadata filters for vector stores.

filters: Array<MetadataFilter { key, value, operator } | MetadataFilters { filters, condition } >
Accepts one of the following:
MetadataFilter { key, value, operator }

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

key: string
value: number | string | Array<string> | 2 more | null
Accepts one of the following:
number
string
Array<string>
Array<number>
Array<number>
operator?: "==" | ">" | "<" | 11 more

Vector store filter operator.

Accepts one of the following:
"=="
">"
"<"
"!="
">="
"<="
"in"
"nin"
"any"
"all"
"text_match"
"text_match_insensitive"
"contains"
"is_empty"
MetadataFilters { filters, condition }

Metadata filters for vector stores.

filters: Array<MetadataFilter { key, value, operator } | MetadataFilters { filters, condition } >
Accepts one of the following:
MetadataFilter { key, value, operator }

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

key: string
value: number | string | Array<string> | 2 more | null
Accepts one of the following:
number
string
Array<string>
Array<number>
Array<number>
operator?: "==" | ">" | "<" | 11 more

Vector store filter operator.

Accepts one of the following:
"=="
">"
"<"
"!="
">="
"<="
"in"
"nin"
"any"
"all"
"text_match"
"text_match_insensitive"
"contains"
"is_empty"
MetadataFilters { filters, condition }
condition?: "and" | "or" | "not" | null

Vector store filter conditions to combine different filters.

Accepts one of the following:
"and"
"or"
"not"
condition?: "and" | "or" | "not" | null

Vector store filter conditions to combine different filters.

Accepts one of the following:
"and"
"or"
"not"
metadata?: Record<string, string>

Metadata associated with the retrieval execution

page_figure_nodes?: Array<PageFigureNodeWithScore { node, score, class_name } >

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

node: Node { confidence, figure_name, figure_size, 4 more }
confidence: number

The confidence of the figure

maximum1
minimum0
figure_name: string

The name of the figure

figure_size: number

The size of the figure in bytes

minimum0
file_id: string

The ID of the file that the figure was taken from

formatuuid
page_index: number

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

minimum0
is_likely_noise?: boolean

Whether the figure is likely to be noise

metadata?: Record<string, unknown> | null

Metadata for the figure

score: number

The score of the figure node

class_name?: string
retrieval_latency?: Record<string, number>

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

Run Search

import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

const pipeline = await client.pipelines.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
  query: 'x',
});

console.log(pipeline.pipeline_id);
{
  "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
  }
}
Returns Examples
{
  "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
  }
}