Skip to content

Run Search

client.Pipelines.Get(ctx, pipelineID, params) (*PipelineGetResponse, error)
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.

ParametersExpand Collapse
pipelineID string
params PipelineGetParams
Query param.Field[string]

Body param: The query to retrieve against.

minLength1
OrganizationID param.Field[string]optional

Query param

formatuuid
ProjectID param.Field[string]optional

Query param

formatuuid
Alpha param.Field[float64]optional

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
ClassName param.Field[string]optional

Body param

DenseSimilarityCutoff param.Field[float64]optional

Body param: Minimum similarity score wrt query for retrieval

maximum1
minimum0
DenseSimilarityTopK param.Field[int64]optional

Body param: Number of nodes for dense retrieval.

maximum100
minimum1
EnableReranking param.Field[bool]optional

Body param: Enable reranking for retrieval

FilesTopK param.Field[int64]optional

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

maximum5
minimum1
RerankTopN param.Field[int64]optional

Body param: Number of reranked nodes for returning.

maximum100
minimum1
RetrievalMode param.Field[RetrievalMode]optional

Body param: The retrieval mode for the query.

DeprecatedRetrieveImageNodes param.Field[bool]optional

Body param: Whether to retrieve image nodes.

RetrievePageFigureNodes param.Field[bool]optional

Body param: Whether to retrieve page figure nodes.

RetrievePageScreenshotNodes param.Field[bool]optional

Body param: Whether to retrieve page screenshot nodes.

SearchFilters param.Field[MetadataFilters]optional

Body param: Metadata filters for vector stores.

SearchFiltersInferenceSchema param.Field[map[string, PipelineGetParamsSearchFiltersInferenceSchemaUnion]]optional

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

type PipelineGetParamsSearchFiltersInferenceSchemaMap map[string, any]
type PipelineGetParamsSearchFiltersInferenceSchemaArray []any
string
float64
bool
SparseSimilarityTopK param.Field[int64]optional

Body param: Number of nodes for sparse retrieval.

maximum100
minimum1
ReturnsExpand Collapse
type PipelineGetResponse struct{…}

Schema for the result of an retrieval execution.

PipelineID string

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

formatuuid
RetrievalNodes []PipelineGetResponseRetrievalNode

The nodes retrieved by the pipeline for the given query.

Provided for backward compatibility.

ClassName stringoptional
Embedding []float64optional

Embedding of the node.

EndCharIdx int64optional

End char index of the node.

ExcludedEmbedMetadataKeys []stringoptional

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

ExcludedLlmMetadataKeys []stringoptional

Metadata keys that are excluded from text for the LLM.

ExtraInfo map[string, any]optional

A flat dictionary of metadata fields

ID stringoptional

Unique ID of the node.

MetadataSeperator stringoptional

Separator between metadata fields when converting to string.

MetadataTemplate stringoptional

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

Mimetype stringoptional

MIME type of the node content.

Relationships map[string, TextNodeRelationshipUnion]optional

A mapping of relationships to other node information.

One of the following:
type TextNodeRelationshipRelatedNodeInfo struct{…}
NodeID string
ClassName stringoptional
Hash stringoptional
Metadata map[string, any]optional
NodeType stringoptional
One of the following:
string
One of the following:
const TextNodeRelationshipRelatedNodeInfoNodeType1 TextNodeRelationshipRelatedNodeInfoNodeType = "1"
const TextNodeRelationshipRelatedNodeInfoNodeType2 TextNodeRelationshipRelatedNodeInfoNodeType = "2"
const TextNodeRelationshipRelatedNodeInfoNodeType3 TextNodeRelationshipRelatedNodeInfoNodeType = "3"
const TextNodeRelationshipRelatedNodeInfoNodeType4 TextNodeRelationshipRelatedNodeInfoNodeType = "4"
const TextNodeRelationshipRelatedNodeInfoNodeType5 TextNodeRelationshipRelatedNodeInfoNodeType = "5"
string
type TextNodeRelationshipArray []TextNodeRelationshipArrayItem
NodeID string
ClassName stringoptional
Hash stringoptional
Metadata map[string, any]optional
NodeType stringoptional
One of the following:
string
One of the following:
const TextNodeRelationshipArrayItemNodeType1 TextNodeRelationshipArrayItemNodeType = "1"
const TextNodeRelationshipArrayItemNodeType2 TextNodeRelationshipArrayItemNodeType = "2"
const TextNodeRelationshipArrayItemNodeType3 TextNodeRelationshipArrayItemNodeType = "3"
const TextNodeRelationshipArrayItemNodeType4 TextNodeRelationshipArrayItemNodeType = "4"
const TextNodeRelationshipArrayItemNodeType5 TextNodeRelationshipArrayItemNodeType = "5"
string
StartCharIdx int64optional

