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:418

Properties

imageSimilarityTopK

imageSimilarityTopK: number

Defined in

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


index

index: VectorStoreIndex

Defined in

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


serviceContext

Private serviceContext: ServiceContext

Defined in

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


similarityTopK

similarityTopK: number

Defined in

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

Methods

buildNodeListFromQueryResult

buildNodeListFromQueryResult(result): NodeWithScore<Metadata>[]

Parameters

NameType
resultVectorStoreQueryResult

Returns

NodeWithScore<Metadata>[]

Defined in

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


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:495


getServiceContext

getServiceContext(): ServiceContext

Returns

ServiceContext

Implementation of

BaseRetriever.getServiceContext

Defined in

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


retrieve

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

Parameters

NameType
«destructured»RetrieveParams

Returns

Promise<NodeWithScore<Metadata>[]>

Implementation of

BaseRetriever.retrieve

Defined in

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


sendEvent

sendEvent(query, nodesWithScores, parentEvent): void

Parameters

NameType
querystring
nodesWithScoresNodeWithScore<Metadata>[]
parentEventundefined | Event

Returns

void

Defined in

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


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:445


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:460