Saltar al contenido principal

Class: VectorIndexRetriever

Retrievers retrieve the nodes that most closely match our query in similarity.

Implements

Constructors

constructor

new VectorIndexRetriever(«destructured»): VectorIndexRetriever

Parameters

NameType
«destructured»VectorIndexRetrieverOptions

Returns

VectorIndexRetriever

Defined in

packages/core/src/indices/vectorStore/index.ts:430

Properties

imageSimilarityTopK

imageSimilarityTopK: number

Defined in

packages/core/src/indices/vectorStore/index.ts:426


index

index: VectorStoreIndex

Defined in

packages/core/src/indices/vectorStore/index.ts:424


serviceContext

Optional serviceContext: ServiceContext

Implementation of

BaseRetriever.serviceContext

Defined in

packages/core/src/indices/vectorStore/index.ts:428


similarityTopK

similarityTopK: number

Defined in

packages/core/src/indices/vectorStore/index.ts:425

Methods

buildNodeListFromQueryResult

buildNodeListFromQueryResult(result): NodeWithScore<Metadata>[]

Parameters

NameType
resultVectorStoreQueryResult

Returns

NodeWithScore<Metadata>[]

Defined in

packages/core/src/indices/vectorStore/index.ts:514


buildVectorStoreQuery

buildVectorStoreQuery(embedModel, query, similarityTopK, preFilters?): Promise<VectorStoreQuery>

Parameters

NameType
embedModelBaseEmbedding
querystring
similarityTopKnumber
preFilters?MetadataFilters

Returns

Promise<VectorStoreQuery>

Defined in

packages/core/src/indices/vectorStore/index.ts:498


retrieve

retrieve(«destructured»): Promise<NodeWithScore<Metadata>[]>

Parameters

NameType
«destructured»RetrieveParams<MetadataFilters>

Returns

Promise<NodeWithScore<Metadata>[]>

Implementation of

BaseRetriever.retrieve

Defined in

packages/core/src/indices/vectorStore/index.ts:441


sendEvent

sendEvent(query, nodesWithScores): void

Parameters

NameType
querystring
nodesWithScoresNodeWithScore<Metadata>[]

Returns

void

Defined in

packages/core/src/indices/vectorStore/index.ts:488


textRetrieve

textRetrieve(query, preFilters?): Promise<NodeWithScore<Metadata>[]>

Parameters

NameType
querystring
preFilters?MetadataFilters

Returns

Promise<NodeWithScore<Metadata>[]>

Defined in

packages/core/src/indices/vectorStore/index.ts:454


textToImageRetrieve

textToImageRetrieve(query, preFilters?): Promise<NodeWithScore<Metadata>[]>

Parameters

NameType
querystring
preFilters?MetadataFilters

Returns

Promise<NodeWithScore<Metadata>[]>

Defined in

packages/core/src/indices/vectorStore/index.ts:469