Start char index of the node.

Text stringoptional

Text content of the node.

TextTemplate stringoptional

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

ClassName stringoptional
Score float64optional
ClassName stringoptional
DeprecatedImageNodes []PageScreenshotNodeWithScoreoptional

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

Node PageScreenshotNodeWithScoreNode
FileID string

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

formatuuid
ImageSize int64

The size of the image in bytes

minimum0
PageIndex int64

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

minimum0
Metadata map[string, any]optional

Metadata for the screenshot

Score float64

The score of the screenshot node

ClassName stringoptional
InferredSearchFilters MetadataFiltersoptional

Metadata filters for vector stores.

Filters []MetadataFiltersFilterUnion
One of the following:
type MetadataFiltersFilterMetadataFilter struct{…}

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 MetadataFiltersFilterMetadataFilterValueUnion
One of the following:
float64
string
type MetadataFiltersFilterMetadataFilterValueArray []string
type MetadataFiltersFilterMetadataFilterValueArray []float64
type MetadataFiltersFilterMetadataFilterValueArray []int64
Operator stringoptional

Vector store filter operator.

One of the following:
const MetadataFiltersFilterMetadataFilterOperatorEquals MetadataFiltersFilterMetadataFilterOperator = "=="
const MetadataFiltersFilterMetadataFilterOperatorGreater MetadataFiltersFilterMetadataFilterOperator = ">"
const MetadataFiltersFilterMetadataFilterOperatorLess MetadataFiltersFilterMetadataFilterOperator = "<"
const MetadataFiltersFilterMetadataFilterOperatorNotEquals MetadataFiltersFilterMetadataFilterOperator = "!="
const MetadataFiltersFilterMetadataFilterOperatorGreaterOrEquals MetadataFiltersFilterMetadataFilterOperator = ">="
const MetadataFiltersFilterMetadataFilterOperatorLessOrEquals MetadataFiltersFilterMetadataFilterOperator = "<="
const MetadataFiltersFilterMetadataFilterOperatorIn MetadataFiltersFilterMetadataFilterOperator = "in"
const MetadataFiltersFilterMetadataFilterOperatorNin MetadataFiltersFilterMetadataFilterOperator = "nin"
const MetadataFiltersFilterMetadataFilterOperatorAny MetadataFiltersFilterMetadataFilterOperator = "any"
const MetadataFiltersFilterMetadataFilterOperatorAll MetadataFiltersFilterMetadataFilterOperator = "all"
const MetadataFiltersFilterMetadataFilterOperatorTextMatch MetadataFiltersFilterMetadataFilterOperator = "text_match"
const MetadataFiltersFilterMetadataFilterOperatorTextMatchInsensitive MetadataFiltersFilterMetadataFilterOperator = "text_match_insensitive"
const MetadataFiltersFilterMetadataFilterOperatorContains MetadataFiltersFilterMetadataFilterOperator = "contains"
const MetadataFiltersFilterMetadataFilterOperatorIsEmpty MetadataFiltersFilterMetadataFilterOperator = "is_empty"
type MetadataFilters MetadataFilters

Metadata filters for vector stores.

Condition MetadataFiltersConditionoptional

Vector store filter conditions to combine different filters.

One of the following:
const MetadataFiltersConditionAnd MetadataFiltersCondition = "and"
const MetadataFiltersConditionOr MetadataFiltersCondition = "or"
const MetadataFiltersConditionNot MetadataFiltersCondition = "not"
Metadata map[string, string]optional

Metadata associated with the retrieval execution

PageFigureNodes []PageFigureNodeWithScoreoptional

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

Node PageFigureNodeWithScoreNode
Confidence float64

The confidence of the figure

maximum1
minimum0
FigureName string

The name of the figure

FigureSize int64

The size of the figure in bytes

minimum0
FileID string

The ID of the file that the figure was taken from

formatuuid
PageIndex int64

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

minimum0
IsLikelyNoise booloptional

Whether the figure is likely to be noise

Metadata map[string, any]optional

Metadata for the figure

Score float64

The score of the figure node

ClassName stringoptional
RetrievalLatency map[string, float64]optional

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

Run Search

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/llamacloud-prod-go"
  "github.com/stainless-sdks/llamacloud-prod-go/option"
)

func main() {
  client := llamacloudprod.NewClient(
    option.WithAPIKey("My API Key"),
  )
  pipeline, err := client.Pipelines.Get(
    context.TODO(),
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    llamacloudprod.PipelineGetParams{
      Query: "x",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", pipeline.PipelineID)
}
{
  "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
  }
}