Skip to main content

Class: VectorIndexRetriever

VectorIndexRetriever retrieves nodes from a VectorIndex.

Implements

Constructors

constructor

new VectorIndexRetriever(«destructured»)

Parameters

NameType
«destructured»Object
› indexVectorStoreIndex
› similarityTopK?number

Defined in

indices/vectorStore/VectorIndexRetriever.ts:22

Properties

index

index: VectorStoreIndex

Defined in

indices/vectorStore/VectorIndexRetriever.ts:18


serviceContext

Private serviceContext: ServiceContext

Defined in

indices/vectorStore/VectorIndexRetriever.ts:20


similarityTopK

similarityTopK: number

Defined in

indices/vectorStore/VectorIndexRetriever.ts:19

Methods

getServiceContext

getServiceContext(): ServiceContext

Returns

ServiceContext

Implementation of

BaseRetriever.getServiceContext

Defined in

indices/vectorStore/VectorIndexRetriever.ts:69


retrieve

retrieve(query, parentEvent?): Promise<NodeWithScore[]>

Parameters

NameType
querystring
parentEvent?Event

Returns

Promise<NodeWithScore[]>

Implementation of

BaseRetriever.retrieve

Defined in

indices/vectorStore/VectorIndexRetriever.ts:35